public class IdentityStack<E> extends Stack<E>
capacityIncrement, elementCount, elementData
modCount
Constructor and Description |
---|
IdentityStack()
Default constructor.
|
IdentityStack(E o)
Construct a new IdentityStack with the specified Object
as the bottom element.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Object o)
Override methods that use
.equals() comparisons on elements. |
boolean |
containsAll(Collection<?> c)
Returns true if this Vector contains all of the elements in the specified Collection.
|
static <E> IdentityStack<E> |
getInstance(Stack<E> s)
Get an IdentityStack containing the contents of the specified Stack.
|
int |
indexOf(Object o,
int pos)
Override methods that use
.equals() comparisons on elements. |
int |
lastIndexOf(Object o,
int pos)
Override methods that use
.equals() comparisons on elements. |
boolean |
removeAll(Collection<?> c)
Removes from this Vector all of its elements that are contained in the specified Collection.
|
boolean |
retainAll(Collection c)
Retains only the elements in this Vector that are contained in the specified Collection.
|
add, add, addAll, addAll, addElement, capacity, clear, clone, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, listIterator, listIterator, remove, remove, removeAllElements, removeElement, removeElementAt, removeRange, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
public IdentityStack()
public IdentityStack(E o)
o
- the bottom element.public boolean contains(Object o)
.equals()
comparisons on elements.contains
in interface Collection<E>
contains
in interface List<E>
contains
in class Vector<E>
o
- the Object to search for.Vector.contains(Object)
public boolean containsAll(Collection<?> c)
Vector
containsAll
in interface Collection<E>
containsAll
in interface List<E>
containsAll
in class Vector<E>
c
- a collection whose elements will be tested for containment in this VectorAbstractCollection.contains(Object)
public static <E> IdentityStack<E> getInstance(Stack<E> s)
s
- the Stack to copy; ignored if null.public int indexOf(Object o, int pos)
.equals()
comparisons on elements.indexOf
in class Vector<E>
o
- the Object to search for.pos
- the position from which to search.Vector.indexOf(Object, int)
public int lastIndexOf(Object o, int pos)
.equals()
comparisons on elements.lastIndexOf
in class Vector<E>
o
- the Object to search for.pos
- the position from which to search (backward).Vector.indexOf(Object, int)
public boolean removeAll(Collection<?> c)
Vector
removeAll
in interface Collection<E>
removeAll
in interface List<E>
removeAll
in class Vector<E>
c
- a collection of elements to be removed from the VectorAbstractCollection.remove(Object)
,
AbstractCollection.contains(Object)
public boolean retainAll(Collection c)
Vector
retainAll
in interface Collection<E>
retainAll
in interface List<E>
retainAll
in class Vector<E>
c
- a collection of elements to be retained in this Vector (all other elements are removed)AbstractCollection.remove(Object)
,
AbstractCollection.contains(Object)