E
- the class of objects provided by this stream iterator (must be descendant of LocalAbstractObject
)public abstract class AbstractStreamObjectIterator<E extends LocalAbstractObject> extends AbstractObjectIterator<E> implements java.io.Closeable
LocalAbstractObject
s that are read from a file.
The objects are instantiated one by one every time the next
method is called.
The file should be created using LocalAbstractObject.write(java.io.OutputStream)
method.Constructor and Description |
---|
AbstractStreamObjectIterator() |
Modifier and Type | Method and Description |
---|---|
abstract void |
reset()
Reset the associated stream and restarts the iteration from beginning.
|
abstract void |
setConstructorParameter(int index,
java.lang.Object paramValue)
Sets the value of this stream's object constructor argument.
|
abstract void |
setConstructorParameterFromString(int index,
java.lang.String paramValue,
java.util.Map<java.lang.String,java.lang.Object> namedInstances)
Sets the value of this stream's object constructor argument from a string value.
|
emptyIterator, getCurrentObject, getIterator, getMatchingObjects, getMatchingObjects, getMatchingObjects, getMatchingObjects, getObjectByAnyLocator, getObjectByData, getObjectByLocator, getObjectByLocator, getObjectByLocatorRegexp, getObjectByPosition, getRandomObject, getRandomObjects, provideObjects, singleton, skip
public abstract void setConstructorParameter(int index, java.lang.Object paramValue) throws java.lang.IndexOutOfBoundsException, java.lang.IllegalArgumentException
constructorArgs
.index
- the parameter index to change (zero-based)paramValue
- the changed value to pass to the constructorjava.lang.IllegalArgumentException
- when the passed object is incompatible with the constructor's parameterjava.lang.IndexOutOfBoundsException
- if the index parameter is out of bounds (zero parameter cannot be changed)public abstract void setConstructorParameterFromString(int index, java.lang.String paramValue, java.util.Map<java.lang.String,java.lang.Object> namedInstances) throws java.lang.IndexOutOfBoundsException, java.lang.InstantiationException
constructorArgs
.index
- the parameter index to change (zero-based)paramValue
- the changed value to pass to the constructornamedInstances
- map of named instances for the Convert.stringToType(java.lang.String, java.lang.Class<E>, java.util.Map<java.lang.String, ? extends java.lang.Object>)
conversionjava.lang.IndexOutOfBoundsException
- if the index parameter is out of boundsjava.lang.InstantiationException
- if the value passed is string that is not convertible to the constructor classpublic abstract void reset() throws java.io.IOException
java.io.IOException
- if there was an I/O error re-opening the file