|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.dx.util.MutabilityControl
public class MutabilityControl
Very simple base class that implements a flag to control the mutability of instances. This class just provides the flag and a utility to check and throw the right exception, but it is up to subclasses to place calls to the checker in all the right places.
| Constructor Summary | |
|---|---|
MutabilityControl()
Constructs an instance. |
|
MutabilityControl(boolean mutable)
Constructs an instance, explicitly indicating the mutability. |
|
| Method Summary | |
|---|---|
boolean |
isImmutable()
Checks to see whether or not this instance is immutable. |
boolean |
isMutable()
Checks to see whether or not this instance is mutable. |
void |
setImmutable()
Makes this instance immutable. |
void |
throwIfImmutable()
Throws MutabilityException if this instance is
immutable. |
void |
throwIfMutable()
Throws MutabilityException if this instance is mutable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MutabilityControl()
public MutabilityControl(boolean mutable)
mutable - true iff this instance is mutable| Method Detail |
|---|
public void setImmutable()
public final boolean isImmutable()
!isMutable().
true iff this instance is immutablepublic final boolean isMutable()
true iff this instance is mutablepublic final void throwIfImmutable()
MutabilityException if this instance is
immutable.
public final void throwIfMutable()
MutabilityException if this instance is mutable.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||