class IntegerDBIDVar extends Object implements DBIDVar, IntegerDBIDs
Modifier and Type | Class and Description |
---|---|
protected class |
IntegerDBIDVar.Itr
Pseudo iterator for DBIDs interface.
|
Modifier and Type | Field and Description |
---|---|
(package private) int |
id
The actual value.
|
Modifier | Constructor and Description |
---|---|
protected |
IntegerDBIDVar()
Constructor.
|
protected |
IntegerDBIDVar(DBIDRef val)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
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! |
int |
internalGetIndex()
Get the internal index.
|
protected void |
internalSetIndex(int i)
Internal set to integer.
|
boolean |
isEmpty()
Test for an empty DBID collection.
|
IntegerDBIDVar.Itr |
iter()
Iterable
|
void |
set(DBIDRef ref)
Assign a new value for the reference.
|
int |
size()
Size of the DBID "collection".
|
ArrayDBIDs |
slice(int begin,
int end)
Slice a subarray (as view, not copy!)
|
String |
toString() |
protected IntegerDBIDVar()
protected IntegerDBIDVar(DBIDRef val)
val
- public int internalGetIndex()
DBIDRef
internalGetIndex
in interface DBIDRef
protected void internalSetIndex(int i)
i
- integer valuepublic void set(DBIDRef ref)
DBIDVar
public DBID get(int i)
ArrayDBIDs
DBIDArrayIter
via ArrayDBIDs.iter()
instead!get
in interface ArrayDBIDs
i
- Indexpublic int size()
ArrayDBIDs
size
in interface ArrayDBIDs
size
in interface DBIDs
public boolean isEmpty()
DBIDs
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 boolean contains(DBIDRef o)
DBIDs
public void assignVar(int i, DBIDVar var)
ArrayDBIDs
index
.assignVar
in interface ArrayDBIDs
i
- Positionvar
- Variable to assign the value to.public ArrayDBIDs slice(int begin, int end)
ArrayDBIDs
slice
in interface ArrayDBIDs
begin
- Begin (inclusive)end
- End (exclusive)public IntegerDBIDVar.Itr iter()
ArrayDBIDs
iter
in interface ArrayDBIDs
iter
in interface DBIDs
iter
in interface IntegerDBIDs