Package com.actelion.research.util
Class UniqueList<T extends java.lang.Comparable<? super T>>
- java.lang.Object
-
- com.actelion.research.util.SortedList<T>
-
- com.actelion.research.util.UniqueList<T>
-
- All Implemented Interfaces:
java.io.Serializable
public class UniqueList<T extends java.lang.Comparable<? super T>> extends SortedList<T> implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UniqueList()UniqueList(java.util.Comparator comparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intadd(int position, T s)intadd(T s)Adds object to the list provided that it doesn't contain an object being considered equal by compareTo().booleancontains(T object)Tget(int i)Returns object at given index, or null if index==-1intgetIndex(T s)When objects were added after the last getIndex() call, then the original-index-map needs to be re-created.TgetSorted(int i)intgetSortedIndex(T s)T[]toArray(T[] e)T[]toSortedArray(T[] e)-
Methods inherited from class com.actelion.research.util.SortedList
equals, getIndexAboveEqual, getIndexBelowEqual, getIndexOrInsertIndex, remove, removeAll, size
-
-
-
-
Method Detail
-
getSortedIndex
public int getSortedIndex(T s)
-
contains
public boolean contains(T object)
- Overrides:
containsin classSortedList<T extends java.lang.Comparable<? super T>>
-
getIndex
public int getIndex(T s)
When objects were added after the last getIndex() call, then the original-index-map needs to be re-created.- Overrides:
getIndexin classSortedList<T extends java.lang.Comparable<? super T>>- Returns:
-
add
public int add(T s)
Description copied from class:SortedListAdds object to the list provided that it doesn't contain an object being considered equal by compareTo().- Overrides:
addin classSortedList<T extends java.lang.Comparable<? super T>>- Returns:
- object's list index, no matter wether it was already in the list or after addition
-
add
public int add(int position, T s)
-
get
public T get(int i)
Description copied from class:SortedListReturns object at given index, or null if index==-1- Overrides:
getin classSortedList<T extends java.lang.Comparable<? super T>>- Parameters:
i- list index within list in original order- Returns:
- string at position i of list in order of the creation
-
getSorted
public T getSorted(int i)
- Parameters:
i- list index within sorted list- Returns:
- string at position i of sorted list
-
toArray
public T[] toArray(T[] e)
- Overrides:
toArrayin classSortedList<T extends java.lang.Comparable<? super T>>
-
-