|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.shapelogic.calculation.BaseCalcInContext<K,V>
K
- Input type for calculationV
- Output type for calculationpublic abstract class BaseCalcInContext<K,V>
BaseCalcInContext normal base class for CalcInContext.
Field Summary | |
---|---|
protected boolean |
_dirty
|
protected K |
_key
|
protected QueryCalc<K,V> |
_query
|
protected int |
_topLevelUsed
|
protected V |
_value
|
Constructor Summary | |
---|---|
BaseCalcInContext(K key)
|
Method Summary | |
---|---|
V |
calc(RecursiveContext<K> recursiveContext)
This a convenience method that set the calculated value in the right context. |
V |
getValue()
Starts a lazy calculation. |
abstract V |
invoke(RecursiveContext<K> contextArray)
This is the method that the user should override. |
boolean |
isDirty()
When dirty is false that means that the calculated value can be used |
void |
setup()
Currently not super well define used for 2 purposes: Reset: called from the outside if you want to reuse it init: Called from the inside when calculation start to have everything setup maybe the semantic could work for both? TODO: This should be separated better. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean _dirty
protected K _key
protected V _value
protected QueryCalc<K,V> _query
protected int _topLevelUsed
Constructor Detail |
---|
public BaseCalcInContext(K key)
Method Detail |
---|
public abstract V invoke(RecursiveContext<K> contextArray)
CalcInContext
invoke
in interface CalcInContext<K,V>
public V calc(RecursiveContext<K> recursiveContext)
CalcInContext
calc
in interface CalcInContext<K,V>
public boolean isDirty()
LazyCalc
isDirty
in interface LazyCalc<V>
public void setup()
LazyCalc
setup
in interface LazyCalc<V>
public V getValue()
CalcValue
getValue
in interface CalcValue<V>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |