/[fenfire]/fenfire/org/fenfire/swamp/CachedNodeFunction.java
ViewVC logotype

Diff of /fenfire/org/fenfire/swamp/CachedNodeFunction.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by tjl, Thu Apr 24 13:14:15 2003 UTC revision 1.5 by tjl, Sun Apr 27 11:40:27 2003 UTC
# Line 14  import org.fenfire.util.*; Line 14  import org.fenfire.util.*;
14   * Second, no function whose return value depends   * Second, no function whose return value depends
15   * on anything except the passed parameters   * on anything except the passed parameters
16   * (including the Graph) may be called.   * (including the Graph) may be called.
17     * <p>
18     * As an aside, this class works completely also
19     * without a graph, for caching constant functions.
20   */   */
21  public class CachedNodeFunction implements NodeFunction {  public class CachedNodeFunction implements NodeFunction {
22    
# Line 65  public class CachedNodeFunction implemen Line 68  public class CachedNodeFunction implemen
68              cache.put(node, cac);              cache.put(node, cac);
69          }          }
70          if(cac.value == DIRTY) {          if(cac.value == DIRTY) {
71              ConstGraph og = ourGraph.getObservedConstGraph(cac);              ConstGraph og = (ourGraph == null ?
72                        null : ourGraph.getObservedConstGraph(cac));
73              cac.value = f.f(og, node);              cac.value = f.f(og, node);
74              og.close();              if(og != null) og.close();
75          }          }
76          if(o != null)          if(o != null)
77              cac.addObs(o);              cac.addObs(o);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26