Interface ListDataReader<E>

  • Type Parameters:
    E - the type of the objects contained in the list to read
    All Known Implementing Classes:
    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 an InputDataSource and converts the read bytes into objects by using an IterableInputConverter.
    • Method Detail

      • newGluonObservableList

        GluonObservableList<E> newGluonObservableList()
        Provide an instance of a GluonObservableList. This method will be called by DataProvider.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 by DataProvider.retrieveList(ListDataReader) to initiate the read process. The returned iterator will be used to populate the GluonObservableList that is returned in the newGluonObservableList() 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