Package adams.core.base
Class BaseDouble
- java.lang.Object
-
- adams.core.base.BaseObject
-
- adams.core.base.BaseDouble
-
- All Implemented Interfaces:
CloneHandler<BaseObject>
,Serializable
,Comparable
public class BaseDouble extends BaseObject
Wrapper for a Double object to be editable in the GOE.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT
the default value.-
Fields inherited from class adams.core.base.BaseObject
m_Internal, m_Properties, SUFFIX_DISPLAY, SUFFIX_VALUE
-
-
Constructor Summary
Constructors Constructor Description BaseDouble()
Initializes the string with length 0.BaseDouble(Double value)
Initializes the object with the given value.BaseDouble(String s)
Initializes the object with the string to parse.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
doubleValue()
Returns the double value.String
getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).String
getValue()
Returns the current string value.protected void
initialize()
Initializes the internal object.boolean
isValid(String value)
Checks whether the string value is a valid presentation for this class.void
setValue(String value)
Sets the string value.static BaseDouble[]
toBaseDouble(double[] values)
Turns the primitive array into a BaseDouble one.static BaseDouble[]
toBaseDouble(Double[] values)
Turns the primitive array into a BaseDouble one.static Double[]
toNumber(BaseDouble[] values)
Turns the BaseDouble array into a number array.static double[]
toPrimitive(BaseDouble[] values)
Turns the BaseDouble array into a primitive array.-
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
-
BaseDouble
public BaseDouble()
Initializes the string with length 0.
-
BaseDouble
public BaseDouble(String s)
Initializes the object with the string to parse.- Parameters:
s
- the string to parse
-
BaseDouble
public BaseDouble(Double 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:
initialize
in classBaseObject
-
isValid
public boolean isValid(String value)
Checks whether the string value is a valid presentation for this class.- Specified by:
isValid
in classBaseObject
- Parameters:
value
- the string value to check- Returns:
- true if parseable double
-
setValue
public void setValue(String value)
Sets the string value.- Specified by:
setValue
in classBaseObject
- Parameters:
value
- the string value
-
getValue
public String getValue()
Returns the current string value.- Specified by:
getValue
in classBaseObject
- Returns:
- the string value
-
doubleValue
public double doubleValue()
Returns the double value.- Returns:
- the double value
-
getTipText
public String getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).- Specified by:
getTipText
in classBaseObject
- Returns:
- the tool tip
-
toPrimitive
public static double[] toPrimitive(BaseDouble[] values)
Turns the BaseDouble array into a primitive array.- Parameters:
values
- the array to convert- Returns:
- the primitive array
-
toBaseDouble
public static BaseDouble[] toBaseDouble(double[] values)
Turns the primitive array into a BaseDouble one.- Parameters:
values
- the array to convert- Returns:
- the BaseObject array
-
toNumber
public static Double[] toNumber(BaseDouble[] values)
Turns the BaseDouble array into a number array.- Parameters:
values
- the array to convert- Returns:
- the number array
-
toBaseDouble
public static BaseDouble[] toBaseDouble(Double[] values)
Turns the primitive array into a BaseDouble one.- Parameters:
values
- the array to convert- Returns:
- the BaseObject array
-
-