Package org.apache.tools.ant.util
Class IdentityStack<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<E>
java.util.Stack<E>
org.apache.tools.ant.util.IdentityStack<E>
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>,java.util.RandomAccess
public class IdentityStack<E>
extends java.util.Stack<E>
Identity Stack.
- Since:
- Ant 1.7
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementDataFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors Constructor Description IdentityStack()Default constructor.IdentityStack(E o)Construct a new IdentityStack with the specified Object as the bottom element. -
Method Summary
Modifier and Type Method Description booleancontains(java.lang.Object o)Override methods that use.equals()comparisons on elements.booleancontainsAll(java.util.Collection<?> c)static <E> IdentityStack<E>getInstance(java.util.Stack<E> s)Get an IdentityStack containing the contents of the specified Stack.intindexOf(java.lang.Object o, int pos)Override methods that use.equals()comparisons on elements.intlastIndexOf(java.lang.Object o, int pos)Override methods that use.equals()comparisons on elements.booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)Methods inherited from class java.util.Stack
empty, peek, pop, push, searchMethods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, listIterator, listIterator, remove, remove, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSizeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Constructor Details
-
IdentityStack
public IdentityStack()Default constructor. -
IdentityStack
Construct a new IdentityStack with the specified Object as the bottom element.- Parameters:
o- the bottom element.
-
-
Method Details
-
getInstance
Get an IdentityStack containing the contents of the specified Stack.- Type Parameters:
E- desired type- Parameters:
s- the Stack to copy; ignored if null.- Returns:
- an IdentityStack instance.
-
contains
public boolean contains(java.lang.Object o)Override methods that use.equals()comparisons on elements. -
indexOf
public int indexOf(java.lang.Object o, int pos)Override methods that use.equals()comparisons on elements.- Overrides:
indexOfin classjava.util.Vector<E>- Parameters:
o- the Object to search for.pos- the position from which to search.- Returns:
- the position of the object, -1 if not found.
- See Also:
Vector.indexOf(Object, int)
-
lastIndexOf
public int lastIndexOf(java.lang.Object o, int pos)Override methods that use.equals()comparisons on elements.- Overrides:
lastIndexOfin classjava.util.Vector<E>- Parameters:
o- the Object to search for.pos- the position from which to search (backward).- Returns:
- the position of the object, -1 if not found.
- See Also:
Vector.indexOf(Object, int)
-
removeAll
public boolean removeAll(java.util.Collection<?> c) -
retainAll
public boolean retainAll(java.util.Collection<?> c) -
containsAll
public boolean containsAll(java.util.Collection<?> c)
-