Package org.yamcs.xtce
Class ArrayDataType
- java.lang.Object
-
- org.yamcs.xtce.NameDescription
-
- org.yamcs.xtce.ArrayDataType
-
- All Implemented Interfaces:
Serializable,DataType
- Direct Known Subclasses:
ArrayArgumentType,ArrayParameterType
public class ArrayDataType extends NameDescription implements DataType
An array of values of the type referenced intypeand have the number of array dimensions as specified innumberOfDimensions- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classArrayDataType.Builder<T extends ArrayDataType.Builder<T>>
-
Field Summary
-
Fields inherited from class org.yamcs.xtce.NameDescription
ancillaryData, name, PATH_SEPARATOR, qualifiedName, xtceAliasSet
-
-
Constructor Summary
Constructors Constructor Description ArrayDataType(String name, int numberOfDimensions)ArrayDataType(ArrayDataType t)ArrayDataType(ArrayDataType.Builder<?> builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegerValuegetDimension(int n)Get the size of the nth dimensionDataTypegetElementType()returns the type of the elements of the arrayint[]getFixedSize()IfisFixedSize()returns true, this method can be used to get the array flat sizeObject[]getInitialValue()Get the initial value if anyintgetNumberOfDimensions()List<IntegerValue>getSize()Return the dimension list (defined as from XTCE 1.2).StringgetTypeAsString()String which represents the type.Yamcs.Value.TypegetValueType()Return the expected Value type of an engineering value conforming to this XTCE data typebooleanisFixedSize()Object[]parseString(String stringValue)Parse an initial value specified as an json array.ObjectparseStringForRawValue(String stringValue)parses the string into a java object according to the parameter encodingStringtoString(Object v)Converts a value to a string.-
Methods inherited from class org.yamcs.xtce.NameDescription
addAlias, addAliases, addAncillaryData, getAlias, getAliasSet, getAncillaryData, getLongDescription, getName, getName, getOpsName, getQualifiedName, getShortDescription, getSubsystemName, getSubsystemName, qualifiedName, setAliasSet, setAncillaryData, setLongDescription, setName, setQualifiedName, setShortDescription
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.yamcs.xtce.DataType
getLongDescription, getName, getQualifiedName, getShortDescription
-
-
-
-
Constructor Detail
-
ArrayDataType
public ArrayDataType(ArrayDataType.Builder<?> builder)
-
ArrayDataType
public ArrayDataType(String name, int numberOfDimensions)
-
ArrayDataType
public ArrayDataType(ArrayDataType t)
-
-
Method Detail
-
getElementType
public DataType getElementType()
returns the type of the elements of the array- Returns:
- - the type of the elements of the array
-
getNumberOfDimensions
public int getNumberOfDimensions()
-
getValueType
public Yamcs.Value.Type getValueType()
Description copied from interface:DataTypeReturn the expected Value type of an engineering value conforming to this XTCE data type- Specified by:
getValueTypein interfaceDataType- Returns:
-
getTypeAsString
public String getTypeAsString()
Description copied from interface:DataTypeString which represents the type. This string will be presented to the users of the system.- Specified by:
getTypeAsStringin interfaceDataType- Returns:
-
getSize
public List<IntegerValue> getSize()
Return the dimension list (defined as from XTCE 1.2). The list here is not really used except for populating theArrayParameterEntry.dimat the MDB load.- Returns:
-
isFixedSize
public boolean isFixedSize()
- Returns:
- true if all dimensions are of fixed size
-
getDimension
public IntegerValue getDimension(int n)
Get the size of the nth dimension
-
getFixedSize
public int[] getFixedSize()
IfisFixedSize()returns true, this method can be used to get the array flat size- Returns:
-
parseString
public Object[] parseString(String stringValue)
Parse an initial value specified as an json array. Each element of the array has to be itself an array until reaching thegetNumberOfDimensions()The return is an java array (Object[]). For multi dimensional arrays each Object it itself an Object[] and so on to reach the number of dimensions,
The final Object is of type as returned by the element type
DataType.parseString(String)- Specified by:
parseStringin interfaceDataType- Returns:
- - a java object representation
-
parseStringForRawValue
public Object parseStringForRawValue(String stringValue)
Description copied from interface:DataTypeparses the string into a java object according to the parameter encoding- Specified by:
parseStringForRawValuein interfaceDataType- Returns:
- a java object representation
-
toString
public String toString(Object v)
Description copied from interface:DataTypeConverts a value to a string. This should be the reverse ofDataType.parseString(String).
-
getInitialValue
public Object[] getInitialValue()
Description copied from interface:DataTypeGet the initial value if any- Specified by:
getInitialValuein interfaceDataType- Returns:
-
-