Package com.nt.udc.io

Class COSARAttr

java.lang.Object
com.nt.udc.io.COSARAttr
Direct Known Subclasses:
COSARAttrByte, COSARAttrDouble, COSARAttrFloat, COSARAttrInt, COSARAttrIP, COSARAttrLong, COSARAttrShort, COSARAttrString, COSARAttrUInt

public abstract class COSARAttr extends Object
This class represents the abstract base-class for all OSAR attributes ( fields ).
  • Field Details

    • m_type

      protected int m_type
      OSAR attr type
    • m_id

      protected String m_id
      OSAR attr id
  • Constructor Details

    • COSARAttr

      protected COSARAttr(int type, String id)
      This constructor initializes a new COSARAttr based on type and id. Instances may be created only by sub-classes.
      Parameters:
      type - The type of the OSAR attribute
      id - The id of the OSAR attribute
  • Method Details

    • getType

      public int getType()
      Returns:
      The type of the OSAR attribute
    • getId

      public final String getId()
      Returns:
      The field-id of the OSAR attribute
    • getStringValue

      public String getStringValue() throws Exception
      Returns:
      The value as a string
      Throws:
      Exception
    • getLongValue

      public long getLongValue() throws Exception
      Returns:
      The value as a long
      Throws:
      Exception
    • getMillisValue

      public long getMillisValue() throws Exception
      Returns:
      The value as in milliseconds
      Throws:
      Exception
    • getIPValue

      public byte[] getIPValue() throws Exception
      Returns:
      The value as a raw IP address
      Throws:
      Exception
    • getBytesValue

      public byte[] getBytesValue() throws Exception
      Returns:
      The value as an array of bytes
      Throws:
      Exception
    • getDoubleValue

      public double getDoubleValue() throws Exception
      Returns:
      The value as a double
      Throws:
      Exception
    • getRecAttr

      public OSARecAttr getRecAttr()
      Returns:
      The equivalent OSARecAttr
    • getDCField

      public DCField getDCField()
      Returns:
      The equivalent DCField
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      A string representation of the OSAR attribute
    • setId

      public final void setId(String id)
    • setStringValue

      public boolean setStringValue(String value)
      This function sets the attribute value based on a string.
      Returns:
      true if successful, false otherwise
    • setValue

      public boolean setValue(COSARAttr attr)
      This function sets converts the value contained by the passed attribute to the current type
    • idToInt

      protected int idToInt()