Class NCList

  • All Implemented Interfaces:
    INCExternalizable, java.lang.Iterable<NCType>

    public final class NCList
    extends NCType
    implements java.lang.Iterable<NCType>
    List of NCType objects. Note that this class is **NOT** Thread-safe in its current form.
    • Constructor Summary

      Constructors 
      Constructor Description
      NCList()
      Constructs a new NCList object.
      NCList​(int initialCapacity)
      Constructs a new NCList object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      NCList add​(boolean value)
      Appends a value to the NCList.
      NCList add​(byte[] value)
      Appends a value to the NCList.
      NCList add​(double value)
      Appends a value to the NCList.
      NCList add​(int value)
      Appends a value to the NCList.
      NCList add​(long value)
      Appends a value to the NCList.
      NCList add​(INCExternalizable value)
      Appends a value to the NCList.
      NCList add​(NCType value)
      Appends the specified NCType to the end of this NCList.
      NCList add​(java.lang.String value)
      Appends a value to the NCList.
      NCList add​(java.nio.ByteBuffer value)
      Appends a value to the NCList.
      NCList add​(java.util.Date value)
      Appends a value to the NCList.
      NCList clear()
      Removes all Values from this NCList.
      boolean contains​(NCType val)
      Returns true if this Array contains the specified NCType.
      boolean equals​(java.lang.Object other)
      Force subclasses to implement.
      NCType[] get()
      Returns the elements of this NCList instance as NCType[].
      NCType get​(int index)
      Returns the NCType located at the specified index inside this NCList.
      boolean getBool​(int index)
      Returns the boolean value at the specified index.
      byte[] getByteArray​(int index)
      Returns the byte[] value at the specified index.
      java.nio.ByteBuffer getBytes​(int index)
      Returns the ByteBuffer value at the specified index.
      java.util.Date getDate​(int index)
      Returns the date value at the specified index.
      double getDouble​(int index)
      Returns the double value at the specified index.
      int getInt​(int index)
      Returns the int value at the specified index.
      NCList getList​(int index)
      Returns the NCList value at the specified index.
      long getLong​(int index)
      Returns the long value at the specified index.
      NCMap getMap​(int index)
      Returns the NCMap value at the specified index.
      java.lang.String getString​(int index)
      Returns the String value at the specified index.
      int getType()
      Returns the type of this NCType object.
      int hashCode()
      Force subclasses to implement.
      boolean isEmtpy()
      Returns true if this NCList object contains no items.
      java.util.Iterator<NCType> iterator()  
      NCType remove​(int index)
      Removes the NCType at the specified position in this NCList and returns it.
      NCList set​(NCType value, int index)
      Replaces the NCType object at the specified index inside the NCList.
      int size()
      Returns the size of this NCList object.
      java.lang.String toString()
      Force subclasses to implement.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • NCList

        public NCList()
        Constructs a new NCList object.
      • NCList

        public NCList​(int initialCapacity)
        Constructs a new NCList object.
        Parameters:
        initialCapacity - - initial capacity of the created Array object
    • Method Detail

      • size

        public int size()
        Returns the size of this NCList object.
        Returns:
        the size of this NCList object
      • isEmtpy

        public boolean isEmtpy()
        Returns true if this NCList object contains no items.
        Returns:
        true if this NCList object contains no items
      • get

        public NCType get​(int index)
        Returns the NCType located at the specified index inside this NCList.
        Parameters:
        index - the index of the NCType to return
        Returns:
        the NCType located at the specified index inside this NCList
      • get

        public NCType[] get()
        Returns the elements of this NCList instance as NCType[].
        Returns:
        elements of this NCList instance as NCType[].
      • contains

        public boolean contains​(NCType val)
        Returns true if this Array contains the specified NCType.
        Parameters:
        val - - NCType to look for
        Returns:
        true if this Array contains the specified NCType
      • add

        public NCList add​(NCType value)
        Appends the specified NCType to the end of this NCList.
        Parameters:
        value - - NCType to be added
        Returns:
        the NCList
      • add

        public NCList add​(INCExternalizable value)
        Appends a value to the NCList.
        Parameters:
        value - the value
        Returns:
        the NCList
      • add

        public NCList add​(java.lang.String value)
        Appends a value to the NCList.
        Parameters:
        value - the value
        Returns:
        the NCList
      • add

        public NCList add​(boolean value)
        Appends a value to the NCList.
        Parameters:
        value - the value
        Returns:
        the NCList
      • add

        public NCList add​(int value)
        Appends a value to the NCList.
        Parameters:
        value - the value
        Returns:
        the NCList
      • add

        public NCList add​(long value)
        Appends a value to the NCList.
        Parameters:
        value - the value
        Returns:
        the NCList
      • add

        public NCList add​(double value)
        Appends a value to the NCList.
        Parameters:
        value - the value
        Returns:
        the NCList
      • add

        public NCList add​(java.util.Date value)
        Appends a value to the NCList.
        Parameters:
        value - the value
        Returns:
        the NCList
      • add

        public NCList add​(byte[] value)
        Appends a value to the NCList.
        Parameters:
        value - the value
        Returns:
        the NCList
      • add

        public NCList add​(java.nio.ByteBuffer value)
        Appends a value to the NCList.
        Parameters:
        value - the value
        Returns:
        the NCList
      • getString

        public java.lang.String getString​(int index)
                                   throws BadMessageException
        Returns the String value at the specified index.
        Parameters:
        index - the index
        Returns:
        String value
        Throws:
        BadMessageException - if the requested value is of a bad type
      • getBool

        public boolean getBool​(int index)
                        throws BadMessageException
        Returns the boolean value at the specified index.
        Parameters:
        index - the index
        Returns:
        boolean value
        Throws:
        BadMessageException - if the requested value is of a bad type
      • getDouble

        public double getDouble​(int index)
                         throws BadMessageException
        Returns the double value at the specified index.
        Parameters:
        index - the index
        Returns:
        double value
        Throws:
        BadMessageException - if the requested value is of a bad type
      • getInt

        public int getInt​(int index)
                   throws BadMessageException
        Returns the int value at the specified index.
        Parameters:
        index - the index
        Returns:
        int value
        Throws:
        BadMessageException - if the requested value is of a bad type
      • getLong

        public long getLong​(int index)
                     throws BadMessageException
        Returns the long value at the specified index.
        Parameters:
        index - the index
        Returns:
        long value
        Throws:
        BadMessageException - if the requested value is of a bad type
      • getDate

        public java.util.Date getDate​(int index)
                               throws BadMessageException
        Returns the date value at the specified index.
        Parameters:
        index - the index
        Returns:
        date value
        Throws:
        BadMessageException - if the requested value is of a bad type
      • getByteArray

        public byte[] getByteArray​(int index)
                            throws BadMessageException
        Returns the byte[] value at the specified index.
        Parameters:
        index - the index
        Returns:
        byte[] value
        Throws:
        BadMessageException - if the requested value is of a bad type
      • getBytes

        public java.nio.ByteBuffer getBytes​(int index)
                                     throws BadMessageException
        Returns the ByteBuffer value at the specified index.
        Parameters:
        index - the index
        Returns:
        ByteBuffer value
        Throws:
        BadMessageException - if the requested value is of a bad type
      • getList

        public NCList getList​(int index)
                       throws BadMessageException
        Returns the NCList value at the specified index.
        Parameters:
        index - the index
        Returns:
        NCList value
        Throws:
        BadMessageException - if the requested value is of a bad type
      • getMap

        public NCMap getMap​(int index)
                     throws BadMessageException
        Returns the NCMap value at the specified index.
        Parameters:
        index - the index
        Returns:
        NCMap value
        Throws:
        BadMessageException - if the requested value is of a bad type
      • set

        public NCList set​(NCType value,
                          int index)
        Replaces the NCType object at the specified index inside the NCList.
        Parameters:
        index - of element to replace.
        value - - NCType to be stored at the specified position.
        Returns:
        the NCList
      • clear

        public NCList clear()
        Removes all Values from this NCList.
        Returns:
        the NCList
      • remove

        public NCType remove​(int index)
        Removes the NCType at the specified position in this NCList and returns it. Shifts any subsequent values to the left (subtracts one from their indices).
        Parameters:
        index - the index of the element to removed
        Returns:
        the removed NCType object
      • iterator

        public java.util.Iterator<NCType> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<NCType>
        See Also:
        Iterable.iterator()
      • getType

        public int getType()
        Description copied from class: NCType
        Returns the type of this NCType object.
        Specified by:
        getType in class NCType
        Returns:
        the type of this NCType
      • hashCode

        public int hashCode()
        Description copied from class: NCType
        Force subclasses to implement.
        Specified by:
        hashCode in class NCType
        See Also:
        Object.hashCode()
      • equals

        public boolean equals​(java.lang.Object other)
        Description copied from class: NCType
        Force subclasses to implement.
        Specified by:
        equals in class NCType
        See Also:
        Object.equals(java.lang.Object)
      • toString

        public java.lang.String toString()
        Description copied from class: NCType
        Force subclasses to implement.
        Specified by:
        toString in class NCType
        See Also:
        Object.toString()