Class LoaderBinary.LoaderIteratorBinary

java.lang.Object
com.irurueta.geometry.io.LoaderBinary.LoaderIteratorBinary
All Implemented Interfaces:
LoaderIterator
Enclosing class:
LoaderBinary

private class LoaderBinary.LoaderIteratorBinary extends Object implements LoaderIterator
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 Details

    • loader

      private final LoaderBinary loader
      Reference to loader loading binary file.
    • listener

      private LoaderIteratorListener 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

      public LoaderIteratorBinary(LoaderBinary loader)
      Constructor.
      Parameters:
      loader - reference to loader loading binary file.
  • Method Details

    • setListener

      public void setListener(LoaderIteratorListener listener)
      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:
      hasNext in interface LoaderIterator
      Returns:
      true if there is another chunk of data, false otherwise.
    • next

      Loads and returns next chunk of data, if available.
      Specified by:
      next in interface LoaderIterator
      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.