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 in type and have the number of array dimensions as specified in numberOfDimensions
See Also:
  • Constructor Details

    • ArrayDataType

      public ArrayDataType(ArrayDataType.Builder<?> builder)
    • ArrayDataType

      public ArrayDataType(String name, int numberOfDimensions)
    • ArrayDataType

      public ArrayDataType(ArrayDataType t)
  • Method Details

    • 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: DataType
      Return the expected Value type of an engineering value conforming to this XTCE data type
      Specified by:
      getValueType in interface DataType
      Returns:
    • getTypeAsString

      public String getTypeAsString()
      Description copied from interface: DataType
      String which represents the type. This string will be presented to the users of the system.
      Specified by:
      getTypeAsString in interface DataType
      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 the ArrayParameterEntry.dim at 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()
      If isFixedSize() returns true, this method can be used to get the array flat size
      Returns:
    • convertType

      public Object[] convertType(Object value)
      Parse an initial value specified as an json array. Each element of the array has to be itself an array until reaching the getNumberOfDimensions()

      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.convertType(Object)

      Specified by:
      convertType in interface DataType
      Parameters:
      value - value to be converted, use boxed primitive values.
      Returns:
      The preferred java object representation
    • parseStringForRawValue

      public Object parseStringForRawValue(String stringValue)
      Description copied from interface: DataType
      parses the string into a java object according to the parameter encoding
      Specified by:
      parseStringForRawValue in interface DataType
      Returns:
      a java object representation
    • toString

      public String toString(Object v)
      Description copied from interface: DataType
      Converts a value to a string.
      Specified by:
      toString in interface DataType
      Returns:
    • getInitialValue

      public Object[] getInitialValue()
      Description copied from interface: DataType
      Get the initial value if any
      Specified by:
      getInitialValue in interface DataType
      Returns: