public class UnmodifiableIntegerArrayDBIDs extends Object implements IntegerArrayStaticDBIDs
Modifier and Type | Class and Description |
---|---|
(package private) class |
UnmodifiableIntegerArrayDBIDs.UnmodifiableDBIDIter
Make an existing DBIDMIter unmodifiable.
|
Modifier and Type | Field and Description |
---|---|
private TroveArrayDBIDs |
inner
The DBIDs we wrap.
|
Constructor and Description |
---|
UnmodifiableIntegerArrayDBIDs(TroveArrayDBIDs inner)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
assign(int index,
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! |
boolean |
isEmpty()
Test for an empty DBID collection.
|
IntegerDBIDArrayIter |
iter()
Iterable
|
int |
size()
Size of the DBID "collection".
|
String |
toString() |
private final TroveArrayDBIDs inner
public UnmodifiableIntegerArrayDBIDs(TroveArrayDBIDs inner)
inner
- Inner DBID collection.public boolean contains(DBIDRef o)
DBIDs
public boolean isEmpty()
DBIDs
public IntegerDBIDArrayIter iter()
ArrayDBIDs
iter
in interface ArrayDBIDs
iter
in interface DBIDs
iter
in interface IntegerArrayStaticDBIDs
iter
in interface IntegerDBIDs
public int size()
ArrayDBIDs
size
in interface ArrayDBIDs
size
in interface DBIDs
public DBID get(int i)
ArrayDBIDs
DBIDArrayIter
via ArrayDBIDs.iter()
instead!get
in interface ArrayDBIDs
i
- Indexpublic void assign(int index, DBIDVar var)
ArrayDBIDs
index
.assign
in interface ArrayDBIDs
index
- 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 for