org.apache.hadoop.io
Class SortedMapWritable

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

@InterfaceAudience.Public
@InterfaceStability.Stable
public class SortedMapWritable
extends AbstractMapWritable
implements SortedMap<WritableComparable,Writable>

A Writable SortedMap.


Constructor Summary
SortedMapWritable()
          default constructor.
SortedMapWritable(SortedMapWritable other)
          Copy constructor.
 
Method Summary
 void clear()
           
 Comparator<? super WritableComparable> comparator()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<WritableComparable,Writable>> entrySet()
           
 WritableComparable firstKey()
           
 Writable get(Object key)
           
 SortedMap<WritableComparable,Writable> headMap(WritableComparable toKey)
           
 boolean isEmpty()
           
 Set<WritableComparable> keySet()
           
 WritableComparable lastKey()
           
 Writable put(WritableComparable key, Writable value)
           
 void putAll(Map<? extends WritableComparable,? extends Writable> t)
           
 void readFields(DataInput in)
          Deserialize the fields of this object from in.
 Writable remove(Object key)
           
 int size()
           
 SortedMap<WritableComparable,Writable> subMap(WritableComparable fromKey, WritableComparable toKey)
           
 SortedMap<WritableComparable,Writable> tailMap(WritableComparable fromKey)
           
 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

SortedMapWritable

public SortedMapWritable()
default constructor.


SortedMapWritable

public SortedMapWritable(SortedMapWritable other)
Copy constructor.

Parameters:
other - the map to copy from
Method Detail

comparator

public Comparator<? super WritableComparable> comparator()
Specified by:
comparator in interface SortedMap<WritableComparable,Writable>

firstKey

public WritableComparable firstKey()
Specified by:
firstKey in interface SortedMap<WritableComparable,Writable>

headMap

public SortedMap<WritableComparable,Writable> headMap(WritableComparable toKey)
Specified by:
headMap in interface SortedMap<WritableComparable,Writable>

lastKey

public WritableComparable lastKey()
Specified by:
lastKey in interface SortedMap<WritableComparable,Writable>

subMap

public SortedMap<WritableComparable,Writable> subMap(WritableComparable fromKey,
                                                     WritableComparable toKey)
Specified by:
subMap in interface SortedMap<WritableComparable,Writable>

tailMap

public SortedMap<WritableComparable,Writable> tailMap(WritableComparable fromKey)
Specified by:
tailMap in interface SortedMap<WritableComparable,Writable>

clear

public void clear()
Specified by:
clear in interface Map<WritableComparable,Writable>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<WritableComparable,Writable>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<WritableComparable,Writable>

entrySet

public Set<Map.Entry<WritableComparable,Writable>> entrySet()
Specified by:
entrySet in interface Map<WritableComparable,Writable>
Specified by:
entrySet in interface SortedMap<WritableComparable,Writable>

get

public Writable get(Object key)
Specified by:
get in interface Map<WritableComparable,Writable>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<WritableComparable,Writable>

keySet

public Set<WritableComparable> keySet()
Specified by:
keySet in interface Map<WritableComparable,Writable>
Specified by:
keySet in interface SortedMap<WritableComparable,Writable>

put

public Writable put(WritableComparable key,
                    Writable value)
Specified by:
put in interface Map<WritableComparable,Writable>

putAll

public void putAll(Map<? extends WritableComparable,? extends Writable> t)
Specified by:
putAll in interface Map<WritableComparable,Writable>

remove

public Writable remove(Object key)
Specified by:
remove in interface Map<WritableComparable,Writable>

size

public int size()
Specified by:
size in interface Map<WritableComparable,Writable>

values

public Collection<Writable> values()
Specified by:
values in interface Map<WritableComparable,Writable>
Specified by:
values in interface SortedMap<WritableComparable,Writable>

readFields

public void readFields(DataInput in)
                throws IOException
Description copied from interface: Writable
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

write

public void write(DataOutput out)
           throws IOException
Description copied from interface: Writable
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


Copyright © 2012 Apache Software Foundation. All Rights Reserved.