Class InputStreamListDataReader<E>

    • Constructor Detail

      • InputStreamListDataReader

        public InputStreamListDataReader​(InputDataSource dataSource,
                                         InputStreamIterableInputConverter<E> converter)
        Construct an instance that will use the specified data source to read data from and convert it to a list of objects with the specified converter. The InputStream of the InputDataSource will be set on the Converter before calling its iterator method.
        Parameters:
        dataSource - the data source where the data will be read from
        converter - the converter that is used for converting the data into a list of object
    • Method Detail

      • newGluonObservableList

        public GluonObservableList<E> newGluonObservableList()
        Description copied from interface: ListDataReader
        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.
        Specified by:
        newGluonObservableList in interface ListDataReader<E>
        Returns:
        an instance of GluonObservableList
      • iterator

        public Iterator<E> iterator()
                             throws IOException
        Returns an iterator that is able to iterate over the read objects from the list. This implementation uses the specified converter to convert the data that is read from the specified data source into a list of objects. The InputStream of the specified data source will be set on the converter, before calling the iterator method on the converter.
        Specified by:
        iterator in interface ListDataReader<E>
        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