org.apache.tools.ant.util

Class VectorSet

public final class VectorSet extends Vector

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

Constructor Summary
VectorSet()
VectorSet(int initialCapacity)
VectorSet(int initialCapacity, int capacityIncrement)
VectorSet(Collection c)
Method Summary
booleanadd(Object o)
voidadd(int index, Object o)
This implementation may not add the element at the given index if it is already contained in the collection.
booleanaddAll(Collection c)
booleanaddAll(int index, Collection c)
This implementation may not add all elements at the given index if any of them are already contained in the collection.
voidaddElement(Object o)
voidclear()
Objectclone()
booleancontains(Object o)
booleancontainsAll(Collection c)
voidinsertElementAt(Object o, int index)
Objectremove(int index)
booleanremove(Object o)
booleanremoveAll(Collection c)
voidremoveAllElements()
booleanremoveElement(Object o)
voidremoveElementAt(int index)
voidremoveRange(int fromIndex, int toIndex)
booleanretainAll(Collection c)
Objectset(int index, Object o)
voidsetElementAt(Object o, int index)

Constructor Detail

VectorSet

public VectorSet()

VectorSet

public VectorSet(int initialCapacity)

VectorSet

public VectorSet(int initialCapacity, int capacityIncrement)

VectorSet

public VectorSet(Collection c)

Method Detail

add

public boolean add(Object o)

add

public void add(int index, Object o)
This implementation may not add the element at the given index if it is already contained in the collection.

addAll

public boolean addAll(Collection c)

addAll

public boolean addAll(int index, Collection c)
This implementation may not add all elements at the given index if any of them are already contained in the collection.

addElement

public void addElement(Object o)

clear

public void clear()

clone

public Object clone()

contains

public boolean contains(Object o)

containsAll

public boolean containsAll(Collection c)

insertElementAt

public void insertElementAt(Object o, int index)

remove

public Object remove(int index)

remove

public boolean remove(Object o)

removeAll

public boolean removeAll(Collection c)

removeAllElements

public void removeAllElements()

removeElement

public boolean removeElement(Object o)

removeElementAt

public void removeElementAt(int index)

removeRange

public void removeRange(int fromIndex, int toIndex)

retainAll

public boolean retainAll(Collection c)

set

public Object set(int index, Object o)

setElementAt

public void setElementAt(Object o, int index)