class IntegerDBIDRange extends AbstractList<DBID> implements DBIDRange
Modifier and Type | Class and Description |
---|---|
protected class |
IntegerDBIDRange.DBIDItr
Iterator in ELKI/C++ style.
|
protected class |
IntegerDBIDRange.Itr
Iterator class.
|
Modifier and Type | Field and Description |
---|---|
protected int |
len
Length value
|
protected int |
start
Start value
|
modCount
Modifier | Constructor and Description |
---|---|
protected |
IntegerDBIDRange(int start,
int len)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
binarySearch(DBID key)
Search for the position of the given key, assuming that the data set is
sorted.
|
boolean |
contains(DBID o)
Test whether an ID is contained.
|
DBID |
get(int i)
Get the i'th entry (starting at 0)
|
int |
getOffset(DBID dbid)
For storage array offsets.
|
DBIDIter |
iter()
Iterable
|
Iterator<DBID> |
iterator()
Retrieve Iterator access to the IDs.
|
int |
size()
Size of the DBID "collection".
|
<T> T[] |
toArray(T[] a) |
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toString
protected IntegerDBIDRange(int start, int len)
start
- Range startlen
- Range lengthpublic int size()
ArrayDBIDs
size
in interface ArrayDBIDs
size
in interface DBIDs
size
in interface Collection<DBID>
size
in interface List<DBID>
size
in class AbstractCollection<DBID>
public Iterator<DBID> iterator()
DBIDs
public DBIDIter iter()
ArrayDBIDs
iter
in interface ArrayDBIDs
iter
in interface DBIDs
public boolean contains(DBID o)
DBIDs
public <T> T[] toArray(T[] a)
toArray
in interface Collection<DBID>
toArray
in interface List<DBID>
toArray
in class AbstractCollection<DBID>
public DBID get(int i)
ArrayDBIDs
get
in interface ArrayDBIDs
get
in interface List<DBID>
get
in class AbstractList<DBID>
i
- Indexpublic int getOffset(DBID dbid)
public int binarySearch(DBID key)
ArrayDBIDs
-(1+insertion position)
is returned, as
for Java Collections.binarySearch(java.util.List<? extends java.lang.Comparable<? super T>>, T)
binarySearch
in interface ArrayDBIDs
key
- Key to search for