Package org.apache.tools.ant.util
Class VectorSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<E>
org.apache.tools.ant.util.VectorSet<E>
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<E>
,Collection<E>
,List<E>
,RandomAccess
,SequencedCollection<E>
Subclass of Vector that won't store duplicate entries and shows
HashSet's constant time performance characteristics for the
contains method.
This is not a general purpose class but has been written because
the protected members of DirectoryScanner
prohibited
later revisions from using a more efficient collection.
Methods are synchronized to keep Vector's contract.
- Since:
- Ant 1.8.0
- See Also:
-
Field Summary
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This implementation may not add the element at the given index if it is already contained in the collection.boolean
boolean
addAll
(int index, Collection<? extends E> c) This implementation may not add all elements at the given index if any of them are already contained in the collection.boolean
addAll
(Collection<? extends E> c) void
addElement
(E o) void
clear()
clone()
boolean
boolean
containsAll
(Collection<?> c) void
insertElementAt
(E o, int index) remove
(int index) boolean
boolean
removeAll
(Collection<?> c) void
boolean
void
removeElementAt
(int index) void
removeRange
(int fromIndex, int toIndex) boolean
retainAll
(Collection<?> c) void
setElementAt
(E o, int index) Methods inherited from class java.util.Vector
capacity, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, removeIf, replaceAll, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
-
Constructor Details
-
VectorSet
public VectorSet() -
VectorSet
public VectorSet(int initialCapacity) -
VectorSet
public VectorSet(int initialCapacity, int capacityIncrement) -
VectorSet
-
-
Method Details
-
add
-
add
-
addElement
- Overrides:
addElement
in classVector<E>
-
addAll
-
addAll
-
clear
-
clone
-
contains
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceList<E>
- Overrides:
containsAll
in classVector<E>
-
insertElementAt
- Overrides:
insertElementAt
in classVector<E>
-
remove
-
remove
-
removeAll
-
removeAllElements
public void removeAllElements()- Overrides:
removeAllElements
in classVector<E>
-
removeElement
- Overrides:
removeElement
in classVector<E>
-
removeElementAt
public void removeElementAt(int index) - Overrides:
removeElementAt
in classVector<E>
-
removeRange
public void removeRange(int fromIndex, int toIndex) - Overrides:
removeRange
in classVector<E>
-
retainAll
-
set
-
setElementAt
- Overrides:
setElementAt
in classVector<E>
-