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 TypeMethodDescriptionvoidvoidaddFields(Collection fieldList) voidappendList(ListField list) voidclear()byte[]getField(int index) Returns the field at the specified position in this list.intgetList()Return the fields in the ListField as a List.intgetType()booleanisEmpty()iterator()voidremoveField(int index) voidremoveField(DCField field) voidremoveField(String key) voidsetValue(byte[] newVal) Sets the value of this DCField to what is contained invalueBytesvoidsetValue(Collection fields) intsize()toString()voidMethods 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:DCFieldSets the value of this DCField to what is contained invalueBytesNOTE: 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:
setValuein classDCField- Throws:
NDKException
-
addFields
-
updateBytes
public void updateBytes() -
getType
public int getType() -
getBytesValue
- Overrides:
getBytesValuein classDCField- Returns:
- a byte array containing the value of this DCField
- Throws:
ClassCastException
-
getStringValue
- Overrides:
getStringValuein 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
-