Package psiprobe.tokenizer
Class UniqueList<T extends Comparable<? super T>>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- psiprobe.tokenizer.UniqueList<T>
-
- Type Parameters:
T
- the generic type
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
public class UniqueList<T extends Comparable<? super T>> extends ArrayList<T>
UniqueList
is a successor ofjava.util.Vector
to provide a collection that contains no duplicate elements, more formally such that e1.compareTo(e2) == 0.The collection is kept ordered whenever elements added or removed and besides uniqueness it is to provide fast element search based again on e1.compareTo(e2) values.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
The Constant serialVersionUID.-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description UniqueList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, T obj)
boolean
add(T obj)
protected boolean
add(T obj, Comparator<? super T> comp)
Adds the.boolean
addAll(Collection<? extends T> comp)
-
Methods inherited from class java.util.ArrayList
addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractList
equals, hashCode
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream
-
Methods inherited from interface java.util.List
containsAll, equals, hashCode
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The Constant serialVersionUID.- See Also:
- Constant Field Values
-
-
Method Detail
-
add
public boolean add(T obj)
- Specified by:
add
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
add
in interfaceList<T extends Comparable<? super T>>
- Overrides:
add
in classArrayList<T extends Comparable<? super T>>
-
add
protected boolean add(T obj, Comparator<? super T> comp)
Adds the.- Parameters:
obj
- the objcomp
- the comp- Returns:
- true, if successful
-
add
public void add(int index, T obj)
- Specified by:
add
in interfaceList<T extends Comparable<? super T>>
- Overrides:
add
in classArrayList<T extends Comparable<? super T>>
-
addAll
public boolean addAll(Collection<? extends T> comp)
- Specified by:
addAll
in interfaceCollection<T extends Comparable<? super T>>
- Specified by:
addAll
in interfaceList<T extends Comparable<? super T>>
- Overrides:
addAll
in classArrayList<T extends Comparable<? super T>>
-
-