public class EmptyDBIDs extends java.lang.Object implements ArrayStaticDBIDs, SetDBIDs
Modifier and Type | Class and Description |
---|---|
protected static class |
EmptyDBIDs.EmptyDBIDIterator
Iterator for empty DBIDs-
|
Modifier and Type | Field and Description |
---|---|
static EmptyDBIDs.EmptyDBIDIterator |
EMPTY_ITERATOR
Empty DBID iterator.
|
Modifier | Constructor and Description |
---|---|
protected |
EmptyDBIDs()
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.
|
void |
forEach(java.util.function.Consumer<? super DBIDRef> action)
Execute a function for each ID.
|
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.
|
DBIDArrayMIter |
iter()
Iterable
|
int |
size()
Size of the DBID "collection".
|
ArrayDBIDs |
slice(int begin,
int end)
Slice a subarray (as view, not copy!)
|
public static final EmptyDBIDs.EmptyDBIDIterator EMPTY_ITERATOR
public boolean contains(DBIDRef o)
DBIDs
public int size()
ArrayDBIDs
size
in interface ArrayDBIDs
size
in interface DBIDs
public boolean isEmpty()
DBIDs
public 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 ArrayDBIDs
i
- Indexpublic DBIDVar assignVar(int index, DBIDVar var)
ArrayDBIDs
index
.assignVar
in interface ArrayDBIDs
index
- Positionvar
- Variable to assign the value to.public DBIDArrayMIter iter()
ArrayDBIDs
iter
in interface ArrayDBIDs
iter
in interface DBIDs
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 ArrayDBIDs
key
- Key to search forpublic ArrayDBIDs slice(int begin, int end)
ArrayDBIDs
slice
in interface ArrayDBIDs
begin
- Begin (inclusive)end
- End (exclusive)Copyright © 2019 ELKI Development Team. License information.