T
- @ParametersAreNullableByDefault public class SimpleStackNullSupport<T> extends Object implements List<T>
Constructor and Description |
---|
SimpleStackNullSupport()
Construct a stack, default size is 20
|
SimpleStackNullSupport(int size)
construct a stack with specified size
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T element)
Not implemented, can be overwritten.
|
boolean |
add(T e) |
boolean |
addAll(Collection<? extends T> c)
Not implemented, can be overwritten.
|
boolean |
addAll(int index,
Collection<? extends T> c)
Not implemented, can be overwritten.
|
void |
clear()
Clear the stack - also makes sure the stack objects are not referenced anymore
|
boolean |
contains(Object o)
can be overwritten to optimize.
|
boolean |
containsAll(Collection<?> c)
Not implemented, can be overwritten.
|
boolean |
equals(Object obj) |
T |
get(int index) |
T |
getFromPtr(int ptr)
get element from stack at index relative to base
|
int |
getPtr()
get the curent stack pos relative to base
|
boolean |
hasElements() |
int |
hashCode()
can be overwritten for better implementation.
|
int |
indexOf(Object o)
Not implemented, can be overwritten.
|
boolean |
isEmpty()
check if stack is empty
|
Iterator<T> |
iterator()
Not implemented, can be overwritten.
|
int |
lastIndexOf(Object o)
Not implemented, can be overwritten.
|
ListIterator<T> |
listIterator()
Not implemented, can be overwritten.
|
ListIterator<T> |
listIterator(int index)
Not implemented, can be overwritten.
|
T |
peek()
take a look at the top of stack.
|
T[] |
peek(int n) |
T |
peekElemAfter(T until) |
T |
peekFromTop(int n) |
T[] |
peekUntil(T until) |
T |
pop()
pops object out of stack
|
T[] |
pop(int n) |
void |
popTo(T[] to,
int n) |
T[] |
popUntil(T until) |
void |
push(T o)
push object into stack
|
void |
pushAll(T... args)
Push more objects into the stack
|
int |
pushAndGetIdx(T o) |
void |
pushNull()
pushes a null on top of stack.
|
void |
remove() |
T |
remove(int index) |
boolean |
remove(Object o)
Can be overwritten for better implementation.
|
boolean |
removeAll(Collection<?> c)
Not implemented, can be overwritten.
|
void |
removeFromTop(int n) |
void |
replaceFromTop(int n,
T value) |
boolean |
retainAll(Collection<?> c)
Not implemented, can be overwritten.
|
T |
set(int index,
T element) |
int |
size() |
List<T> |
subList(int fromIndex,
int toIndex)
Not implemented, can be overwritten.
|
Object[] |
toArray() |
<T> T[] |
toArray(T[] a)
Not implemented, can be overwritten.
|
String |
toString()
to string representation.
|
String |
toString(char separator)
returns a character separated string with the stack elements
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
replaceAll, sort, spliterator
parallelStream, removeIf, stream
public SimpleStackNullSupport(int size)
public SimpleStackNullSupport()
public final boolean isEmpty()
public final void push(T o)
o
- Objectpublic void pushNull()
public final int pushAndGetIdx(T o)
public final void pushAll(T... args)
args
- public final T pop()
public final void remove()
public final T[] pop(int n)
public final void popTo(T[] to, int n)
public final void removeFromTop(int n)
public final boolean hasElements()
public T peek()
public final T peekFromTop(int n)
public final void replaceFromTop(int n, T value)
public final T[] peek(int n)
public final void clear()
public final int getPtr()
public final T getFromPtr(int ptr)
ptr
- public final String toString(char separator)
separator
- public String toString()
public final int size()
public boolean contains(Object o)
public final Object[] toArray()
public <T> T[] toArray(T[] a)
public final boolean add(T e)
public boolean remove(Object o)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<T>
containsAll
in interface List<T>
public boolean addAll(Collection<? extends T> c)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public final boolean equals(Object obj)
public int hashCode()
public boolean addAll(int index, Collection<? extends T> c)
public void add(int index, T element)
public int indexOf(Object o)
public int lastIndexOf(Object o)
lastIndexOf
in interface List<T>
public ListIterator<T> listIterator()
listIterator
in interface List<T>
public ListIterator<T> listIterator(int index)
listIterator
in interface List<T>
Copyright © 2021 SPF4J. All rights reserved.