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 classDoubleIntegerDBIDSubList.ItrIterator for the sublist.-
Nested classes/interfaces inherited from interface elki.database.ids.DoubleDBIDList
DoubleDBIDList.Consumer
-
-
Field Summary
Fields Modifier and Type Field Description private intbeginStart offset.private intendEnd offset.private DoubleIntegerDBIDListinnerWrapped 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 DBIDVarassignVar(int index, DBIDVar var)Assign a DBID variable the value of positionindex.booleancontains(DBIDRef o)Test whether an ID is contained.doubledoubleValue(int index)Get the double value at a given index (to access the DBID, either useDoubleDBIDList.iter()orDoubleDBIDList.assignVar(int, elki.database.ids.DBIDVar).booleanisEmpty()Test for an empty DBID collection.DoubleIntegerDBIDSubList.Itriter()Get a DBID iterator (a more efficient API).intsize()Retrieve the collection / data size.DoubleIntegerDBIDListslice(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:DoubleDBIDListAssign a DBID variable the value of positionindex.- Specified by:
assignVarin interfaceDoubleDBIDList- Parameters:
index- Positionvar- Variable to assign the value to.
-
doubleValue
public double doubleValue(int index)
Description copied from interface:DoubleDBIDListGet the double value at a given index (to access the DBID, either useDoubleDBIDList.iter()orDoubleDBIDList.assignVar(int, elki.database.ids.DBIDVar).- Specified by:
doubleValuein interfaceDoubleDBIDList- Parameters:
index- Index- Returns:
- Value
-
iter
public DoubleIntegerDBIDSubList.Itr iter()
Description copied from interface:DBIDsGet 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:
iterin interfaceDBIDs- Specified by:
iterin interfaceDoubleDBIDList- Specified by:
iterin interfaceDoubleIntegerDBIDList- Specified by:
iterin interfaceIntegerDBIDs- Returns:
- iterator
-
contains
public boolean contains(DBIDRef o)
Description copied from interface:DBIDsTest whether an ID is contained.
-
isEmpty
public boolean isEmpty()
Description copied from interface:DBIDsTest for an empty DBID collection.
-
size
public int size()
Description copied from interface:DBIDsRetrieve the collection / data size.- Specified by:
sizein interfaceDBIDs- Specified by:
sizein interfaceDoubleDBIDList- Returns:
- collection size
-
slice
public DoubleIntegerDBIDList slice(int begin, int end)
Description copied from interface:DoubleDBIDListGet a subset list.- Specified by:
slicein interfaceDoubleDBIDList- Specified by:
slicein interfaceDoubleIntegerDBIDList- Parameters:
begin- Beginend- End- Returns:
- Sublist
-
-