Package elki.database.ids.integer
Class ArrayModifiableIntegerDBIDs.Itr
- java.lang.Object
-
- elki.database.ids.integer.ArrayModifiableIntegerDBIDs.Itr
-
- All Implemented Interfaces:
DBIDArrayIter
,DBIDArrayMIter
,DBIDIter
,DBIDMIter
,DBIDRef
,IntegerDBIDArrayIter
,IntegerDBIDArrayMIter
,IntegerDBIDIter
,IntegerDBIDMIter
,IntegerDBIDRef
,ArrayIter
,Iter
,MIter
- Enclosing class:
- ArrayModifiableIntegerDBIDs
private class ArrayModifiableIntegerDBIDs.Itr extends java.lang.Object implements IntegerDBIDArrayMIter
Iterator class.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
pos
Iterator position.
-
Constructor Summary
Constructors Modifier Constructor Description private
Itr()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayModifiableIntegerDBIDs.Itr
advance()
Moves the iterator forward to the next entry.ArrayModifiableIntegerDBIDs.Itr
advance(int count)
Moves the iterator forward or backward by the given offset.int
getOffset()
Get current iterator offset.int
internalGetIndex()
Return the integer value of the object ID.void
remove()
Remove the object the iterator currently points to.ArrayModifiableIntegerDBIDs.Itr
retract()
Moves the iterator backward to the previous entry.ArrayModifiableIntegerDBIDs.Itr
seek(int off)
Moves the iterator to the given positionvoid
setDBID(DBIDRef val)
Set the current value.java.lang.String
toString()
boolean
valid()
Returns true if the iterator currently points to a valid object.
-
-
-
Method Detail
-
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.
-
advance
public ArrayModifiableIntegerDBIDs.Itr advance()
Description copied from interface:Iter
Moves the iterator forward to the next entry.
-
getOffset
public int getOffset()
Description copied from interface:ArrayIter
Get current iterator offset.
-
advance
public ArrayModifiableIntegerDBIDs.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 ArrayModifiableIntegerDBIDs.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 ArrayModifiableIntegerDBIDs.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
- Specified by:
seek
in interfaceDBIDArrayMIter
- Parameters:
off
- Seek offset- Returns:
- Iterator
-
setDBID
public void setDBID(DBIDRef val)
Description copied from interface:DBIDArrayMIter
Set the current value. Note: if the iterator is just after the last position, this may be equivalent to an add, but some implementations may not support this operation!- Specified by:
setDBID
in interfaceDBIDArrayMIter
- Parameters:
val
- new value
-
remove
public void remove()
Description copied from interface:DBIDMIter
Remove the object the iterator currently points to. Note: Subsequent calls toDBIDUtil.deref(elki.database.ids.DBIDRef)
may return a different element. CallDBIDIter.advance()
to advance the iterator to the next element for further processing.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-