Package com.nt.udc.ndk.node
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 TypeMethodDescriptionbyte
lookupByte
(String attrId) Retrieves an byte field value with the specified idvoid
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
lookupDataLength
(String attrId) Returns the length of data stored with a specified id expressed in number of bytes.int
lookupDataType
(String attrId) Retrieves the type of data stored with a specified iddouble
lookupDouble
(String attrId) Retrieves an double field value with the specified idfloat
lookupFloat
(String attrId) Retrieves a float value with the specified idint
Retrieves an int field value with the specified idlong
lookupLong
(String attrId) Retrieves an long field value with the specified idshort
lookupShort
(String attrId) Retrieves an short field value with the specified idlookupString
(String attrId) Retrieves a String object with the specified id Use lookupDataBytes() instead, if applicable.void
outputDataBytes
(String attrId, OutputStream os) Writes the data bytes of a given attribute into a specified output-stream.
-
Method Details
-
lookupDataType
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
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
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 fieldbarr
- byte array to store the looked up databarrOffset
- offset into the barr array where data will be stored- Throws:
NonExistentAttributeException
- if there is no attribute with the given attribute id.
-
lookupByte
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
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
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
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
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
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
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
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 fieldos
- OutoutStream to which data should be written to.- Throws:
NonExistentAttributeException
- if there is no attribute with the given attribute id.IOException
-