Package nz.org.riskscape.hdf5.cursor
Class H5DatasetCursor
java.lang.Object
nz.org.riskscape.hdf5.cursor.H5DatasetCursor
- Direct Known Subclasses:
H5FixedSizeCursor
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected final H5Dataset
protected final H5DataSpace
protected final long
static final H5DatasetCursor.LocalProblems
protected final H5Type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract long
Gets the current position of the cursor within the dataset elements.abstract Object
peek()
Same asIterator.next()
but the cursor position is not changed.abstract Object
peek
(H5CompoundMember member) Read the data for member only.abstract void
setCurrentIndex
(long index) Resets the position of the cursor to the given element index.long
size()
int
abstract void
skip()
Advances the cursor index one step.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Field Details
-
PROBLEMS
-
numElements
protected final long numElements -
dataset
-
dataspace
-
type
-
-
Constructor Details
-
H5DatasetCursor
-
-
Method Details
-
size
public long size() -
sizeAsInt
public int sizeAsInt()- Returns:
- same as size(), but throws an exception if the dataspace size doesn't fit in an integer value
-
getCurrentIndex
public abstract long getCurrentIndex()Gets the current position of the cursor within the dataset elements.
- Returns:
- the index of the element that will be returned by next()
-
setCurrentIndex
public abstract void setCurrentIndex(long index) Resets the position of the cursor to the given element index.
- Parameters:
index
- the index of the element that should be returned by next()
-
skip
public abstract void skip()Advances the cursor index one step. Similar to calling
Iterator.next()
but without unmarshalling any data -
peek
Same as
Iterator.next()
but the cursor position is not changed.- Returns:
- object read from the current cursor position
-
peek
Read the data for member only. This can be more efficient than reading the data with
Iterator.next()
. Peeking does not affect the cursor position.Note that it is up to the caller to ensure that member is in fact a member of this cursor's data type. If it it not then unexpected results are likely.
- Parameters:
member
- member to read- Returns:
- the value of member at the current cursor position
-