blog
Class ObjGenGraph.IntegerNode

java.lang.Object
  extended by blog.ObjGenGraph.Node
      extended by blog.ObjGenGraph.IntegerNode
Direct Known Subclasses:
ObjGenGraph.TimestepNode
Enclosing class:
ObjGenGraph

public static class ObjGenGraph.IntegerNode
extends ObjGenGraph.Node


Constructor Summary
ObjGenGraph.IntegerNode()
           
 
Method Summary
protected  java.lang.Object correspondingObj(java.lang.Integer i)
          Method that can be overridden by subclasses so that the iterator for this node returns objects corresponding to integers, not the integers themselves.
 boolean dependsOnIdOrder(EvalContext context)
          Returns true if the iteration order for satisfiers of this node depends on the iteration order for object identifiers in the given context.
 java.util.Set getParents()
           
 boolean isFinite()
          Returns true if every call to this node's iterator method returns an iterator over a finite set.
 ObjectIterator iterator(EvalContext context, java.util.Set externallyDistinguished, boolean returnPOPApps, java.util.Map desiredPOPParentObjs, java.util.Map otherPOPParentObjs, boolean includeGuaranteed)
          Returns an iterator over the objects that satisfy this node in the given context.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjGenGraph.IntegerNode

public ObjGenGraph.IntegerNode()
Method Detail

getParents

public java.util.Set getParents()

iterator

public ObjectIterator iterator(EvalContext context,
                               java.util.Set externallyDistinguished,
                               boolean returnPOPApps,
                               java.util.Map desiredPOPParentObjs,
                               java.util.Map otherPOPParentObjs,
                               boolean includeGuaranteed)
Description copied from class: ObjGenGraph.Node
Returns an iterator over the objects that satisfy this node in the given context.

The obvious algorithm for enumerating objects that satisfy a node is by recursion in the object generation graph. But that algorithm would get stuck in cycles. Thus, we terminate the recursion at the parents of POPNodes. A non-root node's iterator method will be called repeatedly, with larger and larger lists of satisfying objects for the parents of POP nodes.

Since we're calling iterator repeatedly, we need a way to get distinct objects each time. Thus, we specify a list of desired objects for each POP node parent. All the returned objects must satisfy a POP application involving at least one of these desired objects and possibly some of the additional objects specified in otherPOPParentObjs. The desired parent objects will always be objects that were not included in the previous calls to iterator, so the objects returned will be distinct from those returned previously.

As an exception, if includeGuaranteed is true, then the returned objects may also be guaranteed objects, objects that satisfy a POP application with an empty tuple of generating objects, or the satisfiers of TermNodes.

Specified by:
iterator in class ObjGenGraph.Node
desiredPOPParentObjs - Map from Node to List
otherPOPParentObjs - Map from Node to List

isFinite

public boolean isFinite()
Description copied from class: ObjGenGraph.Node
Returns true if every call to this node's iterator method returns an iterator over a finite set.

Specified by:
isFinite in class ObjGenGraph.Node

dependsOnIdOrder

public boolean dependsOnIdOrder(EvalContext context)
Description copied from class: ObjGenGraph.Node
Returns true if the iteration order for satisfiers of this node depends on the iteration order for object identifiers in the given context.

Specified by:
dependsOnIdOrder in class ObjGenGraph.Node

correspondingObj

protected java.lang.Object correspondingObj(java.lang.Integer i)
Method that can be overridden by subclasses so that the iterator for this node returns objects corresponding to integers, not the integers themselves.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object