org.nakedobjects.object.value
Class Logical

java.lang.Object
  extended byorg.nakedobjects.object.value.AbstractNakedValue
      extended byorg.nakedobjects.object.value.Logical
All Implemented Interfaces:
Naked, NakedValue, java.io.Serializable

public class Logical
extends AbstractNakedValue

Value object representing a true or false value.

NOTE: this class currently does not support about listeners.

See Also:
Serialized Form

Field Summary
static java.lang.String FALSE
           
static java.lang.String TRUE
           
 
Constructor Summary
Logical()
          Creates a Logical value set to false.
Logical(boolean flag)
          Creates a Logical value set to the specified value.
 
Method Summary
 boolean booleanValue()
           
 void clear()
          Clears the value so that it is empty, i.e.
 void copyObject(Naked object)
          Copies the content of the specified object into this object.
 java.lang.String getObjectHelpText()
          Returns a textual desctiption of the object - its contents and possible uses.
 boolean isEmpty()
          Returns true if the object contains no data, eg when new
 boolean isSameAs(Naked object)
          Compares the flags if specified object is a Logical object else returns false.
 boolean isSet()
          Returns true is this object is representing a true state.
 void parse(java.lang.String text)
          Takes a user entry string which is parsed to set up the object.
 void reset()
          Resets the objects state to false.
 void restoreString(java.lang.String data)
          Takes a storage string and uses it reinstate this value object to its previous state/
 java.lang.String saveString()
          Returns a basic string representation of this value for storage purposes.
 void set()
          Sets the objects state to true.
 void setValue(boolean set)
           
 void setValue(Logical value)
           
 Title title()
          Returns a Title object describing the object.
 
Methods inherited from class org.nakedobjects.object.value.AbstractNakedValue
about, addNakedValueListener, checkCanOperate, contextualTitle, deepCopy, dumpObject, fireValueChanged, fireValueChanged, getClassName, getFullClassName, getLogger, isNull, isValid, nakedValueListeners, removeNakedValueListener, setAbout, setNull, setValidity, summary, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final java.lang.String TRUE
See Also:
Constant Field Values

FALSE

public static final java.lang.String FALSE
See Also:
Constant Field Values
Constructor Detail

Logical

public Logical()
Creates a Logical value set to false.


Logical

public Logical(boolean flag)
Creates a Logical value set to the specified value.

Method Detail

booleanValue

public boolean booleanValue()

clear

public void clear()
Description copied from interface: NakedValue
Clears the value so that it is empty, i.e. isEmpty returns true.


copyObject

public void copyObject(Naked object)
Description copied from interface: Naked
Copies the content of the specified object into this object.


getObjectHelpText

public java.lang.String getObjectHelpText()
Description copied from interface: Naked
Returns a textual desctiption of the object - its contents and possible uses.

Specified by:
getObjectHelpText in interface Naked
Overrides:
getObjectHelpText in class AbstractNakedValue

isEmpty

public boolean isEmpty()
Description copied from interface: Naked
Returns true if the object contains no data, eg when new


isSameAs

public boolean isSameAs(Naked object)
Compares the flags if specified object is a Logical object else returns false.

Parameters:
object - the object to compare
Returns:
boolean returns true if the objects have the same content, and false if the objects are of different types or their contents are deemed to be different.
See Also:
Naked.isSameAs(Naked)

isSet

public boolean isSet()
Returns true is this object is representing a true state.


parse

public void parse(java.lang.String text)
           throws ValueParseException
Description copied from interface: NakedValue
Takes a user entry string which is parsed to set up the object. This needs to accomodate punctuation and adornments such as currency signs.

Throws:
ValueParseException
See Also:
NakedValue.restoreString(String)

reset

public void reset()
Resets the objects state to false.


set

public void set()
Sets the objects state to true.


setValue

public void setValue(boolean set)

setValue

public void setValue(Logical value)

title

public Title title()
Description copied from interface: Naked
Returns a Title object describing the object.


restoreString

public void restoreString(java.lang.String data)
Description copied from interface: NakedValue
Takes a storage string and uses it reinstate this value object to its previous state/

Parameters:
data -
See Also:
NakedValue.parse(String)

saveString

public java.lang.String saveString()
Description copied from interface: NakedValue
Returns a basic string representation of this value for storage purposes.