Rice Pastry API

rice.p2p.util
Class StringCache

java.lang.Object
  extended byrice.p2p.util.StringCache

public class StringCache
extends java.lang.Object

Implementation of a cache of strings

Version:
$Id: pretty.settings,v 1.3 2005/03/11 20:22:33 jeffh Exp $
Author:
jeffh

Constructor Summary
StringCache()
          Constructs an empty IntHashMap with the default initial capacity (16) and the default load factor (0.75).
 
Method Summary
 void clear()
          Removes all mappings from this map.
 java.lang.String get(char[] chars)
          Returns the value to which the specified key is mapped in this identity hash map, or null if the map contains no mapping for this key.
 java.lang.String get(char[] chars, int offset, int length)
          Returns the value to which the specified key is mapped in this identity hash map, or null if the map contains no mapping for this key.
 boolean isEmpty()
          Returns true if this map contains no key-value mappings.
 int size()
          Returns the number of key-value mappings in this map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringCache

public StringCache()
Constructs an empty IntHashMap with the default initial capacity (16) and the default load factor (0.75).

Method Detail

isEmpty

public boolean isEmpty()
Returns true if this map contains no key-value mappings.

Returns:
true if this map contains no key-value mappings.

get

public java.lang.String get(char[] chars)
Returns the value to which the specified key is mapped in this identity hash map, or null if the map contains no mapping for this key. A return value of null does not necessarily indicate that the map contains no mapping for the key; it is also possible that the map explicitly maps the key to null . The containsKey method may be used to distinguish these two cases.

Parameters:
chars - DESCRIBE THE PARAMETER
Returns:
the value to which this map maps the specified key, or null if the map contains no mapping for this key.
See Also:
#put(Object, Object)

get

public java.lang.String get(char[] chars,
                            int offset,
                            int length)
Returns the value to which the specified key is mapped in this identity hash map, or null if the map contains no mapping for this key. A return value of null does not necessarily indicate that the map contains no mapping for the key; it is also possible that the map explicitly maps the key to null . The containsKey method may be used to distinguish these two cases.

Parameters:
chars - DESCRIBE THE PARAMETER
offset - DESCRIBE THE PARAMETER
length - DESCRIBE THE PARAMETER
Returns:
the value to which this map maps the specified key, or null if the map contains no mapping for this key.
See Also:
#put(Object, Object)

size

public int size()
Returns the number of key-value mappings in this map.

Returns:
the number of key-value mappings in this map.

clear

public void clear()
Removes all mappings from this map.


Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection