public class FinalSet<T extends Comparable> extends AbstractList<T> implements Set<T>
FinalSetf=new FinalSet("a","b","c"); // equivalently: // FinalSet f=new FinalSet(new String[]{"a","b","c"}); // FinalSet f=new FinalSet(SHALLNOTBECLONED,ISSORTED,"a","b","c"); System.out.println(f.get(1)); --> b
| Modifier and Type | Field and Description |
|---|---|
T[] |
data
Holds the data, must be sorted
|
modCount| Constructor and Description |
|---|
FinalSet(boolean clone,
T... a)
Constructs a FinalSet from an array, clones and sorts the array if indicated.
|
FinalSet(T... a)
Constructs a FinalSet from an array that does not need to be cloned
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(T x)
Tells whether x is in the container
|
T |
get(int i)
Returns the element at position i
|
int |
indexOf(T x)
Returns the position in the array or -1
|
int |
size()
Returns the number of elements in this FinalSet
|
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic T extends Comparable[] data
public FinalSet(boolean clone,
T... a)
public FinalSet(T... a)
public boolean contains(T x)
public int indexOf(T x)
public T get(int i)
get in interface List<T extends Comparable>get in class AbstractList<T extends Comparable>public int size()
size in interface Collection<T extends Comparable>size in interface List<T extends Comparable>size in interface Set<T extends Comparable>size in class AbstractCollection<T extends Comparable>Copyright © 2015 Bluebrain Project. All rights reserved.