Package adams.core.base
Class MatrixSubset
- java.lang.Object
-
- adams.core.base.BaseObject
-
- adams.core.base.AbstractBaseString
-
- adams.core.base.MatrixSubset
-
- All Implemented Interfaces:
CloneHandler<BaseObject>
,Serializable
,Comparable
public class MatrixSubset extends AbstractBaseString
For defining matrix subsets ', '. Leaving a part empty means using all of them, eg ',3:4' returns all rows but only columns 3 and 4. - Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Range
m_Columns
the columns.protected Range
m_Rows
the rows.-
Fields inherited from class adams.core.base.BaseObject
m_Internal, m_Properties, SUFFIX_DISPLAY, SUFFIX_VALUE
-
-
Constructor Summary
Constructors Constructor Description MatrixSubset()
Initializes the subset with all rows/cols.MatrixSubset(String subset)
Initializes the subset with the specified subset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Range
columnsValue()
Returns the columns range.protected String
convert(String value)
Converts the string according to the specified conversion.String
getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).protected void
initialize()
Initializes the members.boolean
isValid(String value)
Checks whether the string value is a valid presentation for this class.protected Range
parseRange(String part)
Checks whether a row/column specification is valid.Range
rowsValue()
Returns the rows range.protected String[]
split(String value)
Splits the subset expression.-
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
-
-
-
-
Constructor Detail
-
MatrixSubset
public MatrixSubset()
Initializes the subset with all rows/cols.
-
MatrixSubset
public MatrixSubset(String subset)
Initializes the subset with the specified subset.- Parameters:
subset
- the subset to use
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractBaseString
-
parseRange
protected Range parseRange(String part)
Checks whether a row/column specification is valid.- Parameters:
part
- the part to check- Returns:
- the range, null if invalid format
-
split
protected String[] split(String value)
Splits the subset expression.- Parameters:
value
- the expression- Returns:
- the parts, 0-length if failed to split
-
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 non-null
-
convert
protected String convert(String value)
Converts the string according to the specified conversion.- Overrides:
convert
in classAbstractBaseString
- Parameters:
value
- the string to convert- Returns:
- the converted string
-
rowsValue
public Range rowsValue()
Returns the rows range.- Returns:
- the range
-
columnsValue
public Range columnsValue()
Returns the columns range.- Returns:
- the range
-
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
-
-