Package ucar.ma2
Interface StructureDataIterator
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
ArrayStructure.ArrayStructureIterator
,D4StructureDataIterator
,SequenceIterator
,StructureDataIteratorIndexed
,StructureDataIteratorLimited
,StructureDataIteratorLinked
,StructureDataIteratorMediated
public interface StructureDataIterator extends Closeable
An iterator over StructureData. Make sure that you call close(). Best to put in a try/finally block like:try { while (iter.hasNext()) process(iter.next()); } finally { iter.finish(); }
- Since:
- Feb 23, 2008
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default void
close()
Make sure that the iterator is complete, and recover resources.default void
finish()
Deprecated.use close() or try-with-resourceint
getCurrentRecno()
boolean
hasNext()
See if theres more StructureData in the iteration.StructureData
next()
Get the next StructureData in the iteration.StructureDataIterator
reset()
Start the iteration over again.default void
setBufferSize(int bytes)
Hint to use this much memory in buffering the iteration.
-
-
-
Method Detail
-
hasNext
boolean hasNext() throws IOException
See if theres more StructureData in the iteration. You must always call this before calling next().- Returns:
- true if more records are available
- Throws:
IOException
- on read error
-
next
StructureData next() throws IOException
Get the next StructureData in the iteration.- Returns:
- next StructureData record.
- Throws:
IOException
- on read error
-
setBufferSize
default void setBufferSize(int bytes)
Hint to use this much memory in buffering the iteration. No guarentee that it will be used by the implementation.- Parameters:
bytes
- amount of memory in bytes
-
reset
StructureDataIterator reset()
Start the iteration over again.- Returns:
- a new or reset iterator.
-
getCurrentRecno
int getCurrentRecno()
-
close
default void close()
Make sure that the iterator is complete, and recover resources. Best to put in a try/finally block like:try (StructureDataIterator iter = obj.getStructureDataIterator()) { while (iter.hasNext()) process(iter.next()); }
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
finish
default void finish()
Deprecated.use close() or try-with-resource
-
-