Package adams.core.base
Class ArrayDimensions
- java.lang.Object
-
- adams.core.base.BaseObject
-
- adams.core.base.AbstractBaseString
-
- adams.core.base.ArrayDimensions
-
- All Implemented Interfaces:
CloneHandler<BaseObject>
,Serializable
,Comparable
public class ArrayDimensions extends AbstractBaseString
For defining dimensions for an array: eg [2] or [2][4][6] or [@{variable}].- Version:
- $Revision$
- 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.protected int[]
m_Dimensions
the parsed dimensions.-
Fields inherited from class adams.core.base.BaseObject
m_Internal, m_Properties, SUFFIX_DISPLAY, SUFFIX_VALUE
-
-
Constructor Summary
Constructors Constructor Description ArrayDimensions()
Initializes the string with length 0.ArrayDimensions(String s)
Initializes the object with the string to parse.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
convert(String value)
Converts the string according to the specified conversion.int[]
dimensionsValue()
Returns the dimensions.String
getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).protected void
initialize()
Initializes the internal object.boolean
isValid(String value)
Checks whether the string value is a valid presentation for this class.protected int[]
parse(String s)
Parses the dimension string.-
Methods inherited from class adams.core.base.AbstractBaseString
getValue, isEmpty, length, setValue, stringValue
-
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
-
m_Dimensions
protected int[] m_Dimensions
the parsed dimensions.
-
-
Constructor Detail
-
ArrayDimensions
public ArrayDimensions()
Initializes the string with length 0.
-
ArrayDimensions
public ArrayDimensions(String s)
Initializes the object with the string to parse.- Parameters:
s
- the string to parse
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the internal object.- Overrides:
initialize
in classAbstractBaseString
-
convert
protected String convert(String value)
- Overrides:
convert
in classAbstractBaseString
- Parameters:
value
- the string to convert- Returns:
- the converted string
-
parse
protected int[] parse(String s)
Parses the dimension string.- Parameters:
s
- the string to parse- Returns:
- the dimensions or null if failed to parse
-
isValid
public boolean isValid(String value)
Checks whether the string value is a valid presentation for this class.- Overrides:
isValid
in classAbstractBaseString
- Parameters:
value
- the string value to check- Returns:
- true if parseable
-
dimensionsValue
public int[] dimensionsValue()
Returns the dimensions.- Returns:
- the dimensions
-
getTipText
public String getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).- Specified by:
getTipText
in classAbstractBaseString
- Returns:
- the tool tip
-
-