class ArrayStaticIntegerDBIDs extends Object implements IntegerArrayStaticDBIDs
Modifier and Type | Class and Description |
---|---|
protected class |
ArrayStaticIntegerDBIDs.Itr
DBID iterator in ELKI/C style.
|
private class |
ArrayStaticIntegerDBIDs.Slice
Slice of an array.
|
Modifier and Type | Field and Description |
---|---|
protected int[] |
store
The actual storage.
|
Modifier | Constructor and Description |
---|---|
protected |
ArrayStaticIntegerDBIDs(int... ids)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
DBIDVar |
assignVar(int i,
DBIDVar var)
Assign a DBID variable the value of position
index . |
int |
binarySearch(DBIDRef key)
Search for the position of the given key, assuming that the data set is
sorted.
|
boolean |
contains(DBIDRef o)
Test whether an ID is contained.
|
DBID |
get(int i)
Get the i'th entry (starting at 0)
If possible, use an
DBIDArrayIter via ArrayDBIDs.iter() instead, or
an DBIDVar via ArrayDBIDs.assignVar(int, de.lmu.ifi.dbs.elki.database.ids.DBIDVar) |
boolean |
isEmpty()
Test for an empty DBID collection.
|
ArrayStaticIntegerDBIDs.Itr |
iter()
Iterable
|
int |
size()
Size of the DBID "collection".
|
ArrayStaticIntegerDBIDs.Slice |
slice(int begin,
int end)
Slice a subarray (as view, not copy!)
|
protected ArrayStaticIntegerDBIDs(int... ids)
ids
- Array of ids.public int size()
ArrayDBIDs
size
in interface ArrayDBIDs
size
in interface DBIDs
public boolean isEmpty()
DBIDs
public boolean contains(DBIDRef o)
DBIDs
public DBID get(int i)
ArrayDBIDs
DBIDArrayIter
via ArrayDBIDs.iter()
instead, or
an DBIDVar
via ArrayDBIDs.assignVar(int, de.lmu.ifi.dbs.elki.database.ids.DBIDVar)
get
in interface ArrayDBIDs
i
- Indexpublic DBIDVar assignVar(int i, DBIDVar var)
ArrayDBIDs
index
.assignVar
in interface ArrayDBIDs
i
- Positionvar
- Variable to assign the value to.public int binarySearch(DBIDRef 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 forpublic ArrayStaticIntegerDBIDs.Itr iter()
ArrayDBIDs
iter
in interface ArrayDBIDs
iter
in interface DBIDs
iter
in interface IntegerArrayDBIDs
iter
in interface IntegerArrayStaticDBIDs
iter
in interface IntegerDBIDs
public ArrayStaticIntegerDBIDs.Slice slice(int begin, int end)
ArrayDBIDs
slice
in interface ArrayDBIDs
slice
in interface IntegerArrayDBIDs
begin
- Begin (inclusive)end
- End (exclusive)Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.