Class AttributeEntry

java.lang.Object
uk.ac.bristol.star.cdf.AttributeEntry

public class AttributeEntry extends Object
Represents an entry in a global or variable attribute.
Since:
28 Jun 2013
  • Constructor Details

    • AttributeEntry

      public AttributeEntry(DataType dataType, Object rawValue, int nitem)
      Constructor.
      Parameters:
      dataType - data type
      rawValue - array object storing original representation of the object in the CDF (array of primitives or Strings)
      nitem - number of items represented by the array
  • Method Details

    • getDataType

      public DataType getDataType()
      Returns the data type of this entry.
      Returns:
      data type
    • getRawValue

      public Object getRawValue()
      Returns the array object storing the original representation of the object in the CDF. This is either an array of either primitives or Strings.
      Returns:
      raw array value
    • getShapedValue

      public Object getShapedValue()
      Returns the value of this entry as a convenient object. If the item count is 1 it's the same as getItem(0), and if the item count is >1 it's the same as the raw value.
      Returns:
      shaped entry value
    • getItemCount

      public int getItemCount()
      Returns the number of items in this entry.
      Returns:
      item count
    • getItem

      public Object getItem(int itemIndex)
      Returns an object representing one of the items in this entry. If the raw array is a primitive, the result is a wrapper object.
      Parameters:
      itemIndex - item index
      Returns:
      value of item
    • toString

      public String toString()
      Formats the value of this entry as a string.
      Overrides:
      toString in class Object