Package adams.core.base
Class Mat5ArrayElementIndex
- java.lang.Object
-
- adams.core.base.BaseObject
-
- adams.core.base.AbstractBaseString
-
- adams.core.base.Mat5ArrayElementIndex
-
- All Implemented Interfaces:
CloneHandler<BaseObject>
,Serializable
,Comparable
public class Mat5ArrayElementIndex extends AbstractBaseString
For specifying a matrix index (or matrix subset).- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
SEPARATOR
the separator between dimensions.-
Fields inherited from class adams.core.base.BaseObject
m_Internal, m_Properties, SUFFIX_DISPLAY, SUFFIX_VALUE
-
-
Constructor Summary
Constructors Constructor Description Mat5ArrayElementIndex()
Initializes the index with no index (empty string).Mat5ArrayElementIndex(int[] index)
Initializes the index with the specified index array.Mat5ArrayElementIndex(String index)
Initializes the index with the specified string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).int[]
indexValue()
Returns the value as dimensional index.int[]
indexValue(boolean convertToZeroBased)
Returns the value as dimensional index.boolean
isCompatible(us.hebi.matlab.mat.types.Array array)
Checks whether the array is compatible with the dimension specifications.boolean
isValid(String value)
Checks whether the string value is a valid presentation for this class.int[]
openDimensions()
Returns the indices of the unspecified/open dimensions.-
Methods inherited from class adams.core.base.AbstractBaseString
convert, getValue, initialize, 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
-
SEPARATOR
public static final String SEPARATOR
the separator between dimensions.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Mat5ArrayElementIndex
public Mat5ArrayElementIndex()
Initializes the index with no index (empty string).
-
Mat5ArrayElementIndex
public Mat5ArrayElementIndex(String index)
Initializes the index with the specified string.- Parameters:
index
- the index
-
Mat5ArrayElementIndex
public Mat5ArrayElementIndex(int[] index)
Initializes the index with the specified index array.- Parameters:
index
- the index
-
-
Method Detail
-
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
-
indexValue
public int[] indexValue()
Returns the value as dimensional index. Uses -1 for unspecified/empty dimensions (eg for iterating).- Returns:
- the array of positions (1-based indices), empty array if nothing specified
-
indexValue
public int[] indexValue(boolean convertToZeroBased)
Returns the value as dimensional index. Uses -1 for unspecified/empty dimensions (eg for iterating).- Parameters:
convertToZeroBased
- true: convert from 1-based to 0-based, false: leave unchanged- Returns:
- the array of positions, empty array if nothing specified
-
openDimensions
public int[] openDimensions()
Returns the indices of the unspecified/open dimensions.- Returns:
- the unspecified dimensions, empty array if all specified
-
isCompatible
public boolean isCompatible(us.hebi.matlab.mat.types.Array array)
Checks whether the array is compatible with the dimension specifications.- Parameters:
array
- the array to check against- Returns:
- true if the same number of 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
-
-