TPTP 4.5.0 Platform Project
Public API Specification

org.eclipse.hyades.automation.core.utils
Class MutableBoolean

java.lang.Object
  extended by org.eclipse.hyades.automation.core.utils.MutableBoolean

public class MutableBoolean
extends java.lang.Object

A mutable boolean is 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.Boolean is immutable once declared final and therefore cannot be used for this purpose. This is almost equivalent to a pointer to an Boolean rather than just the Boolean itself.


Constructor Summary
MutableBoolean()
          Constructs a mutable Boolean
MutableBoolean(boolean value)
          Constructs a mutable Boolean with the given value.
MutableBoolean(java.lang.Boolean value)
          Constructs a mutable Boolean with the given value
 
Method Summary
 boolean equals(java.lang.Object object)
           
 int hashCode()
           
 boolean isFalse()
          The opposite of the is true method
 boolean isTrue()
          Indicates is the boolean value is true
 void setAsFalse()
          Sets the contained boolean value to false if not already false
 void setAsTrue()
          Sets the contained boolean value to true if not already true
 void setValue(boolean value)
          Set the contained boolean value to the value specified if not already, factory method for the contained boolean type used -- also included the redundancy check to avoid setting to the same value and creating another Boolean object unneedingly
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableBoolean

public MutableBoolean()
Constructs a mutable Boolean


MutableBoolean

public MutableBoolean(boolean value)
Constructs a mutable Boolean with the given value.

Parameters:
value - the value the internally stored state of the mutable Boolean will be initialized to

MutableBoolean

public MutableBoolean(java.lang.Boolean value)
Constructs a mutable Boolean with the given value

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

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isFalse

public boolean isFalse()
The opposite of the is true method

Returns:
false is the contained boolean value is false

isTrue

public boolean isTrue()
Indicates is the boolean value is true

Returns:
true if the contained boolean value is true

setAsFalse

public void setAsFalse()
Sets the contained boolean value to false if not already false


setAsTrue

public void setAsTrue()
Sets the contained boolean value to true if not already true


setValue

public void setValue(boolean value)
Set the contained boolean value to the value specified if not already, factory method for the contained boolean type used -- also included the redundancy check to avoid setting to the same value and creating another Boolean object unneedingly

Parameters:
value - the state to change to if not already in that state

TPTP 4.5.0 Platform Project
Public API Specification