Package nz.org.riskscape.hdf5.cursor
Class H5FixedSizeCursor
java.lang.Object
nz.org.riskscape.hdf5.cursor.H5DatasetCursor
nz.org.riskscape.hdf5.cursor.H5FixedSizeCursor
Iterates over elements of an H5Dataset
-
Nested Class Summary
Nested classes/interfaces inherited from class nz.org.riskscape.hdf5.cursor.H5DatasetCursor
H5DatasetCursor.LocalProblems
-
Field Summary
Fields inherited from class nz.org.riskscape.hdf5.cursor.H5DatasetCursor
dataset, dataspace, numElements, PROBLEMS, type
-
Constructor Summary
ConstructorDescriptionH5FixedSizeCursor
(H5Dataset dataset, H5DataSpace ds, H5Type type, int cursorBufferSize) -
Method Summary
Modifier and TypeMethodDescriptionlong
Gets the current position of the cursor within the dataset elements.boolean
hasNext()
next()
peek()
Same asIterator.next()
but the cursor position is not changed.peek
(H5CompoundMember member) Read the data for member only.void
rewind()
void
setCurrentIndex
(long index) Resets the position of the cursor to the given element index.void
skip()
Advances the cursor index one step.Methods inherited from class nz.org.riskscape.hdf5.cursor.H5DatasetCursor
size, sizeAsInt
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, remove
-
Constructor Details
-
H5FixedSizeCursor
-
-
Method Details
-
hasNext
public boolean hasNext() -
rewind
public void rewind() -
setCurrentIndex
public void setCurrentIndex(long index) Description copied from class:H5DatasetCursor
Resets the position of the cursor to the given element index.
- Specified by:
setCurrentIndex
in classH5DatasetCursor
- Parameters:
index
- the index of the element that should be returned by next()
-
next
-
peek
Description copied from class:H5DatasetCursor
Same as
Iterator.next()
but the cursor position is not changed.- Specified by:
peek
in classH5DatasetCursor
- Returns:
- object read from the current cursor position
-
peek
Description copied from class:H5DatasetCursor
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.
- Specified by:
peek
in classH5DatasetCursor
- Parameters:
member
- member to read- Returns:
- the value of member at the current cursor position
-
skip
public void skip()Description copied from class:H5DatasetCursor
Advances the cursor index one step. Similar to calling
Iterator.next()
but without unmarshalling any data- Specified by:
skip
in classH5DatasetCursor
-
getByteBuffer
-
getCurrentIndex
public long getCurrentIndex()Description copied from class:H5DatasetCursor
Gets the current position of the cursor within the dataset elements.
- Specified by:
getCurrentIndex
in classH5DatasetCursor
- Returns:
- the index of the element that will be returned by next()
-