Class IdentityStack<E>

All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess

public class IdentityStack<E> extends Stack<E>
Identity Stack.
Since:
Ant 1.7
See Also:
  • Constructor Details

    • IdentityStack

      public IdentityStack()
      Default constructor.
    • IdentityStack

      public IdentityStack(E o)
      Construct a new IdentityStack with the specified Object as the bottom element.
      Parameters:
      o - the bottom element.
  • Method Details

    • getInstance

      public static <E> IdentityStack<E> getInstance(Stack<E> s)
      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(Object o)
      Override methods that use .equals() comparisons on elements.
      Specified by:
      contains in interface Collection<E>
      Specified by:
      contains in interface List<E>
      Overrides:
      contains in class Vector<E>
      Parameters:
      o - the Object to search for.
      Returns:
      true if the stack contains the object.
      See Also:
    • indexOf

      public int indexOf(Object o, int pos)
      Override methods that use .equals() comparisons on elements.
      Overrides:
      indexOf in class 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:
    • lastIndexOf

      public int lastIndexOf(Object o, int pos)
      Override methods that use .equals() comparisons on elements.
      Overrides:
      lastIndexOf in class 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:
    • removeAll

      public boolean removeAll(Collection<?> c)
      Specified by:
      removeAll in interface Collection<E>
      Specified by:
      removeAll in interface List<E>
      Overrides:
      removeAll in class Vector<E>
    • retainAll

      public boolean retainAll(Collection<?> c)
      Specified by:
      retainAll in interface Collection<E>
      Specified by:
      retainAll in interface List<E>
      Overrides:
      retainAll in class Vector<E>
    • containsAll

      public boolean containsAll(Collection<?> c)
      Specified by:
      containsAll in interface Collection<E>
      Specified by:
      containsAll in interface List<E>
      Overrides:
      containsAll in class Vector<E>