## org.apache.hadoop.io
Class MapWritable

    java.lang.Object
      org.apache.hadoop.io.AbstractMapWritable
          org.apache.hadoop.io.MapWritable

All Implemented Interfaces:
  Map<Writable,Writable>, Configurable, Writable

    public class MapWritable

extends AbstractMapWritable
implements Map<Writable,Writable>

A Writable Map.

Nested Class Summary

Nested classes/interfaces inherited from interface java.util.Map
`Map.Entry<K,V>`

Constructor Summary
`MapWritable()` Default constructor.
`MapWritable(MapWritable other)` Copy constructor.

Method Summary
`void` `clear()`
`boolean` `containsKey(Object key)`
`boolean` `containsValue(Object value)`
`Set<Map.Entry<Writable,Writable>>` `entrySet()`
`Writable` `get(Object key)`
`boolean` `isEmpty()`
`Set<Writable>` `keySet()`
`Writable` `put(Writable key, Writable value)`
`void` `putAll(Map<? extends Writable,? extends Writable> t)`
`void` `readFields(DataInput in)` Deserialize the fields of this object from `in`.
`Writable` `remove(Object key)`
`int` `size()`
`Collection<Writable>` `values()`
`void` `write(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 `Map<Writable,Writable>`

### containsKey

    public boolean containsKey(Object key)

  Specified by:
    `containsKey` in interface `Map<Writable,Writable>`

### containsValue

    public boolean containsValue(Object value)

  Specified by:
    `containsValue` in interface `Map<Writable,Writable>`

### entrySet

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

  Specified by:
    `entrySet` in interface `Map<Writable,Writable>`

### get

    public Writable get(Object key)

  Specified by:
    `get` in interface `Map<Writable,Writable>`

### isEmpty

    public boolean isEmpty()

  Specified by:
    `isEmpty` in interface `Map<Writable,Writable>`

### keySet

    public Set<Writable> keySet()

  Specified by:
    `keySet` in interface `Map<Writable,Writable>`

### put

    public Writable put(Writable key,
                        Writable value)

  Specified by:
    `put` in interface `Map<Writable,Writable>`

### putAll

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

  Specified by:
    `putAll` in interface `Map<Writable,Writable>`

### remove

    public Writable remove(Object key)

  Specified by:
    `remove` in interface `Map<Writable,Writable>`

### size

    public int size()

  Specified by:
    `size` in interface `Map<Writable,Writable>`

### values

    public Collection<Writable> values()

  Specified by:
    `values` in interface `Map<Writable,Writable>`

### write

    public void write(DataOutput out)
               throws 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:
    `IOException`

### readFields

    public void readFields(DataInput in)
                    throws 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:
    `IOException`

Copyright © 2009 The Apache Software Foundation