forked from Speiger/Primitive-Collections
37 lines
730 B
Plaintext
37 lines
730 B
Plaintext
package speiger.src.collections.PACKAGE.collections;
|
|
|
|
import speiger.src.collections.utils.Stack;
|
|
|
|
public interface STACK extends Stack<CLASS_TYPE>
|
|
{
|
|
public void PUSH(KEY_TYPE e);
|
|
|
|
public KEY_TYPE POP();
|
|
|
|
public default KEY_TYPE TOP() {
|
|
return PEEK(0);
|
|
}
|
|
|
|
public KEY_TYPE PEEK(int index);
|
|
|
|
#if !OBJECT_TYPE
|
|
@Deprecated
|
|
public default void push(CLASS_TYPE e) { PUSH(OBJ_TO_KEY(e)); }
|
|
|
|
@Deprecated
|
|
public default CLASS_TYPE pop() { return KEY_TO_OBJ(POP()); }
|
|
|
|
@Deprecated
|
|
public default CLASS_TYPE top() {
|
|
return peek(size() - 1);
|
|
}
|
|
|
|
@Deprecated
|
|
public default CLASS_TYPE bottom() {
|
|
return peek(0);
|
|
}
|
|
|
|
@Deprecated
|
|
public default CLASS_TYPE peek(int index) { return KEY_TO_OBJ(PEEK(index)); }
|
|
#endif
|
|
} |