Package elki.database.ids.integer
Class DoubleIntegerDBIDArrayList.Itr
- java.lang.Object
-
- elki.database.ids.integer.DoubleIntegerDBIDArrayList.Itr
-
- All Implemented Interfaces:
DBIDArrayIter
,DBIDArrayMIter
,DBIDIter
,DBIDMIter
,DBIDRef
,DoubleDBIDIter
,DoubleDBIDListIter
,DoubleDBIDListMIter
,DoubleIntegerDBIDListIter
,DoubleIntegerDBIDListMIter
,IntegerDBIDIter
,IntegerDBIDRef
,ArrayIter
,Iter
,MIter
- Enclosing class:
- DoubleIntegerDBIDArrayList
private class DoubleIntegerDBIDArrayList.Itr extends java.lang.Object implements DoubleIntegerDBIDListMIter
List iterator.- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
pos
Current offset.-
Fields inherited from interface elki.database.ids.DoubleDBIDListIter
EMPTY
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Itr()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleIntegerDBIDArrayList.Itr
advance()
Moves the iterator forward to the next entry.DoubleIntegerDBIDArrayList.Itr
advance(int count)
Moves the iterator forward or backward by the given offset.double
doubleValue()
Get the double valueint
getOffset()
Get current iterator offset.int
internalGetIndex()
Internal only: Get the internal index.void
remove()
Remove the object the iterator currently points to.DoubleIntegerDBIDArrayList.Itr
retract()
Moves the iterator backward to the previous entry.DoubleIntegerDBIDArrayList.Itr
seek(int off)
Moves the iterator to the given positionvoid
setDBID(DBIDRef ref)
Set the current value.void
setDouble(double value)
Update the value at the current position.java.lang.String
toString()
boolean
valid()
Returns true if the iterator currently points to a valid object.
-
-
-
Method Detail
-
valid
public boolean valid()
Description copied from interface:Iter
Returns true if the iterator currently points to a valid object.
-
advance
public DoubleIntegerDBIDArrayList.Itr advance()
Description copied from interface:Iter
Moves the iterator forward to the next entry.- Specified by:
advance
in interfaceArrayIter
- Specified by:
advance
in interfaceDBIDArrayIter
- Specified by:
advance
in interfaceDBIDIter
- Specified by:
advance
in interfaceDoubleDBIDIter
- Specified by:
advance
in interfaceDoubleDBIDListIter
- Specified by:
advance
in interfaceDoubleIntegerDBIDListIter
- Specified by:
advance
in interfaceIter
- Returns:
- The iterator itself.
-
getOffset
public int getOffset()
Description copied from interface:ArrayIter
Get current iterator offset.
-
advance
public DoubleIntegerDBIDArrayList.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
- Specified by:
advance
in interfaceDoubleDBIDListIter
- Specified by:
advance
in interfaceDoubleIntegerDBIDListIter
- Parameters:
count
- offset to move forward or backwards- Returns:
- Iterator
-
retract
public DoubleIntegerDBIDArrayList.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
- Specified by:
retract
in interfaceDoubleDBIDListIter
- Specified by:
retract
in interfaceDoubleIntegerDBIDListIter
- Returns:
- Iterator
-
seek
public DoubleIntegerDBIDArrayList.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
- Specified by:
seek
in interfaceDoubleDBIDListIter
- Specified by:
seek
in interfaceDoubleDBIDListMIter
- Specified by:
seek
in interfaceDoubleIntegerDBIDListIter
- Specified by:
seek
in interfaceDoubleIntegerDBIDListMIter
- Parameters:
off
- Seek offset- Returns:
- Iterator
-
internalGetIndex
public int internalGetIndex()
Description copied from interface:DBIDRef
Internal only: Get the internal index.NOT FOR PUBLIC USE - ELKI Optimization engine only.
- Specified by:
internalGetIndex
in interfaceDBIDRef
- Specified by:
internalGetIndex
in interfaceIntegerDBIDRef
- Returns:
- Internal index
-
doubleValue
public double doubleValue()
Description copied from interface:DoubleDBIDIter
Get the double value- Specified by:
doubleValue
in interfaceDoubleDBIDIter
- Returns:
- double 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.
-
setDBID
public void setDBID(DBIDRef ref)
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:
ref
- new value
-
setDouble
public void setDouble(double value)
Description copied from interface:DoubleDBIDListMIter
Update the value at the current position.- Specified by:
setDouble
in interfaceDoubleDBIDListMIter
- Parameters:
value
- New value
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-