Package elki.database.ids.integer
Class IntegerDBIDVar.Itr
- java.lang.Object
-
- elki.database.ids.integer.IntegerDBIDVar.Itr
-
- All Implemented Interfaces:
DBIDArrayIter
,DBIDIter
,DBIDRef
,IntegerDBIDArrayIter
,IntegerDBIDIter
,IntegerDBIDRef
,ArrayIter
,Iter
- Enclosing class:
- IntegerDBIDVar
protected class IntegerDBIDVar.Itr extends java.lang.Object implements IntegerDBIDArrayIter, IntegerDBIDRef
Pseudo iterator for DBIDs interface.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
pos
Iterator position: We use an integer so we can support retract().
-
Constructor Summary
Constructors Modifier Constructor Description protected
Itr()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegerDBIDVar.Itr
advance()
Moves the iterator forward to the next entry.IntegerDBIDVar.Itr
advance(int count)
Moves the iterator forward or backward by the given offset.boolean
equals(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.int
getOffset()
Get current iterator offset.int
hashCode()
WARNING: Hash codes of this interface might not be stable (e.g., for iterators).int
internalGetIndex()
Return the integer value of the object ID.IntegerDBIDVar.Itr
retract()
Moves the iterator backward to the previous entry.IntegerDBIDVar.Itr
seek(int off)
Moves the iterator to the given positionjava.lang.String
toString()
boolean
valid()
Returns true if the iterator currently points to a valid object.
-
-
-
Method Detail
-
advance
public IntegerDBIDVar.Itr advance()
Description copied from interface:Iter
Moves the iterator forward to the next entry.
-
advance
public IntegerDBIDVar.Itr advance(int count)
Description copied from interface:ArrayIter
Moves the iterator forward or backward by the given offset.- Specified by:
advance
in interfaceArrayIter
- Specified by:
advance
in interfaceDBIDArrayIter
- Parameters:
count
- offset to move forward or backwards- Returns:
- Iterator
-
retract
public IntegerDBIDVar.Itr retract()
Description copied from interface:ArrayIter
Moves the iterator backward to the previous entry.- Specified by:
retract
in interfaceArrayIter
- Specified by:
retract
in interfaceDBIDArrayIter
- Returns:
- Iterator
-
seek
public IntegerDBIDVar.Itr seek(int off)
Description copied from interface:ArrayIter
Moves the iterator to the given position- Specified by:
seek
in interfaceArrayIter
- Specified by:
seek
in interfaceDBIDArrayIter
- Parameters:
off
- Seek offset- Returns:
- Iterator
-
getOffset
public int getOffset()
Description copied from interface:ArrayIter
Get current iterator offset.
-
internalGetIndex
public int internalGetIndex()
Description copied from interface:IntegerDBIDRef
Return the integer value of the object ID.- Specified by:
internalGetIndex
in interfaceDBIDRef
- Specified by:
internalGetIndex
in interfaceIntegerDBIDRef
- Returns:
- integer id
-
valid
public boolean valid()
Description copied from interface:Iter
Returns true if the iterator currently points to a valid object.
-
hashCode
public int hashCode()
Description copied from interface:DBIDRef
WARNING: 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:DBIDRef
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.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:
toString
in classjava.lang.Object
-
-