Package elki.database.ids.integer
Class DoubleIntegerDBIDSubList
- java.lang.Object
-
- elki.database.ids.integer.DoubleIntegerDBIDSubList
-
- All Implemented Interfaces:
DBIDs
,DoubleDBIDList
,DoubleIntegerDBIDList
,IntegerDBIDs
public class DoubleIntegerDBIDSubList extends java.lang.Object implements DoubleIntegerDBIDList
Sublist of an existing result to contain only some of the elements.- Since:
- 0.6.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
DoubleIntegerDBIDSubList.Itr
Iterator for the sublist.-
Nested classes/interfaces inherited from interface elki.database.ids.DoubleDBIDList
DoubleDBIDList.Consumer
-
-
Field Summary
Fields Modifier and Type Field Description private int
begin
Start offset.private int
end
End offset.private DoubleIntegerDBIDList
inner
Wrapped inner result.
-
Constructor Summary
Constructors Constructor Description DoubleIntegerDBIDSubList(DoubleIntegerDBIDList inner, int begin, int end)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DBIDVar
assignVar(int index, DBIDVar var)
Assign a DBID variable the value of positionindex
.boolean
contains(DBIDRef o)
Test whether an ID is contained.double
doubleValue(int index)
Get the double value at a given index (to access the DBID, either useDoubleDBIDList.iter()
orDoubleDBIDList.assignVar(int, elki.database.ids.DBIDVar)
.boolean
isEmpty()
Test for an empty DBID collection.DoubleIntegerDBIDSubList.Itr
iter()
Get a DBID iterator (a more efficient API).int
size()
Retrieve the collection / data size.DoubleIntegerDBIDList
slice(int begin, int end)
Get a subset list.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.database.ids.DoubleDBIDList
forEachDouble
-
-
-
-
Field Detail
-
begin
private final int begin
Start offset.
-
end
private final int end
End offset.
-
inner
private final DoubleIntegerDBIDList inner
Wrapped inner result.
-
-
Constructor Detail
-
DoubleIntegerDBIDSubList
public DoubleIntegerDBIDSubList(DoubleIntegerDBIDList inner, int begin, int end)
Constructor.- Parameters:
inner
- Inner instancebegin
- Begin offsetend
- End offset
-
-
Method Detail
-
assignVar
public DBIDVar assignVar(int index, DBIDVar var)
Description copied from interface:DoubleDBIDList
Assign a DBID variable the value of positionindex
.- Specified by:
assignVar
in interfaceDoubleDBIDList
- Parameters:
index
- Positionvar
- Variable to assign the value to.
-
doubleValue
public double doubleValue(int index)
Description copied from interface:DoubleDBIDList
Get the double value at a given index (to access the DBID, either useDoubleDBIDList.iter()
orDoubleDBIDList.assignVar(int, elki.database.ids.DBIDVar)
.- Specified by:
doubleValue
in interfaceDoubleDBIDList
- Parameters:
index
- Index- Returns:
- Value
-
iter
public DoubleIntegerDBIDSubList.Itr iter()
Description copied from interface:DBIDs
Get a DBID iterator (a more efficient API).Example:
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { NumberVector vec = relation.get(iter); // iter is a temporary object reference }
- Specified by:
iter
in interfaceDBIDs
- Specified by:
iter
in interfaceDoubleDBIDList
- Specified by:
iter
in interfaceDoubleIntegerDBIDList
- Specified by:
iter
in interfaceIntegerDBIDs
- Returns:
- iterator
-
contains
public boolean contains(DBIDRef o)
Description copied from interface:DBIDs
Test whether an ID is contained.
-
isEmpty
public boolean isEmpty()
Description copied from interface:DBIDs
Test for an empty DBID collection.
-
size
public int size()
Description copied from interface:DBIDs
Retrieve the collection / data size.- Specified by:
size
in interfaceDBIDs
- Specified by:
size
in interfaceDoubleDBIDList
- Returns:
- collection size
-
slice
public DoubleIntegerDBIDList slice(int begin, int end)
Description copied from interface:DoubleDBIDList
Get a subset list.- Specified by:
slice
in interfaceDoubleDBIDList
- Specified by:
slice
in interfaceDoubleIntegerDBIDList
- Parameters:
begin
- Beginend
- End- Returns:
- Sublist
-
-