Class AIterator
- java.lang.Object
-
- org.apache.sysds.runtime.compress.colgroup.offset.AIterator
-
public abstract class AIterator extends Object
Iterator interface, that returns a iterator of the indexes while also maintaining a data index.
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.logging.Log
LOG
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AIterator
clone()
Copy the iterator with the current values.boolean
equals(AIterator o)
Unsafe version of equals, note that it should only compare iterators stemming from the same Offset Object.abstract int
getDataIndex()
Get the current data index associated with the index returned from value.abstract int
getOffsetsIndex()
Get the current offsets index, that points to the underlying offsets list.boolean
isNotOver(int ub)
Find out if the current offset is not exceeding the index given.abstract int
next()
Increment the pointers such that the both index and dataIndex is incremented to the next entry.void
setOff(int off)
abstract int
skipTo(int idx)
Skip values until index is achieved.String
toString()
int
value()
Get the current index value, note this correspond to a row index in the original matrix.
-
-
-
Method Detail
-
next
public abstract int next()
Increment the pointers such that the both index and dataIndex is incremented to the next entry.- Returns:
- The new offset.
-
value
public int value()
Get the current index value, note this correspond to a row index in the original matrix.- Returns:
- The current value pointed at.
-
setOff
public void setOff(int off)
-
isNotOver
public boolean isNotOver(int ub)
Find out if the current offset is not exceeding the index given.- Parameters:
ub
- The offset to not exceed- Returns:
- boolean if it is exceeded.
-
getDataIndex
public abstract int getDataIndex()
Get the current data index associated with the index returned from value. This index points to a position int the mapToData object, that then inturn can be used to lookup the dictionary entry in ADictionary.- Returns:
- The Data Index.
-
getOffsetsIndex
public abstract int getOffsetsIndex()
Get the current offsets index, that points to the underlying offsets list. This is available for debugging purposes, not to be used for the calling classes.- Returns:
- The Offsets Index.
-
skipTo
public abstract int skipTo(int idx)
Skip values until index is achieved.- Parameters:
idx
- The index to skip to.- Returns:
- the index that follows or are equal to the skip to index.
-
clone
public abstract AIterator clone()
Copy the iterator with the current values.
-
equals
public boolean equals(AIterator o)
Unsafe version of equals, note that it should only compare iterators stemming from the same Offset Object.- Parameters:
o
- The Iterator to compare- Returns:
- The result
-
-