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 int
add(int position, T s)
int
add(T s)
Adds object to the list provided that it doesn't contain an object being considered equal by compareTo().boolean
contains(T object)
T
get(int i)
Returns object at given index, or null if index==-1int
getIndex(T s)
When objects were added after the last getIndex() call, then the original-index-map needs to be re-created.T
getSorted(int i)
int
getSortedIndex(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:
contains
in 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:
getIndex
in classSortedList<T extends java.lang.Comparable<? super T>>
- Returns:
-
add
public int add(T s)
Description copied from class:SortedList
Adds object to the list provided that it doesn't contain an object being considered equal by compareTo().- Overrides:
add
in 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:SortedList
Returns object at given index, or null if index==-1- Overrides:
get
in 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:
toArray
in classSortedList<T extends java.lang.Comparable<? super T>>
-
-