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

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

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

revision 1.1 by tjl, Sun Aug 31 12:29:31 2003 UTC revision 1.2 by tjl, Mon Sep 1 10:20:58 2003 UTC
# Line 21  public class SuperLazyPureNodeFunction i Line 21  public class SuperLazyPureNodeFunction i
21      PureNodeFunction f;      PureNodeFunction f;
22      Object placeHolder;      Object placeHolder;
23      Background background;      Background background;
24      Obs recalcObs;      ObjObs recalcObs;
25    
26      /** Create a new SuperLazyPureNodeFunction.      /** Create a new SuperLazyPureNodeFunction.
27       * @param n The number of cache entries to use       * @param n The number of cache entries to use
# Line 37  public class SuperLazyPureNodeFunction i Line 37  public class SuperLazyPureNodeFunction i
37                  ConstGraph g, PureNodeFunction f,                  ConstGraph g, PureNodeFunction f,
38                  Object placeHolder,                  Object placeHolder,
39                  Background background,                  Background background,
40                  Obs recalcObs                  ObjObs recalcObs
41                  ) {                  ) {
42          cache = new CachingMap(n);          cache = new CachingMap(n);
43          this.ourGraph = g;          this.ourGraph = g;
# Line 48  public class SuperLazyPureNodeFunction i Line 48  public class SuperLazyPureNodeFunction i
48      }      }
49    
50      private class SuperLazyNodeFunctionCacheEntry      private class SuperLazyNodeFunctionCacheEntry
51                      extends NodeFunctionCacheEntry                      extends FunctionCacheEntry
52                      implements Runnable {                      implements Runnable {
53          public SuperLazyNodeFunctionCacheEntry(Object node) {          public SuperLazyNodeFunctionCacheEntry(Object input) {
54              super(node);              super(input);
55          }          }
56                    
57          public void schedule() {          public void schedule() {
# Line 60  public class SuperLazyPureNodeFunction i Line 60  public class SuperLazyPureNodeFunction i
60    
61          public void run() {          public void run() {
62              synchronized(this) {              synchronized(this) {
63              ConstGraph og = (ourGraph == null ?                  ConstGraph og = (ourGraph == null ?
64                      null : ourGraph.getObservedConstGraph(this));                          null : ourGraph.getObservedConstGraph(this));
65              this.value = f.f(og, node);                  this.value = f.f(og, this.input);
66              if(og != null) og.close();                  if(og != null) og.close();
67              }              }
68              recalcObs.chg();              if(recalcObs != null)
69                    recalcObs.chg(this.input);
70          }          }
71    
72      }      }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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