Package com.irurueta.geometry.io
Class LoaderBinary.LoaderIteratorBinary
java.lang.Object
com.irurueta.geometry.io.LoaderBinary.LoaderIteratorBinary
- All Implemented Interfaces:
LoaderIterator
- Enclosing class:
- LoaderBinary
Loader iterator in charge of loading file data in small chunks.
Usually data is divided in chunks small enough that can be directly
loaded by graphical layers such as OpenGL (which has a limit of 65535
indices when using Vertex Buffer Objects, which increase graphical
performance).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LoaderIteratorListenerReference to the listener of this loader iterator.private final LoaderBinaryReference to loader loading binary file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()Indicates if there is another chunk of data to be loaded.next()Loads and returns next chunk of data, if available.voidsetListener(LoaderIteratorListener listener) Method to set listener of this loader iterator.
-
Field Details
-
loader
Reference to loader loading binary file. -
listener
Reference to the listener of this loader iterator. This listener will be notified when the loading process finishes so that resources can be freed.
-
-
Constructor Details
-
LoaderIteratorBinary
Constructor.- Parameters:
loader- reference to loader loading binary file.
-
-
Method Details
-
setListener
Method to set listener of this loader iterator. This listener will be notified when the loading process finishes.- Parameters:
listener- listener of this loader iterator.
-
hasNext
public boolean hasNext()Indicates if there is another chunk of data to be loaded.- Specified by:
hasNextin interfaceLoaderIterator- Returns:
- true if there is another chunk of data, false otherwise.
-
next
Loads and returns next chunk of data, if available.- Specified by:
nextin interfaceLoaderIterator- Returns:
- next chunk of data.
- Throws:
NotAvailableException- thrown if no more data is available.LoaderException- if file data is corrupt or cannot be understood.IOException- if an I/O error occurs.
-