org.progeeks.util
Class DefaultFixable

java.lang.Object
  extended by org.progeeks.util.DefaultFixable
All Implemented Interfaces:
Fixable
Direct Known Subclasses:
PageConfiguration

public class DefaultFixable
extends java.lang.Object
implements Fixable

Default implementation of the Fixable interface.

Version:
$Revision: 1.1 $
Author:
Paul Speed

Field Summary
protected  boolean fixed
           
 
Constructor Summary
DefaultFixable()
          Creates a new unfixed object.
DefaultFixable(boolean fixed)
          Creates an object preinitialized to the specified fixed state.
 
Method Summary
protected  void checkModification()
          Convenience method for subclass to check the fixed state and automatically throw an exception.
 boolean isFixed()
          Returns true if this object cannot be modified.
 void setFixed(boolean fixed)
          Sets the mutable/immutable state of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fixed

protected boolean fixed
Constructor Detail

DefaultFixable

public DefaultFixable()
Creates a new unfixed object.


DefaultFixable

public DefaultFixable(boolean fixed)
Creates an object preinitialized to the specified fixed state.

Method Detail

setFixed

public void setFixed(boolean fixed)
              throws IllegalModificationException
Sets the mutable/immutable state of this object. A value of true indicates that the object will be immutable after this call.

Specified by:
setFixed in interface Fixable
Throws:
IllegalModificationException - if the object does not support a specific mutability shift. For example, most immutable objects will not allow setFixed( false ).

checkModification

protected void checkModification()
                          throws IllegalModificationException
Convenience method for subclass to check the fixed state and automatically throw an exception.

Throws:
IllegalModificationException

isFixed

public boolean isFixed()
Returns true if this object cannot be modified.

Specified by:
isFixed in interface Fixable


Copyright © 2002-2003 Paul Speed. All Rights Reserved.