public class FilteringTreeReader extends Object implements TreeReader
FilteringTreeReader
filters the output of another TreeReader.
It applies a Filter<Tree> to each returned tree and only returns trees
that are accepted by the Filter. The Filter should accept trees that it
wants returned.Constructor and Description |
---|
FilteringTreeReader(TreeReader tr,
java.util.function.Predicate<Tree> f) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the Reader behind this
TreeReader . |
Tree |
readTree()
Reads a single tree.
|
public FilteringTreeReader(TreeReader tr, java.util.function.Predicate<Tree> f)
public Tree readTree() throws IOException
readTree
in interface TreeReader
null
at end of file.IOException
- If I/O problempublic void close() throws IOException
TreeReader
.close
in interface TreeReader
close
in interface Closeable
close
in interface AutoCloseable
IOException