Interface Array

All Superinterfaces:
DataType
All Known Implementing Classes:
ArrayDataType

public interface Array extends DataType
Array interface
  • Field Details

  • Method Details

    • getNumElements

      int getNumElements()
      Returns the number of elements in the array
      Returns:
      the number of elements in the array
    • getElementLength

      int getElementLength()
      Returns the length of an element in the array. In the case of a Dynamic base datatype, this element length will have been explicitly specified at the time of construction. For a zero-length base type an element length of 1 will be reported with DataType.getLength() returning the number of elements.
      Returns:
      the length of one element in the array.
    • getDataType

      DataType getDataType()
      Returns the dataType of the elements in the array.
      Returns:
      the dataType of the elements in the array
    • getArrayDefaultLabelPrefix

      default String getArrayDefaultLabelPrefix(MemBuffer buf, Settings settings, int len, DataTypeDisplayOptions options)
      Get the appropriate string to use as the label prefix for an array, taking into account the actual data at the memory location.

      See also DataType.getDefaultLabelPrefix()

      Parameters:
      buf - memory buffer containing the bytes.
      settings - the Settings object
      len - the length of the data.
      options - options for how to format the default label prefix.
      Returns:
      the label prefix or null if not applicable
    • getArrayDefaultOffcutLabelPrefix

      default String getArrayDefaultOffcutLabelPrefix(MemBuffer buf, Settings settings, int len, DataTypeDisplayOptions options, int offcutLength)
      Get the appropriate string to use as the offcut label prefix for an array, taking into account the actual data at the memory location.

      See also DataType.getDefaultLabelPrefix()

      Parameters:
      buf - memory buffer containing the bytes.
      settings - the Settings object
      len - the length of the data.
      options - options for how to format the default label prefix.
      offcutLength - offcut offset from start of buf
      Returns:
      the offcut label prefix or null if not applicable
    • getArrayRepresentation

      default String getArrayRepresentation(MemBuffer buf, Settings settings, int length)
      Get the representation which corresponds to an array in memory. This will either be a String for the ArrayStringable case, "??" for uninitialized data, or the empty string if it is not.
      Parameters:
      buf - data buffer
      settings - data settings
      length - length of array
      Returns:
      a String if it is an array of chars; otherwise empty string, never null.
    • getArrayValue

      default Object getArrayValue(MemBuffer buf, Settings settings, int length)
      Get the value object which corresponds to an array in memory. This will either be a String for the ArrayStringable case or null.
      Parameters:
      buf - data buffer
      settings - data settings
      length - length of array
      Returns:
      a String if it is an array of chars; otherwise null.
    • getArrayValueClass

      default Class<?> getArrayValueClass(Settings settings)
      Get the value Class of a specific arrayDt with settings ( see getArrayValueClass(Settings) ).
      Parameters:
      settings - the relevant settings to use or null for default.
      Returns:
      Class of the value to be returned by the array or null if it can vary or is unspecified (String or Array class will be returned).