Package com.storedobject.core
Class AbstractComputedValue<T>
java.lang.Object
com.storedobject.core.AbstractComputedValue<T>
- All Implemented Interfaces:
ComputedValue<T>,Displayable,Storable,Cloneable
- Direct Known Subclasses:
AbstractComputedInteger,ComputedDouble,ComputedLong
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AbstractComputedValue<T> clone()Creates and returns a copy of thisComputedValueinstance.final booleanfinal booleanDetermines whether the current value is in a computed state.voidsetComputed(boolean computed) Sets the computed state of the value.Convert to a displayable string.toString()Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.storedobject.common.ComputedValue
consider, consider, enable, getValueObject, ignore, ignore, isManual, reverseStatus, setManual, setValueMethods inherited from interface com.storedobject.common.Storable
getStorableValue
-
Field Details
-
computed
protected boolean computed
-
-
Constructor Details
-
AbstractComputedValue
public AbstractComputedValue()
-
-
Method Details
-
isComputed
public final boolean isComputed()Description copied from interface:ComputedValueDetermines whether the current value is in a computed state.- Specified by:
isComputedin interfaceComputedValue<T>- Returns:
trueif the value is computed,falseif it is manually set or not computed.
-
setComputed
public void setComputed(boolean computed) Description copied from interface:ComputedValueSets the computed state of the value.- Specified by:
setComputedin interfaceComputedValue<T>- Parameters:
computed- iftrue, marks the value as computed; iffalse, marks the value as manually set or non-computed.
-
equals
-
toString
-
toDisplay
Description copied from interface:DisplayableConvert to a displayable string. The default implementation returns theStringUtility.toStringInt(Object)value.- Specified by:
toDisplayin interfaceDisplayable- Returns:
- A displayable string.
-
clone
Description copied from interface:ComputedValueCreates and returns a copy of thisComputedValueinstance. The cloned object is a new instance identical to the original, maintaining the same state and value.- Specified by:
clonein interfaceComputedValue<T>- Overrides:
clonein classObject- Returns:
- a new
ComputedValue<T>instance that is a copy of the current object
-