Interface Parser<T>
- Type Parameters:
T- the type of objects returned by the parser
- All Superinterfaces:
AutoCloseable, Closeable, CloseableIterator<T>
- All Known Implementing Classes:
CSVParser, DlgpeParser, DlgpParser, RDFParser, RLSCSVParser, RLSCSVsParser
Parses a stream of heterogeneous InteGraal objects.
- Author:
- Clément Sipieter (INRIA) <clement@6pi.fr>
-
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()Indicates whether another element can be read from the iterator.next()Returns the next element from the iterator.default ParserResultparse()Parses every remaining object and groups them by output category.default <To> Stream<To> streamParsedObjects(Class<To> clazz) Streams parsed objects filtered by the supplied type.Methods inherited from interface CloseableIterator
close
-
Method Details
-
hasNext
Description copied from interface:CloseableIteratorIndicates whether another element can be read from the iterator.- Specified by:
hasNextin interfaceCloseableIterator<T>- Returns:
- true iff there is a next element
- Throws:
ParseException
-
next
Description copied from interface:CloseableIteratorReturns the next element from the iterator.- Specified by:
nextin interfaceCloseableIterator<T>- Returns:
- the next element
- Throws:
ParseException
-
parse
Parses every remaining object and groups them by output category.- Returns:
- the parsed objects split by type into different collections
- Throws:
ParseException- iff a parsing error occurViewBuilder.ViewBuilderException- iff a mapping parsing exception occur
-
streamParsedObjects
Streams parsed objects filtered by the supplied type. Streams parsed objects of a specific type.- Type Parameters:
To- The type of objects to stream (e.g., Atom or Rule).- Parameters:
clazz- The class object representing the type T.- Returns:
- A stream of objects of type T.
-