Class NCMap

  • All Implemented Interfaces:
    INCExternalizable

    public final class NCMap
    extends NCType
    A Dictionary mapping NCType keys to NCType objects. Note that this class is **NOT** Thread-safe in its current form.
    • Constructor Detail

      • NCMap

        public NCMap()
        Default constructor
    • Method Detail

      • size

        public int size()
        Returns the number of entries in the NCMap.
        Returns:
        number of entries in the NCMap.
      • isEmtpy

        public boolean isEmtpy()
        Returns true if the NCMap is empty
        Returns:
        true if the NCMap is empty
      • entries

        public Iterator<Map.Entry<NCType,​NCType>> entries()
        Returns an iterator over the mappings in this IDicitonary. The elements are returned in no particular order.
        Returns:
        a Iterator containing java.util.Map.Entry Objects
      • entrySet

        public Set<Map.Entry<NCType,​NCType>> entrySet()
        Returns a set of Map.Entry objects.
        Returns:
        set of Map.Entry objects.
      • containsKey

        public boolean containsKey​(NCType key)
        Returns true if this NCMap contains a mapping for the specified key.
        Parameters:
        key - - key to check
        Returns:
        true if this NCMap contains a mapping for the specified key.
      • containsKey

        public boolean containsKey​(String key)
        Returns true if this NCMap contains a mapping for the specified key.
        Parameters:
        key - - key to check
        Returns:
        true if this NCMap contains a mapping for the specified key.
      • put

        public NCMap put​(NCType key,
                         NCType value)
        Add a key/value pair to this map.
        Parameters:
        key - the key
        value - the value
        Returns:
        the NCMap
      • put

        public NCMap put​(String key,
                         NCType value)
        Add a key/value pair to this map.
        Parameters:
        key - the key
        value - the value
        Returns:
        the NCMap
      • put

        public NCMap put​(String key,
                         INCExternalizable value)
        Add a key/value pair to this map.
        Parameters:
        key - the key
        value - the value
        Returns:
        the NCMap
      • put

        public NCMap put​(String key,
                         String value)
        Add a key/value pair to this map.
        Parameters:
        key - the key
        value - the value
        Returns:
        the NCMap
      • put

        public NCMap put​(String key,
                         boolean value)
        Add a key/value pair to this map.
        Parameters:
        key - the key
        value - the value
        Returns:
        the NCMap
      • put

        public NCMap put​(String key,
                         int value)
        Add a key/value pair to this map.
        Parameters:
        key - the key
        value - the value
        Returns:
        the NCMap
      • put

        public NCMap put​(String key,
                         long value)
        Add a key/value pair to this map.
        Parameters:
        key - the key
        value - the value
        Returns:
        the NCMap
      • put

        public NCMap put​(String key,
                         double value)
        Add a key/value pair to this map.
        Parameters:
        key - the key
        value - the value
        Returns:
        the NCMap
      • put

        public NCMap put​(String key,
                         Date value)
        Add a key/value pair to this map.
        Parameters:
        key - the key
        value - the value
        Returns:
        the NCMap
      • put

        public NCMap put​(String key,
                         byte[] value)
        Add a key/value pair to this map.
        Parameters:
        key - the key
        value - the value
        Returns:
        the NCMap
      • put

        public NCMap put​(String key,
                         ByteBuffer value)
        Add a key/value pair to this map.
        Parameters:
        key - the key
        value - the value
        Returns:
        the NCMap
      • get

        public NCType get​(NCType key)
        Returns the NCType object associated with the specified key. Returns null if the NCMap contains no entry for this key.
        Parameters:
        key - key to retrieve
        Returns:
        value associated with the specified key; null if the key has no value associated
      • get

        public NCType get​(String key)
        Returns the NCType object associated with the specified key. Returns null if the NCMap contains no entry for this key.
        Parameters:
        key - key to retrieve
        Returns:
        value associated with the specified key; null if the key has no value associated
      • getString

        public String getString​(String key)
                         throws BadMessageException
        Returns the String value associated with the specified key.
        Parameters:
        key - the key String
        Returns:
        String value
        Throws:
        BadMessageException - if the requested value is not present or of a bad type
      • getBool

        public boolean getBool​(String key)
                        throws BadMessageException
        Returns the boolean value associated with the specified key.
        Parameters:
        key - the key String
        Returns:
        boolean value
        Throws:
        BadMessageException - if the requested value is not present or of a bad type
      • getDouble

        public double getDouble​(String key)
                         throws BadMessageException
        Returns the double value associated with the specified key.
        Parameters:
        key - the key String
        Returns:
        double value
        Throws:
        BadMessageException - if the requested value is not present or of a bad type
      • getInt

        public int getInt​(String key)
                   throws BadMessageException
        Returns the int value associated with the specified key.
        Parameters:
        key - the key String
        Returns:
        int value
        Throws:
        BadMessageException - if the requested value is not present or of a bad type
      • getLong

        public long getLong​(String key)
                     throws BadMessageException
        Returns the long value associated with the specified key.
        Parameters:
        key - the key String
        Returns:
        long value
        Throws:
        BadMessageException - if the requested value is not present or of a bad type
      • getDate

        public Date getDate​(String key)
                     throws BadMessageException
        Returns the date value associated with the specified key.
        Parameters:
        key - the key String
        Returns:
        date value
        Throws:
        BadMessageException - if the requested value is not present or of a bad type
      • getByteArray

        public byte[] getByteArray​(String key)
                            throws BadMessageException
        Returns the byte[] value associated with the specified key.
        Parameters:
        key - the key String
        Returns:
        byte[] value
        Throws:
        BadMessageException - if the requested value is not present or of a bad type
      • getBytes

        public ByteBuffer getBytes​(String key)
                            throws BadMessageException
        Returns the ByteBuffer value associated with the specified key.
        Parameters:
        key - the key String
        Returns:
        ByteBuffer value
        Throws:
        BadMessageException - if the requested value is not present or of a bad type
      • getList

        public NCList getList​(String key)
                       throws BadMessageException
        Returns the NCList value associated with the specified key.
        Parameters:
        key - the key String
        Returns:
        NCList value
        Throws:
        BadMessageException - if the requested value is not present or of a bad type
      • getMap

        public NCMap getMap​(String key)
                     throws BadMessageException
        Returns the NCMap value associated with the specified key.
        Parameters:
        key - the key String
        Returns:
        NCMap value
        Throws:
        BadMessageException - if the associated value is not present or not of the correct type
      • remove

        public NCType remove​(NCType key)
        Removes the mapping for this key from this NCMap if it is present.
        Parameters:
        key - key whose associated NCType object is to be removed
        Returns:
        previous NCType object associated with the specified key, or null if there was no mapping for the key
      • remove

        public NCType remove​(String key)
        Removes the mapping for this key from this NCMap if it is present.
        Parameters:
        key - key whose associated NCType object is to be removed
        Returns:
        previous NCType object associated with the specified key, or null if there was no mapping for the key
      • clear

        public NCMap clear()
        Removes all entries from this NCMap object.
        Returns:
        the NCMap
      • 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