Class NCMap
- java.lang.Object
-
- com.adobe.versioncue.nativecomm.msg.NCType
-
- com.adobe.versioncue.nativecomm.msg.NCMap
-
- All Implemented Interfaces:
INCExternalizable
public final class NCMap extends NCType
A Dictionary mappingNCTypekeys toNCTypeobjects. Note that this class is **NOT** Thread-safe in its current form.
-
-
Field Summary
-
Fields inherited from class com.adobe.versioncue.nativecomm.msg.NCType
TYPE_BOOLEAN, TYPE_BYTEBUFFER, TYPE_DATE, TYPE_DOUBLE, TYPE_INTEGER, TYPE_LIST, TYPE_LONG, TYPE_MAP, TYPE_NULL, TYPE_STRING
-
-
Constructor Summary
Constructors Constructor Description NCMap()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NCMapclear()Removes all entries from this NCMapobject.booleancontainsKey(NCType key)Returns true if this NCMap contains a mapping for the specified key.booleancontainsKey(java.lang.String key)Returns true if this NCMap contains a mapping for the specified key.java.util.Iterator<java.util.Map.Entry<NCType,NCType>>entries()Returns an iterator over the mappings in this IDicitonary.java.util.Set<java.util.Map.Entry<NCType,NCType>>entrySet()Returns a set of Map.Entry objects.booleanequals(java.lang.Object other)Force subclasses to implement.NCTypeget(NCType key)Returns the NCType object associated with the specified key.NCTypeget(java.lang.String key)Returns the NCType object associated with the specified key.booleangetBool(java.lang.String key)Returns the boolean value associated with the specified key.byte[]getByteArray(java.lang.String key)Returns the byte[] value associated with the specified key.java.nio.ByteBuffergetBytes(java.lang.String key)Returns the ByteBuffer value associated with the specified key.java.util.DategetDate(java.lang.String key)Returns the date value associated with the specified key.doublegetDouble(java.lang.String key)Returns the double value associated with the specified key.intgetInt(java.lang.String key)Returns the int value associated with the specified key.NCListgetList(java.lang.String key)Returns the NCList value associated with the specified key.longgetLong(java.lang.String key)Returns the long value associated with the specified key.NCMapgetMap(java.lang.String key)Returns the NCMap value associated with the specified key.java.lang.StringgetString(java.lang.String key)Returns the String value associated with the specified key.intgetType()Returns the type of thisNCTypeobject.inthashCode()Force subclasses to implement.booleanisEmtpy()Returns true if the NCMap is emptyNCMapput(NCType key, NCType value)Add a key/value pair to this map.NCMapput(java.lang.String key, boolean value)Add a key/value pair to this map.NCMapput(java.lang.String key, byte[] value)Add a key/value pair to this map.NCMapput(java.lang.String key, double value)Add a key/value pair to this map.NCMapput(java.lang.String key, int value)Add a key/value pair to this map.NCMapput(java.lang.String key, long value)Add a key/value pair to this map.NCMapput(java.lang.String key, INCExternalizable value)Add a key/value pair to this map.NCMapput(java.lang.String key, NCType value)Add a key/value pair to this map.NCMapput(java.lang.String key, java.lang.String value)Add a key/value pair to this map.NCMapput(java.lang.String key, java.nio.ByteBuffer value)Add a key/value pair to this map.NCMapput(java.lang.String key, java.util.Date value)Add a key/value pair to this map.NCTyperemove(NCType key)Removes the mapping for this key from thisNCMapif it is present.NCTyperemove(java.lang.String key)Removes the mapping for this key from thisNCMapif it is present.intsize()Returns the number of entries in the NCMap.java.lang.StringtoString()Force subclasses to implement.-
Methods inherited from class com.adobe.versioncue.nativecomm.msg.NCType
externalize
-
-
-
-
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 java.util.Iterator<java.util.Map.Entry<NCType,NCType>> entries()
Returns an iterator over the mappings in this IDicitonary. The elements are returned in no particular order.- Returns:
- a
Iteratorcontainingjava.util.Map.EntryObjects
-
entrySet
public java.util.Set<java.util.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(java.lang.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 keyvalue- the value- Returns:
- the NCMap
-
put
public NCMap put(java.lang.String key, NCType value)
Add a key/value pair to this map.- Parameters:
key- the keyvalue- the value- Returns:
- the NCMap
-
put
public NCMap put(java.lang.String key, INCExternalizable value)
Add a key/value pair to this map.- Parameters:
key- the keyvalue- the value- Returns:
- the NCMap
-
put
public NCMap put(java.lang.String key, java.lang.String value)
Add a key/value pair to this map.- Parameters:
key- the keyvalue- the value- Returns:
- the NCMap
-
put
public NCMap put(java.lang.String key, boolean value)
Add a key/value pair to this map.- Parameters:
key- the keyvalue- the value- Returns:
- the NCMap
-
put
public NCMap put(java.lang.String key, int value)
Add a key/value pair to this map.- Parameters:
key- the keyvalue- the value- Returns:
- the NCMap
-
put
public NCMap put(java.lang.String key, long value)
Add a key/value pair to this map.- Parameters:
key- the keyvalue- the value- Returns:
- the NCMap
-
put
public NCMap put(java.lang.String key, double value)
Add a key/value pair to this map.- Parameters:
key- the keyvalue- the value- Returns:
- the NCMap
-
put
public NCMap put(java.lang.String key, java.util.Date value)
Add a key/value pair to this map.- Parameters:
key- the keyvalue- the value- Returns:
- the NCMap
-
put
public NCMap put(java.lang.String key, byte[] value)
Add a key/value pair to this map.- Parameters:
key- the keyvalue- the value- Returns:
- the NCMap
-
put
public NCMap put(java.lang.String key, java.nio.ByteBuffer value)
Add a key/value pair to this map.- Parameters:
key- the keyvalue- 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(java.lang.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 java.lang.String getString(java.lang.String key) throws BadMessageExceptionReturns 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(java.lang.String key) throws BadMessageExceptionReturns 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(java.lang.String key) throws BadMessageExceptionReturns 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(java.lang.String key) throws BadMessageExceptionReturns 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(java.lang.String key) throws BadMessageExceptionReturns 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 java.util.Date getDate(java.lang.String key) throws BadMessageExceptionReturns 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(java.lang.String key) throws BadMessageExceptionReturns 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 java.nio.ByteBuffer getBytes(java.lang.String key) throws BadMessageExceptionReturns 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(java.lang.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(java.lang.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 thisNCMapif it is present.- Parameters:
key- key whose associatedNCTypeobject is to be removed- Returns:
- previous
NCTypeobject associated with the specified key, or null if there was no mapping for the key
-
remove
public NCType remove(java.lang.String key)
Removes the mapping for this key from thisNCMapif it is present.- Parameters:
key- key whose associatedNCTypeobject is to be removed- Returns:
- previous
NCTypeobject associated with the specified key, or null if there was no mapping for the key
-
clear
public NCMap clear()
Removes all entries from this NCMapobject.- Returns:
- the NCMap
-
getType
public int getType()
Description copied from class:NCTypeReturns the type of thisNCTypeobject.
-
equals
public boolean equals(java.lang.Object other)
Description copied from class:NCTypeForce subclasses to implement.
-
toString
public java.lang.String toString()
Description copied from class:NCTypeForce subclasses to implement.
-
-