Rice Pastry API

rice.p2p.util
Class ReverseTreeMap

java.lang.Object
  extended byrice.p2p.util.ReverseTreeMap
All Implemented Interfaces:
java.io.Serializable

public class ReverseTreeMap
extends java.lang.Object
implements java.io.Serializable

Version:
$Id: ReverseTreeMap.java 2604 2005-06-24 21:51:46Z jeffh $
Author:
Alan Mislove
See Also:
Serialized Form

Field Summary
protected  java.util.SortedMap normal
          The internal normal map
protected  java.util.SortedMap nulls
          The internal list of keys with null as a mapping
protected  java.util.SortedMap reverse
          The internal value -> list of keys map
 
Constructor Summary
  ReverseTreeMap()
          Constructor
protected ReverseTreeMap(java.util.SortedMap normal, java.util.SortedMap reverse, java.util.SortedMap nulls)
          Constructor
 
Method Summary
 boolean containsKey(java.lang.Object key)
          Returns whether or not we contain the key
protected  java.util.SortedMap convert(java.util.SortedMap map)
          Internal method which converts a sortedmap to an iterator
 java.lang.Object get(java.lang.Object key)
          Returns the value associated with the given key
 java.util.SortedMap keyHeadMap(java.lang.Object value)
          Method which returns a *cloned* head map, or all of the values up to the specified value
 java.util.SortedMap keyMap()
          Method which returns the key map
 java.util.Set keySet()
          Return the set of keys
 java.util.SortedMap keySubMap(java.lang.Object start, java.lang.Object end)
          Method which returns a *cloned* sub map, or all of the values between the specified values
 java.util.SortedMap keyTailMap(java.lang.Object value)
          Method which returns a *cloned* tail map, or all of the values after a the specified value
 void put(java.lang.Object key, java.lang.Object value)
          Method which caputures the insert and adds it to the reverse map
 void remove(java.lang.Object key)
          Removes any and all mappings with the given key
 int size()
          returns the size
 java.util.SortedMap valueHeadMap(java.lang.Object value)
          Method which returns a headset of the values, or all the keys with values up to the specified value
 java.util.SortedMap valueNullMap()
          Method which returns all of the keys which have null values
 java.util.SortedMap valueSubMap(java.lang.Object start, java.lang.Object end)
          Method which returns a headset of the values, or all the keys with values up to the specified value
 java.util.SortedMap valueTailMap(java.lang.Object value)
          Method which returns a tailset of the values, or all the keys with values after to the specified value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

normal

protected java.util.SortedMap normal
The internal normal map


reverse

protected java.util.SortedMap reverse
The internal value -> list of keys map


nulls

protected java.util.SortedMap nulls
The internal list of keys with null as a mapping

Constructor Detail

ReverseTreeMap

public ReverseTreeMap()
Constructor


ReverseTreeMap

protected ReverseTreeMap(java.util.SortedMap normal,
                         java.util.SortedMap reverse,
                         java.util.SortedMap nulls)
Constructor

Parameters:
normal - DESCRIBE THE PARAMETER
reverse - DESCRIBE THE PARAMETER
nulls - DESCRIBE THE PARAMETER
Method Detail

get

public java.lang.Object get(java.lang.Object key)
Returns the value associated with the given key

Parameters:
key - The key
Returns:
The value

size

public int size()
returns the size

Returns:
the size

containsKey

public boolean containsKey(java.lang.Object key)
Returns whether or not we contain the key

Parameters:
key - THe key
Returns:
Whether or not we have it

keySet

public java.util.Set keySet()
Return the set of keys

Returns:
The set of keys

remove

public void remove(java.lang.Object key)
Removes any and all mappings with the given key

Parameters:
key - The key

put

public void put(java.lang.Object key,
                java.lang.Object value)
Method which caputures the insert and adds it to the reverse map

Parameters:
key - The key
value - The value

keyMap

public java.util.SortedMap keyMap()
Method which returns the key map

Returns:
DESCRIBE THE RETURN VALUE

keyHeadMap

public java.util.SortedMap keyHeadMap(java.lang.Object value)
Method which returns a *cloned* head map, or all of the values up to the specified value

Parameters:
value - The start value
Returns:
a head map

keyTailMap

public java.util.SortedMap keyTailMap(java.lang.Object value)
Method which returns a *cloned* tail map, or all of the values after a the specified value

Parameters:
value - The start value
Returns:
a head map

keySubMap

public java.util.SortedMap keySubMap(java.lang.Object start,
                                     java.lang.Object end)
Method which returns a *cloned* sub map, or all of the values between the specified values

Parameters:
start - The start value
end - The end value
Returns:
a head map

valueHeadMap

public java.util.SortedMap valueHeadMap(java.lang.Object value)
Method which returns a headset of the values, or all the keys with values up to the specified value

Parameters:
value - The maximal value
Returns:
DESCRIBE THE RETURN VALUE

valueTailMap

public java.util.SortedMap valueTailMap(java.lang.Object value)
Method which returns a tailset of the values, or all the keys with values after to the specified value

Parameters:
value - The minimal value
Returns:
DESCRIBE THE RETURN VALUE

valueSubMap

public java.util.SortedMap valueSubMap(java.lang.Object start,
                                       java.lang.Object end)
Method which returns a headset of the values, or all the keys with values up to the specified value

Parameters:
start - DESCRIBE THE PARAMETER
end - DESCRIBE THE PARAMETER
Returns:
DESCRIBE THE RETURN VALUE

valueNullMap

public java.util.SortedMap valueNullMap()
Method which returns all of the keys which have null values

Returns:
DESCRIBE THE RETURN VALUE

convert

protected java.util.SortedMap convert(java.util.SortedMap map)
Internal method which converts a sortedmap to an iterator

Parameters:
map - THe map to convert
Returns:
The converted map

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection