Package com.nt.udc.nar
Class NAR
java.lang.Object
com.nt.udc.nar.NAR
- All Implemented Interfaces:
DCFieldContainer
,Serializable
,Cloneable
- Direct Known Subclasses:
FileEIRecord
Used for passing data between Nodes.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addAttribute
(int id, byte value) Deprecated.Use setField(DCField)final void
addAttribute
(int id, int value) Deprecated.Use setField(DCField)final void
addAttribute
(int id, int type, byte[] value) Deprecated.Use setField(DCField)final void
addAttribute
(int id, int type, String s) Deprecated.use Use setField(DCField)final void
addAttribute
(int id, long value) Deprecated.Use setField(DCField)final void
addAttribute
(int id, short value) Deprecated.Use setField(DCField)final void
addAttribute
(int id, String value) Deprecated.Use setField(DCField)final void
addAttribute
(DCField attr) Deprecated.Use Use setField(DCField)void
addMillisAttribute
(int id, long time) Deprecated.Use setField(DCField)void
addSecondsAttribute
(int id, int time) Deprecated.Use setField(DCField)clone()
Creates a copy of this NAR.void
Copies this into the given NAR.boolean
containsAttr
(int id) Deprecated.use containsField(FieldKey)boolean
convertNarToString
(com.nt.udc.datadictparser.DataDictionary dd) Deprecated.void
boolean
fieldExist
(FieldKey key) A proper implementation of fieldExist().static NAR
fromBytes
(byte[] b) DCField[]
The method to getAttr all DCFieldsbyte
getAttrAsByte
(int id) Gets the byte value of the attribute associated with the specified id.byte[]
getAttrAsBytes
(int id) Deprecated.getAttrAsDate
(int id) Deprecated.use getField(FieldKey)double
getAttrAsDouble
(int id) Deprecated.use getField(FieldKey)float
getAttrAsFloat
(int id) Deprecated.use getField(FieldKey)int
getAttrAsInt
(int id) Deprecated.use getField(FieldKey)getAttrAsList
(int id) Deprecated.long
getAttrAsLong
(int id) Deprecated.use getField(FieldKey)long
getAttrAsMillis
(int id) Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by the attribute associated with the specified id.getAttrAsObject
(int id) Deprecated.short
getAttrAsShort
(int id) Deprecated.use getField(FieldKey)getAttrAsString
(int id) Deprecated.use getField(FieldKey)getAttrAsTime
(int id) Gets theTime
value of the attribute associated with the specified id.getAttribute
(int id) Deprecated.use getField(FieldKey)getAttribute
(String id) Deprecated.use getField(FieldKey)byte[]
getAttributeValueBytes
(int id) Deprecated.byte[]
Returns the attribute's value in bytes.byte[]
Deprecated.int
getAttrType
(int id) Deprecated.int
getAttrType
(String id) Gets the type of the attribute associated with the specified id.getField
(int id) Deprecated.Should use getAttribute(String)Deprecated.Should use getAttribute(String)byte[]
getFieldValue
(int id) Deprecated.byte[]
getFieldValue
(FieldKey key) byte[]
getFieldValue
(String id) Deprecated.int
int
The method to getAttr the number of attributesint
getType
(int id) int
Returns the type of the given field.byte
lookupByte
(int attrId) Deprecated.byte
lookupByte
(String attrId) Deprecated.void
lookupDataBytes
(int attrId, byte[] barr, int barrOffset) Deprecated.void
lookupDataBytes
(String attrId, byte[] barr, int barrOffset) Deprecated.int
lookupDataLength
(int attrId) Deprecated.int
lookupDataLength
(String attrId) Deprecated.int
lookupDataType
(int attrId) Deprecated.int
lookupDataType
(String attrId) Deprecated.Should use getAttrType insteaddouble
lookupDouble
(int attrId) Deprecated.double
lookupDouble
(String attrId) Deprecated.float
lookupFloat
(int attrId) Deprecated.float
lookupFloat
(String attrId) Deprecated.int
lookupInt
(int attrId) Deprecated.int
Deprecated.long
lookupLong
(int attrId) Deprecated.long
lookupLong
(String attrId) Deprecated.short
lookupShort
(int attrId) Deprecated.short
lookupShort
(String attrId) Deprecated.lookupString
(int attrId) Deprecated.lookupString
(String attrId) Deprecated.void
Something for Multithreaded AP (and EP in the future) to use.boolean
readByteArray
(byte[] barray) boolean
remove
(int id) Deprecated.use remove(FieldKey)Deprecated.use remove(FieldKey)removeAttribute
(int id) Deprecated.use removeField(FieldKey)Deprecated.use removeField(FieldKey)removeField
(FieldKey key) void
setField
(int id, int type, byte[] value) Deprecated.use setField(DCField)void
Sets a field from its DCField formvoid
void
Sets a field, with the given ID, type and value.void
shiftAttribute
(int oldId, int newId) Deprecated.int
size()
final byte[]
Returns a copy of the NAR's byte array.toFormattedString
(com.nt.udc.datadictparser.DataDictionary dd) static NAR[]
toRecArray
(byte[] b) void
toStream
(OutputStream oStream) The method outputs an NAR to the output streamtoString()
Converts the data contained in this object to a StringtoString
(com.nt.udc.datadictparser.DataDictionary dd) void
byte[]
int
writeObject
(OutputStream out)
-
Field Details
-
NULL_TYPE
public static final int NULL_TYPE- See Also:
-
BYTE_TYPE
public static final int BYTE_TYPE- See Also:
-
SHORT_TYPE
public static final int SHORT_TYPE- See Also:
-
INT_TYPE
public static final int INT_TYPE- See Also:
-
FLOAT_TYPE
public static final int FLOAT_TYPE- See Also:
-
LONG_TYPE
public static final int LONG_TYPE- See Also:
-
DOUBLE_TYPE
public static final int DOUBLE_TYPE- See Also:
-
BYTE_ARRAY_TYPE
public static final int BYTE_ARRAY_TYPE- See Also:
-
STRING_TYPE
public static final int STRING_TYPE- See Also:
-
TIMEINSECONDS_TYPE
public static final int TIMEINSECONDS_TYPE- See Also:
-
IP_TYPE
public static final int IP_TYPE- See Also:
-
TIMEINMILLIS_TYPE
public static final int TIMEINMILLIS_TYPE- See Also:
-
MAC_TYPE
public static final int MAC_TYPE- See Also:
-
UINT128_TYPE
public static final int UINT128_TYPE- See Also:
-
OBJECT_TYPE
public static final int OBJECT_TYPE- See Also:
-
LIST_TYPE
public static final int LIST_TYPE- See Also:
-
MAP_TYPE
public static final int MAP_TYPE- See Also:
-
-
Constructor Details
-
NAR
public NAR() -
NAR
public NAR(byte[] bytes) Creates an NAR, where the NAR is completely in byte form. (This means the byte array contains the NAR length as well as the attributes).- Parameters:
bytes
- bytes of the NAR
-
-
Method Details
-
clone
Copies this into the given NAR. This is just another way to do the Cloneable clone() method.- Parameters:
newnar
- Empty, or NAR being updated
-
clone
Creates a copy of this NAR. For use with the Cloneable interface.- Specified by:
clone
in interfaceDCFieldContainer
- Overrides:
clone
in classObject
- Returns:
- new NAR
-
toStream
The method outputs an NAR to the output stream- Parameters:
oStream
- output stream to write the NAR to- Throws:
IOException
-
toByteArray
public final byte[] toByteArray()Returns a copy of the NAR's byte array.- Specified by:
toByteArray
in interfaceDCFieldContainer
- Returns:
- NAR, in byte form
-
addAttribute
Deprecated.Use setField(DCField) -
addAttribute
Deprecated.Use setField(DCField) -
addAttribute
Deprecated.Use setField(DCField) -
addAttribute
Deprecated.Use setField(DCField) -
addAttribute
Deprecated.Use setField(DCField) -
addMillisAttribute
Deprecated.Use setField(DCField)Add aTIMEINMILLIS
attribute to the NAR. If there is an attribute already associated with id, its value is replaced.- Parameters:
id
- the id of the attributetime
- the time in milliseconds value of the attribute
-
addSecondsAttribute
Deprecated.Use setField(DCField)Add aTIMEINSECONDS
attribute to the NAR. If there is an attribute already associated with id, its value is replaced.- Parameters:
id
- the id of the attributetime
- the time in seconds value of the attribute
-
addAttribute
Deprecated.use Use setField(DCField) -
addAttribute
Deprecated.Use setField(DCField) -
addAttribute
Deprecated.Use Use setField(DCField) -
shiftAttribute
Deprecated.Change an attribute's ID to a new ID.- Parameters:
oldId
- Old attribute IDnewId
- New attribute ID
-
removeAttribute
Deprecated.use removeField(FieldKey)This method removes an attribute with the given id.- Parameters:
id
- id of the attribute- Returns:
- DCField object, of the id
-
removeAttribute
Deprecated.use removeField(FieldKey)This method removes an attribute with the given id.- Parameters:
id
- id of the attribute- Returns:
- DCField object, of the id
-
removeField
-
remove
Deprecated.use remove(FieldKey)- Parameters:
id
-- Returns:
-
remove
Deprecated.use remove(FieldKey)- Parameters:
id
-- Returns:
-
getAttribute
Deprecated.use getField(FieldKey)The method to getAttr an DCField object with tag- Parameters:
id
- id of the attribute- Returns:
- DCField object, of the id
-
getAttribute
Deprecated.use getField(FieldKey)The method to getAttr an DCField object with tag- Parameters:
id
- id of the attribute- Returns:
- DCField object, of the id
-
getAllAttributes
The method to getAttr all DCFields- Returns:
- array of DCField objects
-
getAttributeValueBytes
Deprecated.Returns the attribute's value in bytes.- Parameters:
id
- id of the attribute- Returns:
- the bytes of the attribute's value
-
getAttributeValueBytes
Returns the attribute's value in bytes. -
getAttributeValueBytes
Deprecated.- Parameters:
id
-- Returns:
-
containsAttr
Deprecated.use containsField(FieldKey)Tests if there is an attribute with the specified id in this NAR.- Parameters:
id
- the id of the attribute- Returns:
true
if an attribute with the given id exists in this NAR;false
otherwise
-
containsField
-
getAttrType
Gets the type of the attribute associated with the specified id.- Parameters:
id
- the id of the attribute- Returns:
- the type that is associated with the attribute specified by the id; -1 if the id does not identify an attribute in this NAR
-
getAttrType
Deprecated.- Parameters:
id
-- Returns:
-
getNumAttrs
public int getNumAttrs()The method to getAttr the number of attributes- Returns:
- number of attributes in the NAR
-
toString
-
toString
Description copied from interface:DCFieldContainer
Converts the data contained in this object to a String- Specified by:
toString
in interfaceDCFieldContainer
- Overrides:
toString
in classObject
- Returns:
- String representation of the data
-
toFormattedString
-
toFormattedString
-
size
public int size() -
convertNarToString
Deprecated. -
convertNarToFormattedString
-
convertNarToString
-
update
-
getAttrAsByte
Gets the byte value of the attribute associated with the specified id. This method should only be used forBYTE
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the byte value of the attribute associated with the specified id
- Throws:
NoSuchFieldException
- Thrown when the given id is not found.UnsupportedTypeException
- Thrown when the type of the id cannot be converted to the return type.
-
getAttrAsBytes
Deprecated.Gets the bytes value of the attribute associated with the specified id. This method should only be used forBYTES
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the bytes value of the attribute associated with the specified id
-
getAttrAsShort
@Deprecated public short getAttrAsShort(int id) throws NoSuchFieldException, UnsupportedTypeException Deprecated.use getField(FieldKey)Gets the short value of the attribute associated with the specified id. This method should only be used forSHORT
,BYTE
, and two byteSTRING
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the short value of the attribute associated with the specified id
- Throws:
NoSuchFieldException
- Thrown when the given id is not found.UnsupportedTypeException
- Thrown when the type of the id cannot be converted to the return type.
-
getAttrAsInt
Deprecated.use getField(FieldKey)Gets the integer value of the attribute associated with the specified id. This method should only be used forINTEGER
,BYTE
,SHORT
,IP
,TIMEINSECONDS
and four byteSTRING
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the integer value of the attribute associated with the specified id
- Throws:
NoSuchFieldException
- Thrown when the given id is not found.UnsupportedTypeException
- Thrown when the type of the id cannot be converted to the return type.
-
getAttrAsLong
Deprecated.use getField(FieldKey)Gets the long value of the attribute associated with the specified id. This method should only be used forLONG
,BYTE
,SHORT
,INTEGER
,TIMEINSECONDS
IP
,FLOAT
,TIMEINMILLIS
,MAC
,DOUBLE
and eight byteSTRING
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the long value of the attribute associated with the specified id
- Throws:
NoSuchFieldException
- Thrown when the given id is not found.UnsupportedTypeException
- Thrown when the type of the id cannot be converted to the return type.
-
getAttrAsFloat
@Deprecated public float getAttrAsFloat(int id) throws NoSuchFieldException, UnsupportedTypeException Deprecated.use getField(FieldKey)Gets the float value of the attribute associated with the specified id. This method should only be used forFLOAT
,BYTE
,SHORT
,INTEGER
,TIMEINSECONDS
and four byteSTRING
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the float value of the attribute associated with the specified id
- Throws:
NoSuchFieldException
- Thrown when the given id is not found.UnsupportedTypeException
- Thrown when the type of the id cannot be converted to the return type.
-
getAttrAsDouble
@Deprecated public double getAttrAsDouble(int id) throws NoSuchFieldException, UnsupportedTypeException Deprecated.use getField(FieldKey)Gets the double value of the attribute associated with the specified id. This method should only be used forDOUBLE
,BYTE
,SHORT
,INTEGER
,TIMEINSECONDS
,FLOAT
,TIMEINMILLIS
,LONG
and eight byteSTRING
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the double value of the attribute associated with the specified id
- Throws:
NoSuchFieldException
- Thrown when the given id is not found.UnsupportedTypeException
- Thrown when the type of the id cannot be converted to the return type.
-
getAttrAsDate
Deprecated.use getField(FieldKey)Gets theDate
value of the attribute associated with the specified id. This method should only be used forBYTE
,SHORT
,INTEGER
,TIMEINSECONDS
,FLOAT
,LONG
,TIMEINMILLIS
,DOUBLE
and eight byteSTRING
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the
Date
value of the attribute associatedi with the specified id - Throws:
NoSuchFieldException
- Thrown when the given id is not found.UnsupportedTypeException
- Thrown when the type of the id cannot be converted to the return type.
-
getAttrAsString
@Deprecated public String getAttrAsString(int id) throws NoSuchFieldException, UnsupportedTypeException, IOException, ClassNotFoundException Deprecated.use getField(FieldKey)Gets the string representation of the attribute associated with the specified id.- Parameters:
id
- the id of the attribute- Returns:
- a new String object representing the attribute associated with the specified id
- Throws:
NoSuchFieldException
- Thrown when the given id is not found.UnsupportedTypeException
- Thrown when the type of the id cannot be converted to the return type.IOException
ClassNotFoundException
-
getAttrAsMillis
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by the attribute associated with the specified id. This method should only be used forBYTE
,SHORT
,INTEGER
,TIMEINSECONDS
,FLOAT
,LONG
,TIMEINMILLIS
,DOUBLE
and eight byteSTRING
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by the attribute associated with the specified id
- Throws:
NoSuchFieldException
- Thrown when the given id is not found.UnsupportedTypeException
- Thrown when the type of the id cannot be converted to the return type.
-
getAttrAsTime
Gets theTime
value of the attribute associated with the specified id. This method should only be used forBYTE
,SHORT
,INTEGER
,TIMEINSECONDS
,FLOAT
,LONG
,TIMEINMILLIS
,DOUBLE
and eight byteSTRING
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the
Time
value of the attribute associated with the specified id - Throws:
NoSuchFieldException
- Thrown when the given id is not found.UnsupportedTypeException
- Thrown when the type of the id cannot be converted to the return type.
-
getAttrAsObject
@Deprecated public Object getAttrAsObject(int id) throws NoSuchFieldException, UnsupportedTypeException Deprecated.Gets the OBJECT value of the attribute associated with the specified id. This method should only be used forOBJECT
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the object value of the attribute associated with the specified id; 0 if the associated attribute type does not support this value request, or if the id does not identify an attribute in this NAR
- Throws:
NoSuchFieldException
UnsupportedTypeException
-
getAttrAsList
Deprecated.Gets the LIST value of the attribute associated with the specified id. This method should only be used forLIST
attribute types.- Parameters:
id
- the id of the attribute- Returns:
- the object value of the attribute associated with the specified id; 0 if the associated attribute type does not support this value request, or if the id does not identify an attribute in this NAR
-
getField
Deprecated.Should use getAttribute(String)Gets a field according to it's integer ID- Parameters:
id
- field id, in integer format- Returns:
- field object
-
getField
Deprecated.Should use getAttribute(String)Gets a field according to it's String ID- Specified by:
getField
in interfaceDCFieldContainer
- Parameters:
id
- field id, in String format- Returns:
- field object
-
getField
- Specified by:
getField
in interfaceDCFieldContainer
-
getFieldValue
Deprecated.Gets a field's value according to it's String ID- Specified by:
getFieldValue
in interfaceDCFieldContainer
- Parameters:
id
- field id, in String format- Returns:
- bytes, representing the field's value
-
getFieldValue
Deprecated.- Parameters:
id
-- Returns:
-
getFieldValue
- Specified by:
getFieldValue
in interfaceDCFieldContainer
-
getType
Returns the type of the given field. Types should be defined in DCField.- Specified by:
getType
in interfaceDCFieldContainer
- Parameters:
id
- field id- Returns:
- type of the field, as an integer
-
getType
public int getType(int id) -
setField
Sets a field, with the given ID, type and value.- Specified by:
setField
in interfaceDCFieldContainer
- Parameters:
fieldId
- field ID, in String formtype
- field type, as an integervalue
- field value, in byte[] form
-
setField
- Specified by:
setField
in interfaceDCFieldContainer
-
setField
Sets a field from its DCField form- Specified by:
setField
in interfaceDCFieldContainer
- Parameters:
field
- field, in DCField form
-
setField
Deprecated.use setField(DCField)Sets a field, with the given ID, type and value.- Specified by:
setField
in interfaceDCFieldContainer
- Parameters:
id
- field ID, in integer formtype
- field type, as an integervalue
- field value, in byte[] form
-
lookupDataType
Deprecated.Should use getAttrType insteadRetrieves the type of data stored with a specified id- Parameters:
attrId
- 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
Deprecated.Returns the length of data stored with a specified id expressed in number of bytes.- Parameters:
attrId
- 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
@Deprecated public void lookupDataBytes(String attrId, byte[] barr, int barrOffset) throws NonExistentAttributeException Deprecated.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
- 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
@Deprecated public byte lookupByte(String attrId) throws NonExistentAttributeException, InvalidAttributeTypeException Deprecated.Retrieves an byte field value with the specified id- Parameters:
attrId
- 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
@Deprecated public int lookupInt(String attrId) throws NonExistentAttributeException, InvalidAttributeTypeException Deprecated.Retrieves an int field value with the specified id- Parameters:
attrId
- 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
@Deprecated public short lookupShort(String attrId) throws NonExistentAttributeException, InvalidAttributeTypeException Deprecated.Retrieves an short field value with the specified id- Parameters:
attrId
- 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
@Deprecated public long lookupLong(String attrId) throws NonExistentAttributeException, InvalidAttributeTypeException Deprecated.Retrieves an long field value with the specified id- Parameters:
attrId
- 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
@Deprecated public float lookupFloat(String attrId) throws NonExistentAttributeException, InvalidAttributeTypeException Deprecated.Retrieves a float value with the specified id- Parameters:
attrId
- 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
@Deprecated public double lookupDouble(String attrId) throws NonExistentAttributeException, InvalidAttributeTypeException Deprecated.Retrieves an double field value with the specified id- Parameters:
attrId
- 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
@Deprecated public String lookupString(String attrId) throws NonExistentAttributeException, InvalidAttributeTypeException Deprecated.Retrieves a String object with the specified id Use lookupDataBytes() instead, if applicable.- Parameters:
attrId
- 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.
-
lookupDataType
Deprecated.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
Deprecated.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
Deprecated.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
Deprecated.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
Deprecated.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
Deprecated.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
Deprecated.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
Deprecated.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
Deprecated.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
Deprecated.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.
-
writeByteArray
public byte[] writeByteArray() -
writeObject
- Parameters:
out
-- Throws:
IOException
-
readByteArray
public boolean readByteArray(byte[] barray) -
readObject
- Parameters:
in
-- Throws:
IOException
-
toRecArray
-
fromBytes
-
getLength
public int getLength() -
prepareByteArray
public void prepareByteArray()Something for Multithreaded AP (and EP in the future) to use. This formats an internal byte array with the serialized version of the NAR, in preparation for output in a separate step. I expect this method to be called in the Field Processor threads, rather than the NARFileWriter (or similar) thread. -
disposeByteArray
public void disposeByteArray() -
fieldExist
A proper implementation of fieldExist(). fieldExist() used to be implemented by returning (DCFieldContainer.getFieldValue(key) != null) which had a side effect of calling DCField.clone(). This method eliminates the clone().
-