T - The type of the item to read.public interface Reader<T> extends Iterable<T>, ObjectWithProperties, AutoCloseable
The Reader interface defines methods for reading objects of type T. Objects
can either by read as a List or using an Iterator or visited
using a Visitor.
The simplest and most effecient way to loop through all objects in the reader is to use the following loop.
Reader<T> reader = ...
for (T object : reader) {
// Do something with the object.
}
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the reader and all resources associated with it.
|
Iterator<T> |
iterator()
Return a new iterator for type T at the first item to read.
|
void |
open()
Open the reader so that it is ready to be read from.
|
List<T> |
read()
Read all items and return a List containing the items.
|
void |
visit(Visitor<T> visitor)
Visit each item returned from the reader until all items have been visited
or the visit method returns false.
|
clearProperties, getProperties, getProperty, getProperty, removeProperty, setProperties, setProperty, setPropertySoft, setPropertyWeakvoid close()
throws RuntimeException
close in interface AutoCloseableRuntimeExceptionIterator<T> iterator()
void open()
List<T> read()
Copyright © 2015 Revolution Systems Inc.. All rights reserved.