com.adobe.flashaccess.sdk.util
Class ApplicationProperties

java.lang.Object
  extended by java.util.AbstractMap
      extended by java.util.HashMap
          extended by com.adobe.flashaccess.sdk.util.ApplicationProperties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map

public class ApplicationProperties
extends java.util.HashMap

This class contains application-defined properties. Each key can be mapped to a list of byte[] values; however, the order of the values may not be preserved. This class also contains convenience methods for putting/getting String objects (uses String.getBytes("UTF-8") to convert from String to byte[]). Keys cannot be null.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry, java.util.AbstractMap.SimpleImmutableEntry
 
Method Summary
 void add(java.lang.String key, byte[] val)
          Adds the specified value to the list of values associated with the key.
 void addUTF8String(java.lang.String key, java.lang.String val)
          Converts the value to a byte[], then performs the same operation as ApplicationProperties.add(String, byte[]).
 java.util.Collection get(java.lang.String key)
          See HashMap.get.
 java.util.Collection getAsUTF8Strings(java.lang.String key)
          This method performs the same operation as ApplicationProperties.getSingleValueAsUTF8String(String), but converts the result to a list of String objects.
 byte[] getSingleValue(java.lang.String key)
          Retrieves the value of a key with only one value.
 java.lang.String getSingleValueAsUTF8String(java.lang.String key)
          This method performs the same operation as ApplicationProperties.getSingleValue(String), but converts the result to a String.
 java.util.Collection put(java.lang.String key, java.util.Collection value)
          This method performs the same operation as HashMap.put, except that it does not allow null keys.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Method Detail

get

public java.util.Collection get(java.lang.String key)
See HashMap.get.

Parameters:
key - The key.
Returns:
The value assigned to the key as Collection<byte[]>

put

public java.util.Collection put(java.lang.String key,
                                java.util.Collection value)
This method performs the same operation as HashMap.put, except that it does not allow null keys. The order of the values may not be preserved.

Specified by:
put in interface java.util.Map
Overrides:
put in class java.util.HashMap
Parameters:
key - The key.
value - The value assigned to the key as Collection<byte[]>. Null values in the list will be ignored.
Returns:
Previous value associated with specified key as Collection<byte[]>, or null if there was no mapping for key.

add

public void add(java.lang.String key,
                byte[] val)
Adds the specified value to the list of values associated with the key. This method does not check whether the value is already present. To replace all values associated with the key, use ApplicationProperties.put(String, Collection).

Parameters:
key - The key to which to assign the value.
val - The value to assign to the specified key.

addUTF8String

public void addUTF8String(java.lang.String key,
                          java.lang.String val)
Converts the value to a byte[], then performs the same operation as ApplicationProperties.add(String, byte[]).

Parameters:
key - The key to which to assign the value.
val - The value to assign to the specified key.

getSingleValue

public byte[] getSingleValue(java.lang.String key)
Retrieves the value of a key with only one value. If the key has multiple values, one value will be returned (it is not specified which value will be returned).

Parameters:
key - The key for which to retrieve values.
Returns:
A value in the list of values for the key. This method returns null if the key is not present.

getSingleValueAsUTF8String

public java.lang.String getSingleValueAsUTF8String(java.lang.String key)
This method performs the same operation as ApplicationProperties.getSingleValue(String), but converts the result to a String.

Parameters:
key - The key for which to retrieve values.
Returns:
A value in the list of values for the key. This method returns null if the key is not present.

getAsUTF8Strings

public java.util.Collection getAsUTF8Strings(java.lang.String key)
This method performs the same operation as ApplicationProperties.getSingleValueAsUTF8String(String), but converts the result to a list of String objects.

Parameters:
key - The key for which to retrieve values.
Returns:
All values for the key as Collection<String>.


[an error occurred while processing this directive] [an error occurred while processing this directive]