public abstract static class DataStorage.Iterator extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
DataStorage.Iterator()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the iterator.
|
double |
getDouble()
Gets the current element as a
double. |
float |
getFloat()
Gets the current element as a
float. |
int |
getInt()
Gets the current element as an
int. |
long |
getLong()
Gets the current element as a
long. |
boolean |
hasNext()
Check if
next() can be called without going past the end of the sequence. |
void |
next()
Advances the position in the stream by one element.
|
void |
setDouble(double value)
Sets the current element as a
double. |
void |
setFloat(float value)
Sets the current element as a
float. |
void |
setInt(int value)
Sets the current element as an
int. |
void |
setLong(long value)
Sets the current element as a
long. |
protected DataStorage.Iterator()
public boolean hasNext()
next() can be called without going past the end of the sequence.
That is, if next() can be called without deliberately causing an exception.
Note: It is important that the iterator is iterated
past the last element; that is next() is called
startPosition - endPosition times. The
get() or set() methods should not
be called for the last element.
The default implementation always returns false.
true if next() can be called, otherwise false.public void next()
throws IllegalStateException,
ApfloatRuntimeException
Note: It is important that the iterator is iterated
past the last element; that is next() is called
startPosition - endPosition times. The
get() or set() methods should not
be called for the last element.
The default implementation always throws IllegalStateException.
IllegalStateException - If the iterator has been iterated to the end already.ApfloatRuntimeExceptionpublic int getInt()
throws UnsupportedOperationException,
IllegalStateException,
ApfloatRuntimeException
int.
The default implementation always throws UnsupportedOperationException.
int.UnsupportedOperationException - If the element type of the data storage can't be converted to an int.IllegalStateException - If the iterator is at the end.ApfloatRuntimeExceptionpublic long getLong()
throws UnsupportedOperationException,
IllegalStateException,
ApfloatRuntimeException
long.
The default implementation always throws UnsupportedOperationException.
long.UnsupportedOperationException - If the element type of the data storage can't be converted to a long.IllegalStateException - If the iterator is at the end.ApfloatRuntimeExceptionpublic float getFloat()
throws UnsupportedOperationException,
IllegalStateException,
ApfloatRuntimeException
float.
The default implementation always throws UnsupportedOperationException.
float.UnsupportedOperationException - If the element type of the data storage can't be converted to a float.IllegalStateException - If the iterator is at the end.ApfloatRuntimeExceptionpublic double getDouble()
throws UnsupportedOperationException,
IllegalStateException,
ApfloatRuntimeException
double.
The default implementation always throws UnsupportedOperationException.
double.UnsupportedOperationException - If the element type of the data storage can't be converted to a double.IllegalStateException - If the iterator is at the end.ApfloatRuntimeExceptionpublic void setInt(int value)
throws UnsupportedOperationException,
IllegalStateException,
ApfloatRuntimeException
int.
The default implementation always throws UnsupportedOperationException.
value - The value to be set to the current element as an int.UnsupportedOperationException - If the element type of the data storage can't be converted to an int.IllegalStateException - If the iterator is at the end.ApfloatRuntimeExceptionpublic void setLong(long value)
throws UnsupportedOperationException,
IllegalStateException,
ApfloatRuntimeException
long.
The default implementation always throws UnsupportedOperationException.
value - The value to be set to the current element as a long.UnsupportedOperationException - If the element type of the data storage can't be converted to a long.IllegalStateException - If the iterator is at the end.ApfloatRuntimeExceptionpublic void setFloat(float value)
throws UnsupportedOperationException,
IllegalStateException,
ApfloatRuntimeException
float.
The default implementation always throws UnsupportedOperationException.
value - The value to be set to the current element as a float.UnsupportedOperationException - If the element type of the data storage can't be converted to a float.IllegalStateException - If the iterator is at the end.ApfloatRuntimeExceptionpublic void setDouble(double value)
throws UnsupportedOperationException,
IllegalStateException,
ApfloatRuntimeException
double.
The default implementation always throws UnsupportedOperationException.
value - The value to be set to the current element as a double.UnsupportedOperationException - If the element type of the data storage can't be converted to a double.IllegalStateException - If the iterator is at the end.ApfloatRuntimeExceptionpublic void close()
throws ApfloatRuntimeException
ApfloatRuntimeException