Class ListField

java.lang.Object
com.nt.udc.ndk.node.DCField
com.nt.udc.ndk.node.ListField
All Implemented Interfaces:
Serializable, Cloneable

public class ListField extends DCField
See Also:
  • Field Details

  • Constructor Details

    • ListField

      public ListField()
    • ListField

      public ListField(FieldKey key, byte[] val)
    • ListField

      public ListField(FieldKey key)
    • ListField

      @Deprecated public ListField(String id, byte[] val)
      Deprecated.
    • ListField

      @Deprecated public ListField(int id, Collection fields)
      Deprecated.
    • ListField

      @Deprecated public ListField(int id, byte[] val)
      Deprecated.
  • Method Details

    • addField

      public void addField(DCField field)
    • removeField

      public void removeField(DCField field)
    • removeField

      public void removeField(String key)
    • removeField

      public void removeField(int index)
    • setValue

      public void setValue(byte[] newVal) throws NDKException
      Description copied from class: DCField
      Sets the value of this DCField to what is contained in valueBytes

      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 class DCField
      Throws:
      NDKException
    • addFields

      public void addFields(Collection fieldList)
    • updateBytes

      public void updateBytes()
    • getType

      public int getType()
      Overrides:
      getType in class DCField
      Returns:
      the type for this DCField object
    • getBytesValue

      public byte[] getBytesValue() throws ClassCastException
      Overrides:
      getBytesValue in class DCField
      Returns:
      a byte array containing the value of this DCField
      Throws:
      ClassCastException
    • getStringValue

      public String getStringValue()
      Overrides:
      getStringValue in class DCField
    • toString

      public String toString()
      Overrides:
      toString in class DCField
    • size

      public int size()
    • setValue

      public void setValue(Collection fields)
    • lastField

      public DCField lastField()
    • firstField

      public DCField firstField()
    • getField

      public DCField getField(int index)
      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()
      Overrides:
      isEmpty in class DCField
    • appendList

      public void appendList(ListField list)
    • iterator

      public Iterator iterator()
    • getLength

      public int getLength()
      Overrides:
      getLength in class DCField
      Returns:
      the length of this DCField's byte array
    • getList

      public List 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