com.rubecula.jquantity
Class MutablePresentation
java.lang.Object
com.rubecula.util.Presentation
com.rubecula.jquantity.MutablePresentation
- All Implemented Interfaces:
- Auditable, java.lang.Cloneable, Identifiable, Mutable
- Direct Known Subclasses:
- IntegerPresentation, QuantityPresentation, ValuePresentation
- public abstract class MutablePresentation
- extends Presentation
- implements Mutable
Class
- Since:
- V_0_4
- Version:
- $Revision: 1.1 $
- Author:
- Robin Hillyard
Method Summary |
java.lang.String |
audit()
Method to return a detailed (unlabeled) string from an arithmetical object for debugging purposes. |
void |
audit(java.io.PrintStream out,
java.lang.String label)
Method to output a string from an arithmetical object for debugging purposes. |
boolean |
isMutable()
This method indicates whether this particular instance is mutable, i.e. it has
not been designated a constant. |
Mutable |
setConstant()
This method sets this instance to be a constant, i.e. immutable.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
_Constant
private boolean _Constant
MutablePresentation
public MutablePresentation()
isMutable
public boolean isMutable()
- Description copied from interface:
Mutable
- This method indicates whether this particular instance is mutable, i.e. it has
not been designated a constant.
- Specified by:
isMutable
in interface Mutable
- Returns:
- true if this instance can be mutated, otherwise false (it is constant).
setConstant
public Mutable setConstant()
- Description copied from interface:
Mutable
- This method sets this instance to be a constant, i.e. immutable.
Future calls to the isMutable() method will yield false.
- Specified by:
setConstant
in interface Mutable
- Returns:
- as a convenience this method returns itself.
audit
public void audit(java.io.PrintStream out,
java.lang.String label)
- Method to output a string from an arithmetical object for debugging purposes.
- Specified by:
audit
in interface Auditable
- Overrides:
audit
in class Presentation
- Parameters:
out
- the print stream to which audit string is to be sent.label
- the label to attach to the data.
audit
public java.lang.String audit()
- Method to return a detailed (unlabeled) string from an arithmetical object for debugging purposes.
- Specified by:
audit
in interface Auditable
- Overrides:
audit
in class Presentation
- Returns:
- the detailed string.