Browse Source

jltl2ba.APSet: comments, add Iterable<APElement> elements() method

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11274 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Joachim Klein 10 years ago
parent
commit
32ffab4e94
  1. 26
      prism/src/jltl2ba/APSet.java

26
prism/src/jltl2ba/APSet.java

@ -28,6 +28,7 @@ import java.io.PrintStream;
/**
* Class representing a set of atomic propositions (AP).
* The APs are ordered, in insertion order.
*/
public class APSet implements Iterable<String> {
@ -119,16 +120,37 @@ public class APSet implements Iterable<String> {
canonical.addAP("p" + i);
return canonical;
}
/** Returns an iterator over the atomic propositions in this set */
public Iterator<String> iterator()
{
return vector.iterator();
}
/**
* Returns an Iterator over the APElements induced by this AP set,
* i.e., all possible subsets for the AP set.
*/
public Iterator<APElement> elementIterator()
{
return new APElementIterator(vector.size());
}
/**
* Returns an Iterable over the APElements induced by this AP set,
* i.e., all possible subsets for the AP set.
*/
public Iterable<APElement> elements()
{
return new Iterable<APElement>() {
@Override
public Iterator<APElement> iterator()
{
return elementIterator();
}
};
}
public void print(PrintStream out) {
for (int i = 0; i < size(); i++) {

Loading…
Cancel
Save