001 package lrs;
002
003 public abstract class ALazyEval {
004 /**
005 * Performs lazy evaluation to compute the next LRStruct when needed.
006 */
007 public abstract LRStruct nextLRS();
008
009 /**
010 * Factory method to correctly create the lazy list with this ILazyEval as the strategy for lazy evaluation.
011 */
012 public abstract LRStruct makeLRS();
013
014 protected LRStruct makeLazyLRS(Object value){
015 LRStruct lrs = new LRStruct();
016 lrs.setHead(new LazyNonNullState(value, this));
017 return lrs;
018 }
019 }