Package com.nt.udc.ndk.node
Class ListField
java.lang.Object
com.nt.udc.ndk.node.DCField
com.nt.udc.ndk.node.ListField
- All Implemented Interfaces:
Serializable
,Cloneable
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addFields
(Collection fieldList) void
appendList
(ListField list) void
clear()
byte[]
getField
(int index) Returns the field at the specified position in this list.int
getList()
Return the fields in the ListField as a List.int
getType()
boolean
isEmpty()
iterator()
void
removeField
(int index) void
removeField
(DCField field) void
removeField
(String key) void
setValue
(byte[] newVal) Sets the value of this DCField to what is contained invalueBytes
void
setValue
(Collection fields) int
size()
toString()
void
Methods inherited from class com.nt.udc.ndk.node.DCField
clone, create, dup, equals, equalsValue, getBytes, getByteValue, getDateValue, getDCField, getDCField, getDCField, getDoubleValue, getFloatValue, getID, getIntValue, getKey, getLongValue, getShortValue, getStaticAttrLength, init, init, init, isVarLength, makeAttrfromBytes, makeAttrfromBytes, makeAttrfromBytes, makeAttrfromBytes, makeAttrfromStream, readValueFromStream, setID, setID, setKey, setType, writeValueToStream
-
Field Details
-
LENGTH
public static final int LENGTH- See Also:
-
-
Constructor Details
-
ListField
public ListField() -
ListField
-
ListField
-
ListField
Deprecated. -
ListField
Deprecated. -
ListField
Deprecated.
-
-
Method Details
-
addField
-
removeField
-
removeField
-
removeField
public void removeField(int index) -
setValue
Description copied from class:DCField
Sets the value of this DCField to what is contained invalueBytes
NOTE: Caveat Machinator (Engineer beware)
At this time, there is no validation of the byte array passed in to this method. The developer should ensure that the bytes used to create this DCField object are appropriate for the specific data type. For example, a byte[] consisting of 7 bytes should not be used to create an IntField object.- Overrides:
setValue
in classDCField
- Throws:
NDKException
-
addFields
-
updateBytes
public void updateBytes() -
getType
public int getType() -
getBytesValue
- Overrides:
getBytesValue
in classDCField
- Returns:
- a byte array containing the value of this DCField
- Throws:
ClassCastException
-
getStringValue
- Overrides:
getStringValue
in classDCField
-
toString
-
size
public int size() -
setValue
-
lastField
-
firstField
-
getField
Returns the field at the specified position in this list.Performance Note: Finding the element at a given position performs a linear search through the list. Thus, this method should be avoided when possible. Stepping through all elements of the list should be done with the iterator instead.- Parameters:
index
- index of element to return.- Returns:
- the field at the specified position in this list.
-
clear
public void clear() -
isEmpty
public boolean isEmpty() -
appendList
-
iterator
-
getLength
public int getLength() -
getList
Return the fields in the ListField as a List. This list is a copy of the elements - modifications to the list are not allowed.- Returns:
- an unmodifiable List containing DCField objects
-