|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is used to define whether an object is mutable,
that is to say it has non-final instance fields with mutator methods.
Note that any object which is mutable cannot properly (and safely) be copied
other than by cloning (this is a fact of Java life).
Objects which are themselves immutable but which reference Cloneable objects
must implement Cloneable and the clone method must clone any referenced
instances which are Cloneable.
This will be done via a constructor.
Objects which are mutable but do not reference any Cloneable objects
must also implement Cloneable, but in this case, the clone() method will
simply be of the form return (Class)super.clone().
Method Summary | |
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. |
Method Detail |
public boolean isMutable()
public Mutable setConstant()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |