View Javadoc
1   /*
2    * Copyright (C) 2012 Alberto Irurueta Carro (alberto@irurueta.com)
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.irurueta.geometry.io;
17  
18  import java.io.IOException;
19  
20  /**
21   * Defines the interface to iterate on the loading process of a file.
22   */
23  public interface LoaderIterator {
24  
25      /**
26       * Returns boolean indicating if there is more data to be read.
27       *
28       * @return True if there are more chunks to be read, false otherwise.
29       */
30      boolean hasNext();
31  
32      /**
33       * Reads next chunk of data on the file.
34       *
35       * @return Chunk of data containing vertices, indices, colors, textures,
36       * etc.
37       * @throws NotAvailableException Raised if no more chunks are available.
38       * @throws LoaderException       Raised if file cannot be read because it is
39       *                               either corrupted or cannot be interpreted.
40       * @throws IOException           if an I/O error occurs.
41       */
42      DataChunk next() throws NotAvailableException, LoaderException, IOException;
43  }