edu.umd.cloud9.io.map
Class HashMapWritable<K extends Writable,V extends Writable>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by edu.umd.cloud9.io.map.HashMapWritable<K,V>
Type Parameters:
K - type of the key
V - type of the value
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>, Writable

public class HashMapWritable<K extends Writable,V extends Writable>
extends HashMap<K,V>
implements Writable

Writable extension of a Java HashMap. This generic class supports the use of any type as either key or value. For a feature vector, HMapKIW, HMapKFW, and a family of related classes provides a more efficient implementation.

There are a number of key differences between this class and Hadoop's MapWritable:

Author:
Jimmy Lin, Tamer Elsayed
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
HashMapWritable()
          Creates a HashMapWritable object.
HashMapWritable(HashMap<K,V> map)
          Creates a HashMapWritable object from a regular HashMap.
 
Method Summary
 void readFields(DataInput in)
          Deserializes the array.
 void write(DataOutput out)
          Serializes this array.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, 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
 

Constructor Detail

HashMapWritable

public HashMapWritable()
Creates a HashMapWritable object.


HashMapWritable

public HashMapWritable(HashMap<K,V> map)
Creates a HashMapWritable object from a regular HashMap.

Method Detail

readFields

public void readFields(DataInput in)
                throws IOException
Deserializes the array.

Specified by:
readFields in interface Writable
Parameters:
in - source for raw byte representation
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Serializes this array.

Specified by:
write in interface Writable
Parameters:
out - where to write the raw byte representation
Throws:
IOException