private class ArrayModifiableIntegerDBIDs.Slice extends java.lang.Object implements IntegerArrayDBIDs
| Modifier and Type | Class and Description |
|---|---|
private class |
ArrayModifiableIntegerDBIDs.Slice.SliceItr
Iterator class.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
begin
Slice positions.
|
(package private) int |
end
Slice positions.
|
| Constructor and Description |
|---|
Slice(int begin,
int end)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
DBIDVar |
assignVar(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, or
an DBIDVar via ArrayDBIDs.assignVar(int, de.lmu.ifi.dbs.elki.database.ids.DBIDVar) |
boolean |
isEmpty()
Test for an empty DBID collection.
|
ArrayModifiableIntegerDBIDs.Slice.SliceItr |
iter()
Get a DBID iterator (a more efficient API).
|
int |
size()
Retrieve the collection / data size.
|
ArrayModifiableIntegerDBIDs.Slice |
slice(int begin,
int end)
Slice a subarray (as view, not copy!)
|
public Slice(int begin,
int end)
begin - Begin, inclusiveend - End, exclusivepublic int size()
DBIDssize in interface ArrayDBIDssize in interface DBIDspublic boolean contains(DBIDRef o)
DBIDspublic boolean isEmpty()
DBIDspublic DBID get(int i)
ArrayDBIDs
If possible, use an DBIDArrayIter via ArrayDBIDs.iter() instead, or
an DBIDVar via ArrayDBIDs.assignVar(int, de.lmu.ifi.dbs.elki.database.ids.DBIDVar)
get in interface ArrayDBIDsi - Indexpublic DBIDVar assignVar(int index, DBIDVar var)
ArrayDBIDsindex.assignVar in interface ArrayDBIDsindex - Positionvar - Variable to assign the value to.public int binarySearch(DBIDRef key)
ArrayDBIDs
For keys not found, -(1+insertion position) is returned, as
for Java Collections.binarySearch(java.util.List<? extends java.lang.Comparable<? super T>>, T)
binarySearch in interface ArrayDBIDskey - Key to search forpublic ArrayModifiableIntegerDBIDs.Slice.SliceItr iter()
DBIDsExample:
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
DBID id = iter.getDBID();
}
iter in interface ArrayDBIDsiter in interface DBIDsiter in interface IntegerArrayDBIDsiter in interface IntegerDBIDspublic ArrayModifiableIntegerDBIDs.Slice slice(int begin, int end)
ArrayDBIDsslice in interface ArrayDBIDsslice in interface IntegerArrayDBIDsbegin - Begin (inclusive)end - End (exclusive)Copyright © 2019 ELKI Development Team. License information.