org.shapelogic.logic
Class ContextCalculation

java.lang.Object
  extended by org.shapelogic.logic.ContextCalculation

public abstract class ContextCalculation
extends java.lang.Object

A calculation that lives in a context. If the calculation has already finished then just take the value In order to create a context calculation override this class

Author:
Sami Badawi

Field Summary
 java.lang.String name
           
 java.lang.Object value
           
 
Constructor Summary
ContextCalculation()
           
ContextCalculation(java.lang.String nameIn)
           
ContextCalculation(java.lang.String nameIn, Task task)
           
 
Method Summary
abstract  java.lang.Object calculation(Task context)
          This should overridden with the calculation that should be done.
 java.lang.Object getValue(Task task)
          I think that this should first try to find the value in the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public java.lang.String name

value

public java.lang.Object value
Constructor Detail

ContextCalculation

public ContextCalculation(java.lang.String nameIn,
                          Task task)

ContextCalculation

public ContextCalculation(java.lang.String nameIn)

ContextCalculation

public ContextCalculation()
Method Detail

getValue

public java.lang.Object getValue(Task task)
I think that this should first try to find the value in the context.


calculation

public abstract java.lang.Object calculation(Task context)
                                      throws java.lang.Exception
This should overridden with the calculation that should be done. This should just return the cached value if the dirty flag is false

Parameters:
context -
Returns:
result of calculation
Throws:
java.lang.Exception


Copyright © 2008. All Rights Reserved.