org.apache.hadoop.io
Class MapWritable

java.lang.Object
  extended by org.apache.hadoop.io.AbstractMapWritable
      extended by org.apache.hadoop.io.MapWritable
All Implemented Interfaces:
java.util.Map<Writable,Writable>, Configurable, Writable

public class MapWritable
extends AbstractMapWritable
implements java.util.Map<Writable,Writable>

A Writable Map.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
MapWritable()
          Default constructor.
MapWritable(MapWritable other)
          Copy constructor.
 
Method Summary
 void clear()
          
 boolean containsKey(java.lang.Object key)
          
 boolean containsValue(java.lang.Object value)
          
 java.util.Set<java.util.Map.Entry<Writable,Writable>> entrySet()
          
 Writable get(java.lang.Object key)
          
 boolean isEmpty()
          
 java.util.Set<Writable> keySet()
          
 Writable put(Writable key, Writable value)
          
 void putAll(java.util.Map<? extends Writable,? extends Writable> t)
          
 void readFields(java.io.DataInput in)
          Deserialize the fields of this object from in.
 Writable remove(java.lang.Object key)
          
 int size()
          
 java.util.Collection<Writable> values()
          
 void write(java.io.DataOutput out)
          Serialize the fields of this object to out.
 
Methods inherited from class org.apache.hadoop.io.AbstractMapWritable
addToMap, copy, getClass, getConf, getId, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

MapWritable

public MapWritable()
Default constructor.


MapWritable

public MapWritable(MapWritable other)
Copy constructor.

Parameters:
other - the map to copy from
Method Detail

clear

public void clear()

Specified by:
clear in interface java.util.Map<Writable,Writable>

containsKey

public boolean containsKey(java.lang.Object key)

Specified by:
containsKey in interface java.util.Map<Writable,Writable>

containsValue

public boolean containsValue(java.lang.Object value)

Specified by:
containsValue in interface java.util.Map<Writable,Writable>

entrySet

public java.util.Set<java.util.Map.Entry<Writable,Writable>> entrySet()

Specified by:
entrySet in interface java.util.Map<Writable,Writable>

get

public Writable get(java.lang.Object key)

Specified by:
get in interface java.util.Map<Writable,Writable>

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface java.util.Map<Writable,Writable>

keySet

public java.util.Set<Writable> keySet()

Specified by:
keySet in interface java.util.Map<Writable,Writable>

put

public Writable put(Writable key,
                    Writable value)

Specified by:
put in interface java.util.Map<Writable,Writable>

putAll

public void putAll(java.util.Map<? extends Writable,? extends Writable> t)

Specified by:
putAll in interface java.util.Map<Writable,Writable>

remove

public Writable remove(java.lang.Object key)

Specified by:
remove in interface java.util.Map<Writable,Writable>

size

public int size()

Specified by:
size in interface java.util.Map<Writable,Writable>

values

public java.util.Collection<Writable> values()

Specified by:
values in interface java.util.Map<Writable,Writable>

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Serialize the fields of this object to out.

Specified by:
write in interface Writable
Overrides:
write in class AbstractMapWritable
Parameters:
out - DataOuput to serialize this object into.
Throws:
java.io.IOException

readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException
Deserialize the fields of this object from in.

For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface Writable
Overrides:
readFields in class AbstractMapWritable
Parameters:
in - DataInput to deseriablize this object from.
Throws:
java.io.IOException


Copyright © 2009 The Apache Software Foundation