IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework.util
Class MutableObject

java.lang.Object
  extended bycom.ibm.xtools.patterns.framework.util.MutableObject

public class MutableObject
extends Object

A mutable object mainly used for the accumulation of state from local or anonymously defined inner classes into the surrounding context (to be accessed variables of this type must be defined final at point-of-use). A java.lang.Object is immutable once declared final and therefore cannot be used for this purpose. This is almost equivalent to a pointer to an Object rather than just the Object itself.


Constructor Summary
MutableObject()
          Constructs a mutable Object, which by default is initialized to the value of false
MutableObject(Object value)
          Constructs a mutable Object with the given value.
 
Method Summary
 boolean equals(Object object)
           
 Object getValue()
          Returns the current value of the internally stored mutable Object state.
 int hashCode()
           
 void setValue(Object value)
          Sets the value of this mutable Object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableObject

public MutableObject()
Constructs a mutable Object, which by default is initialized to the value of false


MutableObject

public MutableObject(Object value)
Constructs a mutable Object with the given value.

Parameters:
value - the value the internally stored state of the mutable Object will be initialized to
Method Detail

equals

public boolean equals(Object object)

getValue

public Object getValue()
Returns the current value of the internally stored mutable Object state.

Returns:
the current value of the mutable Object

hashCode

public int hashCode()

setValue

public void setValue(Object value)
Sets the value of this mutable Object.

Parameters:
value - the value to set the mutable Object to

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.