-
- Type Parameters:
E
- the type of the objects contained in the list to read
- All Known Implementing Classes:
GluonCloudListDataReaderImpl
,GluonCloudRemoteFunctionChunkedListDataReaderImpl
,InputStreamListDataReader
,RestListDataReader
public interface ListDataReader<E>
A ListDataReader is an entity that has the ability to read a list of objects. The actual source and method that are used for reading the objects is completely up to the implementation. Typically, a the reader will read its data by using anInputDataSource
and converts the read bytes into objects by using anIterableInputConverter
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Iterator<E>
iterator()
Returns an iterator that is able to iterate over the read objects from the list.GluonObservableList<E>
newGluonObservableList()
Provide an instance of a GluonObservableList.
-
-
-
Method Detail
-
newGluonObservableList
GluonObservableList<E> newGluonObservableList()
Provide an instance of a GluonObservableList. This method will be called byDataProvider.retrieveList(ListDataReader)
to get a GluonObservableList that can be populated. Most implementations will just return an instance of GluonObservableList itself. Note that it is perfectly valid to return existing instances of GluonObservableList.- Returns:
- an instance of GluonObservableList
-
iterator
Iterator<E> iterator() throws IOException
Returns an iterator that is able to iterate over the read objects from the list. This method will be called byDataProvider.retrieveList(ListDataReader)
to initiate the read process. The returned iterator will be used to populate the GluonObservableList that is returned in thenewGluonObservableList()
method.- Returns:
- an iterator that is able to read over the objects from the list
- Throws:
IOException
- when something went wrong during the process of reading the objects
-
-