|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fr.jussieu.gla.wasa.core.Var
Opens access to a particular Buisness Object value.
This class has the Watcher role in a modified Memento pattern. The value is kept only for a short time, letting the Configuration storing the Buisness Objects state for a longer time.
Derive this class to provide your specific accessor to some particular
Buisness Object, or use VarFactory
to take advantage of
reflexion-based mapping.
Constructor Summary | |
Var(Explorer explorer)
Constructor. |
Method Summary | |
protected abstract java.lang.Object |
cloneValue()
Override this method to provide custom cloning operation. |
float |
getError()
Returns the current error value. |
Explorer |
getExplorer()
Returns the Explorer instance associated to the Var. |
java.lang.String |
getName()
Allows to get a user-defined tag. |
int |
getRank()
Returns the instanciation rank of the Var. |
abstract java.lang.Object |
getReferencedValue()
Override this method to provide the specific behavior for getting the reference to the value object hold by buisness object. |
boolean |
hasValueBasedHashCode()
Returns if value's hashCode can be used to perform faster comparisons. |
void |
incError(double error)
Facility for calling incError( float ) . |
void |
incError(float error)
Method that Constraint implementations should call in their
Constraint.evaluate() method, in order to explain how a
Var's value violates a constraint. |
void |
incError(int error)
Facility for calling incError( float ) . |
void |
setName(java.lang.String name)
Allows to set a user-defined tag. |
abstract void |
setReferencedValue(java.lang.Object value)
Override this method to provide the specific behavior of updating the value object held by buisness object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Var(Explorer explorer)
explorer
- The Explorer this Var belongs to.Method Detail |
public int getRank()
public final Explorer getExplorer()
public boolean hasValueBasedHashCode()
Override this method to return true if you are sure the
value object has significant hash code, in other words it respects this
part of the hashCode contract :
If two objects are equal according to the
equals( Object ) method, then calling the hashCode
method on each of the two objects must produce the same integer result.
Object.hashCode()
,
Object.equals( Object )
public final float getError()
public final void incError(float error)
Constraint
implementations should call in their
Constraint.evaluate()
method, in order to explain how a
Var's value violates a constraint. Increment the var error
of error.The
- error value, lower means less error, means better.public final void incError(int error)
incError( float )
.A
- value to cast to a float.public final void incError(double error)
incError( float )
.A
- value to cast to a float.public abstract java.lang.Object getReferencedValue()
protected abstract java.lang.Object cloneValue() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
- as Object.clone()
does.public abstract void setReferencedValue(java.lang.Object value)
value
- The value to set.public final java.lang.String getName()
public final void setName(java.lang.String name)
name
- The name of this ProblemItem.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |