Quick links: Examples - Files.
Classes: Hierarchy - Index - List - Members.
Packages: Index - base - jni.

JavaProjectionIterator.java

Projection iterator.This example shows how to obtain projections from a projection iterator. Its source code is under the samples/java directory.

public class JavaProjectionIterator
{
public static void run(String prefix) throws Exception
{
Environment environment = new cogitant.jni.Environment();
environment.loadSupport(prefix + "/bcgct/sisyphus/sisyphus.bcs");
Graph g = environment.loadObjects(prefix + "/bcgct/sisyphus/localsgen2.bcg").iterator().next().asGraph();
Graph h = environment.loadObjects(prefix + "/bcgct/sisyphus/localsgen.bcg").iterator().next().asGraph();
java.util.Iterator<Projection> it = environment.projectionIterator(g, h, null);
long nb=0;
while (it.hasNext())
{
System.out.println(it.next());
nb++;
}
System.out.println(nb);
}
public static void main(String args[]) throws Exception
{
String prefix = "..";
if (args.length == 1)
prefix = args[0];
System.out.println("prefix: " + prefix);
run(prefix);
}
}