Top Description Fields Constructors Methods
org.apache.tools.ant.util

public Class IdentityStack<E>

extends Stack<E>
Class Inheritance
Imports
java.util.Collection, .HashSet, .IdentityHashMap, .Set, .Stack

Identity Stack.
Since
Ant 1.7

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
IdentityStack()

Default constructor.

public
IdentityStack(E
the bottom element.
o
)

Construct a new IdentityStack with the specified Object as the bottom element.

Method Summary

Modifier and TypeMethod and Description
public synchronized boolean

Returns:

true if the stack contains the object.
contains
(Object
the Object to search for.
o
)

Overrides java.util.Vector.contains.

Implements java.util.List.contains, java.util.Collection.contains.

Override methods that use .equals() comparisons on elements.
public synchronized boolean
containsAll(Collection<?>
a collection whose elements will be tested for containment in this Vector
c
)

Overrides java.util.Vector.containsAll.

Implements java.util.List.containsAll, java.util.Collection.containsAll.

Returns true if this Vector contains all of the elements in the specified Collection.
public static <
desired type
E
>
IdentityStack<E>

Returns:

an IdentityStack instance.
getInstance
(Stack<E>
the Stack to copy; ignored if null.
s
)

Get an IdentityStack containing the contents of the specified Stack.

public synchronized int

Returns:

the position of the object, -1 if not found.
indexOf
(Object
the Object to search for.
o
,
int
the position from which to search.
pos
)

Overrides java.util.Vector.indexOf.

Override methods that use .equals() comparisons on elements.
public synchronized int

Returns:

the position of the object, -1 if not found.
lastIndexOf
(Object
the Object to search for.
o
,
int
the position from which to search (backward).
pos
)

Overrides java.util.Vector.lastIndexOf.

Override methods that use .equals() comparisons on elements.
public synchronized boolean
removeAll(Collection<?>
a collection of elements to be removed from the Vector
c
)

Overrides java.util.Vector.removeAll.

Implements java.util.List.removeAll, java.util.Collection.removeAll.

Removes from this Vector all of its elements that are contained in the specified Collection.
public synchronized boolean
retainAll(Collection<?>
a collection of elements to be retained in this Vector (all other elements are removed)
c
)

Overrides java.util.Vector.retainAll.

Implements java.util.List.retainAll, java.util.Collection.retainAll.

Retains only the elements in this Vector that are contained in the specified Collection.
Inherited from java.util.Stack:
emptypeekpoppushsearch

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.Stack.serialVersionUID.

Constructor Detail

IdentityStackback to summary
public IdentityStack()

Default constructor.

IdentityStackback to summary
public IdentityStack(E o)

Construct a new IdentityStack with the specified Object as the bottom element.

Parameters
o:E

the bottom element.

Method Detail

containsback to summary
public synchronized boolean contains(Object o)

Overrides java.util.Vector.contains.

Implements java.util.List.contains, java.util.Collection.contains.

Override methods that use .equals() comparisons on elements.

Parameters
o:Object

the Object to search for.

Returns:boolean

true if the stack contains the object.

Annotations
@Override
See Also
java.util.Vector#contains(Object)
containsAllback to summary
public synchronized boolean containsAll(Collection<?> c)

Overrides java.util.Vector.containsAll.

Implements java.util.List.containsAll, java.util.Collection.containsAll.

Doc from java.util.Vector.containsAll.

Returns true if this Vector contains all of the elements in the specified Collection.

Parameters
c:Collection<?>

a collection whose elements will be tested for containment in this Vector

Returns:boolean

true if this Vector contains all of the elements in the specified collection

Annotations
@Override
getInstanceback to summary
public static <E> IdentityStack<E> getInstance(Stack<E> s)

Get an IdentityStack containing the contents of the specified Stack.

Parameters
<E>
desired type
s:Stack<E>

the Stack to copy; ignored if null.

Returns:IdentityStack<E>

an IdentityStack instance.

indexOfback to summary
public synchronized int indexOf(Object o, int pos)

Overrides java.util.Vector.indexOf.

Override methods that use .equals() comparisons on elements.

Parameters
o:Object

the Object to search for.

pos:int

the position from which to search.

Returns:int

the position of the object, -1 if not found.

Annotations
@Override
See Also
java.util.Vector#indexOf(Object, int)
lastIndexOfback to summary
public synchronized int lastIndexOf(Object o, int pos)

Overrides java.util.Vector.lastIndexOf.

Override methods that use .equals() comparisons on elements.

Parameters
o:Object

the Object to search for.

pos:int

the position from which to search (backward).

Returns:int

the position of the object, -1 if not found.

Annotations
@Override
See Also
java.util.Vector#indexOf(Object, int)
removeAllback to summary
public synchronized boolean removeAll(Collection<?> c)

Overrides java.util.Vector.removeAll.

Implements java.util.List.removeAll, java.util.Collection.removeAll.

Doc from java.util.Vector.removeAll.

Removes from this Vector all of its elements that are contained in the specified Collection.

Parameters
c:Collection<?>

a collection of elements to be removed from the Vector

Returns:boolean

true if this Vector changed as a result of the call

Annotations
@Override
retainAllback to summary
public synchronized boolean retainAll(Collection<?> c)

Overrides java.util.Vector.retainAll.

Implements java.util.List.retainAll, java.util.Collection.retainAll.

Doc from java.util.Vector.retainAll.

Retains only the elements in this Vector that are contained in the specified Collection. In other words, removes from this Vector all of its elements that are not contained in the specified Collection.

Parameters
c:Collection<?>

a collection of elements to be retained in this Vector (all other elements are removed)

Returns:boolean

true if this Vector changed as a result of the call

Annotations
@Override