Package elki.database.ids.integer
Class IntegerDBID.Itr
- java.lang.Object
-
- elki.database.ids.integer.IntegerDBID.Itr
-
- All Implemented Interfaces:
DBIDArrayIter,DBIDIter,DBIDRef,IntegerDBIDRef,ArrayIter,Iter
- Enclosing class:
- IntegerDBID
protected class IntegerDBID.Itr extends java.lang.Object implements DBIDArrayIter, IntegerDBIDRef
Pseudo iterator for DBIDs interface.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intposIterator position: We use an integer so we can support retract().
-
Constructor Summary
Constructors Modifier Constructor Description protectedItr()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegerDBID.Itradvance()Moves the iterator forward to the next entry.IntegerDBID.Itradvance(int count)Moves the iterator forward or backward by the given offset.booleanequals(java.lang.Object other)WARNING: calling equality on a reference may be an indicator of incorrect usage, as it is not clear whether the programmer meant the references to be the same or the DBIDs.intgetOffset()Get current iterator offset.inthashCode()WARNING: Hash codes of this interface might not be stable (e.g., for iterators).intinternalGetIndex()Internal only: Get the internal index.IntegerDBID.Itrretract()Moves the iterator backward to the previous entry.IntegerDBID.Itrseek(int off)Moves the iterator to the given positionjava.lang.StringtoString()booleanvalid()Returns true if the iterator currently points to a valid object.
-
-
-
Method Detail
-
advance
public IntegerDBID.Itr advance()
Description copied from interface:IterMoves the iterator forward to the next entry.
-
advance
public IntegerDBID.Itr advance(int count)
Description copied from interface:ArrayIterMoves the iterator forward or backward by the given offset.- Specified by:
advancein interfaceArrayIter- Specified by:
advancein interfaceDBIDArrayIter- Parameters:
count- offset to move forward or backwards- Returns:
- Iterator
-
retract
public IntegerDBID.Itr retract()
Description copied from interface:ArrayIterMoves the iterator backward to the previous entry.- Specified by:
retractin interfaceArrayIter- Specified by:
retractin interfaceDBIDArrayIter- Returns:
- Iterator
-
seek
public IntegerDBID.Itr seek(int off)
Description copied from interface:ArrayIterMoves the iterator to the given position- Specified by:
seekin interfaceArrayIter- Specified by:
seekin interfaceDBIDArrayIter- Parameters:
off- Seek offset- Returns:
- Iterator
-
getOffset
public int getOffset()
Description copied from interface:ArrayIterGet current iterator offset.
-
internalGetIndex
public int internalGetIndex()
Description copied from interface:DBIDRefInternal only: Get the internal index.NOT FOR PUBLIC USE - ELKI Optimization engine only.
- Specified by:
internalGetIndexin interfaceDBIDRef- Specified by:
internalGetIndexin interfaceIntegerDBIDRef- Returns:
- Internal index
-
valid
public boolean valid()
Description copied from interface:IterReturns true if the iterator currently points to a valid object.
-
hashCode
public int hashCode()
Description copied from interface:DBIDRefWARNING: Hash codes of this interface might not be stable (e.g., for iterators).Use
DBIDUtil.deref(elki.database.ids.DBIDRef)to get an object with a stable hash code!
-
equals
public boolean equals(java.lang.Object other)
Description copied from interface:DBIDRefWARNING: calling equality on a reference may be an indicator of incorrect usage, as it is not clear whether the programmer meant the references to be the same or the DBIDs.Use
DBIDUtil.equal(elki.database.ids.DBIDRef, elki.database.ids.DBIDRef)orDBIDUtil.compare(elki.database.ids.DBIDRef, elki.database.ids.DBIDRef)!
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-