public class Enumerable extends Object implements Iterator<Integer>, Iterable<Integer>
When you need to read a specific number of integer objects from the data file it's best to do so on the as-needed basis instead of loading everything in to memory. This class provides a way to read the integers one by one.
Objects of this class should not be created directly as they are part of the internal logic.
For more information see: 51Degrees pattern data model.
| Constructor and Description |
|---|
Enumerable(BinaryReader reader,
int max)
An enumerable that can be used to read through the entries.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getNext()
Get the next element.
|
boolean |
hasNext()
Returns true if there are more values to read, false otherwise.
|
Iterator<Integer> |
iterator()
Returns this object.
|
Integer |
next()
Reads the next integer and returns it.
|
void |
remove()
Not supported.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingforEach, spliteratorpublic Enumerable(BinaryReader reader, int max)
reader - Reader set to the position at the start of the list.max - number of elements that can possibly be returned.public int getNext()
public boolean hasNext()
public Integer next()
Copyright © 2015 51Degrees. All rights reserved.