Package ucar.ma2
Class StructureDataIteratorMediated
java.lang.Object
ucar.ma2.StructureDataIteratorMediated
- All Implemented Interfaces:
Closeable,AutoCloseable,StructureDataIterator
Read a maximum number of StructureData objects from a StructureDataIterator.
- Since:
- 7/9/2014
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Make sure that the iterator is complete, and recover resources.intbooleanhasNext()See if theres more StructureData in the iteration.next()Get the next StructureData in the iteration.reset()Start the iteration over again.voidsetBufferSize(int bytes) Hint to use this much memory in buffering the iteration.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ucar.ma2.StructureDataIterator
finish
-
Constructor Details
-
StructureDataIteratorMediated
-
-
Method Details
-
next
Description copied from interface:StructureDataIteratorGet the next StructureData in the iteration.- Specified by:
nextin interfaceStructureDataIterator- Returns:
- next StructureData record.
- Throws:
IOException- on read error
-
hasNext
Description copied from interface:StructureDataIteratorSee if theres more StructureData in the iteration. You must always call this before calling next().- Specified by:
hasNextin interfaceStructureDataIterator- Returns:
- true if more records are available
- Throws:
IOException- on read error
-
reset
Description copied from interface:StructureDataIteratorStart the iteration over again.- Specified by:
resetin interfaceStructureDataIterator- Returns:
- a new or reset iterator.
-
setBufferSize
public void setBufferSize(int bytes) Description copied from interface:StructureDataIteratorHint to use this much memory in buffering the iteration. No guarentee that it will be used by the implementation.- Specified by:
setBufferSizein interfaceStructureDataIterator- Parameters:
bytes- amount of memory in bytes
-
getCurrentRecno
public int getCurrentRecno()- Specified by:
getCurrentRecnoin interfaceStructureDataIterator
-
close
public void close()Description copied from interface:StructureDataIteratorMake 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceStructureDataIterator
-