Package net.sf.tweety.logics.pl.util
Class TextfileIterator
- java.lang.Object
-
- net.sf.tweety.logics.pl.util.TextfileIterator
-
- All Implemented Interfaces:
Iterator<PlBeliefSet>,net.sf.tweety.commons.BeliefSetIterator<PlFormula,PlBeliefSet>
public class TextfileIterator extends Object implements net.sf.tweety.commons.BeliefSetIterator<PlFormula,PlBeliefSet>
Enumerates all belief bases from a text file; the file contains one belief base per line.- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description TextfileIterator(String pathToFile)Creates a new iterator based on the given file.
-
Method Summary
Modifier and Type Method Description voidclose()Close file reader (in case no more belief bases should be read)booleanhasNext()PlBeliefSetnext()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
TextfileIterator
public TextfileIterator(String pathToFile)
Creates a new iterator based on the given file.- Parameters:
pathToFile- path to a text file containing belief bases (one per line)
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacenet.sf.tweety.commons.BeliefSetIterator<PlFormula,PlBeliefSet>- Specified by:
hasNextin interfaceIterator<PlBeliefSet>
-
next
public PlBeliefSet next()
- Specified by:
nextin interfacenet.sf.tweety.commons.BeliefSetIterator<PlFormula,PlBeliefSet>- Specified by:
nextin interfaceIterator<PlBeliefSet>
-
close
public void close() throws IOExceptionClose file reader (in case no more belief bases should be read)- Throws:
IOException- if some IO issue occurs.
-
-