Interface StringIdLookupIfc


public interface StringIdLookupIfc
An interface implemented by StringIdNAR which is used for looking up data fields using string attribute ids as lookup keys. Data values are stored into a StringIdNAR using the methods in StringIdStoreIfc, also implemented by StringIdNAR.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    Retrieves an byte field value with the specified id
    void
    lookupDataBytes(String attrId, byte[] barr, int barrOffset)
    Retrieves the data stored with a specified id by storing the bytes into a given byte array at the specified offset.
    int
    Returns the length of data stored with a specified id expressed in number of bytes.
    int
    Retrieves the type of data stored with a specified id
    double
    Retrieves an double field value with the specified id
    float
    Retrieves a float value with the specified id
    int
    lookupInt(String attrId)
    Retrieves an int field value with the specified id
    long
    Retrieves an long field value with the specified id
    short
    Retrieves an short field value with the specified id
    Retrieves a String object with the specified id Use lookupDataBytes() instead, if applicable.
    void
    Writes the data bytes of a given attribute into a specified output-stream.
  • Method Details

    • lookupDataType

      int lookupDataType(String attrId)
      Retrieves the type of data stored with a specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      int attribute type, e.g. NAR.INT_TYPE, NAR.STRING_TYPE
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
    • lookupDataLength

      int lookupDataLength(String attrId)
      Returns the length of data stored with a specified id expressed in number of bytes.
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      int attribute type, e.g. NAR.INT_TYPE, NAR.STRING_TYPE
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
    • lookupDataBytes

      void lookupDataBytes(String attrId, byte[] barr, int barrOffset)
      Retrieves the data stored with a specified id by storing the bytes into a given byte array at the specified offset. This method would throw a run-time exception if the specified array is not large enough to hold all the bytes of the specified data field starting at the given offset.
      Parameters:
      attrId - String identifier of the desired field
      barr - byte array to store the looked up data
      barrOffset - offset into the barr array where data will be stored
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
    • lookupByte

      byte lookupByte(String attrId)
      Retrieves an byte field value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      byte value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a byte.
    • lookupInt

      int lookupInt(String attrId)
      Retrieves an int field value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      int value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a int.
    • lookupShort

      short lookupShort(String attrId)
      Retrieves an short field value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      short value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a short.
    • lookupLong

      long lookupLong(String attrId)
      Retrieves an long field value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      long value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a long.
    • lookupFloat

      float lookupFloat(String attrId)
      Retrieves a float value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      float value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a float.
    • lookupDouble

      double lookupDouble(String attrId)
      Retrieves an double field value with the specified id
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      double value stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a double.
    • lookupString

      String lookupString(String attrId)
      Retrieves a String object with the specified id Use lookupDataBytes() instead, if applicable.
      Parameters:
      attrId - String identifier of the desired field
      Returns:
      String object stored against attrId
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      InvalidAttributeTypeException - if the attribute stored with the given attribute id is not a String.
    • outputDataBytes

      void outputDataBytes(String attrId, OutputStream os) throws IOException
      Writes the data bytes of a given attribute into a specified output-stream. Numeric fields are written out in network byte order, and String objects are encoded with the systems default encoding.
      Parameters:
      attrId - String identifier of the desired field
      os - OutoutStream to which data should be written to.
      Throws:
      NonExistentAttributeException - if there is no attribute with the given attribute id.
      IOException