Package adams.core.base
Class BaseBoolean
- java.lang.Object
-
- adams.core.base.BaseObject
-
- adams.core.base.BaseBoolean
-
- All Implemented Interfaces:
CloneHandler<BaseObject>,Serializable,Comparable
public class BaseBoolean extends BaseObject
Wrapper for a Boolean object to be editable in the GOE. Handles "f" or "t" (case-insensitive) as strings as well.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULTthe default value.-
Fields inherited from class adams.core.base.BaseObject
m_Internal, m_Properties, SUFFIX_DISPLAY, SUFFIX_VALUE
-
-
Constructor Summary
Constructors Constructor Description BaseBoolean()Initializes the string with length 0.BaseBoolean(Boolean value)Initializes the object with the given value.BaseBoolean(String s)Initializes the object with the string to parse.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbooleanValue()Returns the boolean value.protected StringfixString(String s)Turns "t" and "f" into "true" and "false" respectively.StringgetTipText()Returns a tool tip for the GUI editor (ignored if null is returned).StringgetValue()Returns the current string value.protected voidinitialize()Initializes the internal object.booleanisValid(String value)Checks whether the string value is a valid presentation for this class.voidsetValue(String value)Sets the string value.-
Methods inherited from class adams.core.base.BaseObject
compareTo, equals, getClone, getInternal, getTemplates, getUnicode, hasFavoritesSupport, hashCode, isValidUnicode, newInstance, setUnicode, toObjectArray, toObjectArray, toString, toStringArray, toStringList
-
-
-
-
Field Detail
-
DEFAULT
public static final String DEFAULT
the default value.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BaseBoolean
public BaseBoolean()
Initializes the string with length 0.
-
BaseBoolean
public BaseBoolean(String s)
Initializes the object with the string to parse.- Parameters:
s- the string to parse
-
BaseBoolean
public BaseBoolean(Boolean value)
Initializes the object with the given value.- Parameters:
value- the value to use
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the internal object.- Overrides:
initializein classBaseObject
-
fixString
protected String fixString(String s)
Turns "t" and "f" into "true" and "false" respectively.- Parameters:
s- the string to fix- Returns:
- the fixed string
-
isValid
public boolean isValid(String value)
Checks whether the string value is a valid presentation for this class.- Specified by:
isValidin classBaseObject- Parameters:
value- the string value to check- Returns:
- true if parseable boolean
-
setValue
public void setValue(String value)
Sets the string value.- Specified by:
setValuein classBaseObject- Parameters:
value- the string value
-
getValue
public String getValue()
Returns the current string value.- Specified by:
getValuein classBaseObject- Returns:
- the string value
-
booleanValue
public boolean booleanValue()
Returns the boolean value.- Returns:
- the boolean value
-
getTipText
public String getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).- Specified by:
getTipTextin classBaseObject- Returns:
- the tool tip
-
-