Package org.tweetyproject.logics.pl.util
Class TextfileIterator
java.lang.Object
org.tweetyproject.logics.pl.util.TextfileIterator
- All Implemented Interfaces:
Iterator<PlBeliefSet>
,BeliefSetIterator<PlFormula,
PlBeliefSet>
Enumerates all belief bases from a text file; the file contains one
belief base per line.
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorDescriptionTextfileIterator
(String pathToFile) Creates a new iterator based on the given file. -
Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
TextfileIterator
Creates a new iterator based on the given file.- Parameters:
pathToFile
- path to a text file containing belief bases (one per line)
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceBeliefSetIterator<PlFormula,
PlBeliefSet> - Specified by:
hasNext
in interfaceIterator<PlBeliefSet>
-
next
- Specified by:
next
in interfaceBeliefSetIterator<PlFormula,
PlBeliefSet> - Specified by:
next
in interfaceIterator<PlBeliefSet>
-
close
Close file reader (in case no more belief bases should be read)- Throws:
IOException
- if some IO issue occurs.
-