jp.develop.common.util.amf.encoder
Class DictionaryEncoder

java.lang.Object
  extended by jp.develop.common.util.amf.encoder.DictionaryEncoder
All Implemented Interfaces:
IEncoder<Map<Object,Object>>, IEncoder.IDictionaryEncoder<Map<Object,Object>>

public class DictionaryEncoder
extends Object
implements IEncoder<Map<Object,Object>>, IEncoder.IDictionaryEncoder<Map<Object,Object>>

Implementation of IEncoder.IDictionaryEncoder for Map.

Author:
Waki Takeya
See Also:
IEncoder, IEncoder.IDictionaryEncoder

Nested Class Summary
 
Nested classes/interfaces inherited from interface jp.develop.common.util.amf.encoder.IEncoder
IEncoder.IArrayEncoder<T>, IEncoder.IDictionaryEncoder<T>, IEncoder.IObjectEncoder<T>
 
Constructor Summary
DictionaryEncoder()
           
 
Method Summary
 void encode(AmfEncoder encoder, Map<Object,Object> map)
          Encode to Action Message Format(AMF).
 int getDictionarySize(Map<Object,Object> map)
          Get the size of dictionary.
 Set<Map.Entry<Object,Object>> getEntrySet(Map<Object,Object> map)
          Get Entry Set.
 boolean isWeakKey(Map<Object,Object> map)
          Is this weak key?
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DictionaryEncoder

public DictionaryEncoder()
Method Detail

encode

public void encode(AmfEncoder encoder,
                   Map<Object,Object> map)
            throws IOException
Encode to Action Message Format(AMF).

Specified by:
encode in interface IEncoder<Map<Object,Object>>
Parameters:
encoder - AMF encoder.
map - Object to be encoded.
Throws:
IOException - I/O Exception.

getDictionarySize

public int getDictionarySize(Map<Object,Object> map)
Get the size of dictionary.

Specified by:
getDictionarySize in interface IEncoder.IDictionaryEncoder<Map<Object,Object>>
Parameters:
map - Dictionary to be encoded.
Returns:
The size of dictionary.

isWeakKey

public boolean isWeakKey(Map<Object,Object> map)
Is this weak key?

Specified by:
isWeakKey in interface IEncoder.IDictionaryEncoder<Map<Object,Object>>
Parameters:
map - Dictionary to be encoded.
Returns:
true, if it is weak key.

getEntrySet

public Set<Map.Entry<Object,Object>> getEntrySet(Map<Object,Object> map)
Get Entry Set.

Specified by:
getEntrySet in interface IEncoder.IDictionaryEncoder<Map<Object,Object>>
Parameters:
map - Dictionary to be encoded.
Returns:
Entry set of specified dictionary.