Class ProductData.ASCII

All Implemented Interfaces:
Cloneable
Enclosing class:
ProductData

public static class ProductData.ASCII extends ProductData.Byte
The ProductData.ASCII class is a ProductData.Byte specialisation representing textual values.

Internally, data is stored in an array of the type byte[].

  • Constructor Details

    • ASCII

      public ASCII(int length)
      Constructs a new ASCII value.
      Parameters:
      length - the ASCII string length
    • ASCII

      public ASCII(String data)
      Constructs a new ASCII value.
      Parameters:
      data - the ASCII string data
  • Method Details

    • getElemString

      public String getElemString()
      Returns a textual representation of this value's value. The text returned is a string created from the bytes array elements in this value interpreted as ASCII values.
      Overrides:
      getElemString in class ProductData
      Returns:
      a text representing this product data, never null
    • setElems

      public void setElems(Object data)
      Sets the data of this value. The data must be a string, an byte or an char array. Each has to have at least a length of one.
      Overrides:
      setElems in class ProductData.Byte
      Parameters:
      data - the data array
      Throws:
      IllegalArgumentException - if data is null or it is not an array of the required type or does the array length is less than one.
    • getElemStringAt

      public String getElemStringAt(int index)
      Returns a textual representation of this product data. The text returned is a string cretaed from the bytes array elements in this value interpreted as ASCII values.
      Overrides:
      getElemStringAt in class ProductData.Byte
      Parameters:
      index - the value index, must be >=0 and <getNumDataElems()
      Returns:
      a text representing this product data, never null
    • createDeepClone

      protected ProductData createDeepClone()
      Retuns a "deep" copy of this product data.
      Overrides:
      createDeepClone in class ProductData.Byte
      Returns:
      a copy of this product data
    • getTypeString

      public String getTypeString()
      Returns this value's data type String.
      Overrides:
      getTypeString in class ProductData