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 Rangem_Columnsthe columns.protected Rangem_Rowsthe 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 RangecolumnsValue()Returns the columns range.protected Stringconvert(String value)Converts the string according to the specified conversion.StringgetTipText()Returns a tool tip for the GUI editor (ignored if null is returned).protected voidinitialize()Initializes the members.booleanisValid(String value)Checks whether the string value is a valid presentation for this class.protected RangeparseRange(String part)Checks whether a row/column specification is valid.RangerowsValue()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:
initializein 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:
isValidin 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:
convertin 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:
getTipTextin classAbstractBaseString- Returns:
- the tool tip
-
-