public abstract static class DataStorage.Iterator extends Object implements Serializable
| Modifier | Constructor and Description |
|---|---|
protected |
Iterator()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the iterator.
|
<T> T |
get(Class<T> type)
Gets the current element as a the specified element type.
|
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.
|
<T> void |
set(Class<T> type,
T value)
Sets the current element as the specified element type.
|
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 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 calls get(Class) with argument Integer.TYPE.
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 calls get(Class) with argument Long.TYPE.
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 calls get(Class) with argument Float.TYPE.
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 calls get(Class) with argument Double.TYPE.
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 calls set(Class,Object) with first argument Integer.TYPE.
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 calls set(Class,Object) with first argument Long.TYPE.
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 calls set(Class,Object) with first argument Float.TYPE.
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 calls set(Class,Object) with first argument Double.TYPE.
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 <T> T get(Class<T> type) throws UnsupportedOperationException, IllegalStateException, ApfloatRuntimeException
The default implementation always throws UnsupportedOperationException.
T - The type of the element.type - The type of the element.UnsupportedOperationException - If the element type of the data storage can't be converted to the specified type.IllegalStateException - If the iterator is at the end.ApfloatRuntimeExceptionpublic <T> void set(Class<T> type, T value) throws UnsupportedOperationException, IllegalArgumentException, IllegalStateException, ApfloatRuntimeException
The default implementation always throws UnsupportedOperationException.
T - The type of the element.type - The type of the element.value - The value to be set to the current element as the specified type.UnsupportedOperationException - If the element type of the data storage can't be converted to the specified type.IllegalArgumentException - If the value is not of the specified type.IllegalStateException - If the iterator is at the end.ApfloatRuntimeExceptionpublic void close()
throws ApfloatRuntimeException
ApfloatRuntimeExceptionCopyright © 2024. All rights reserved.