Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rice.p2p.util
Class StringCache

    java.lang.Object
      rice.p2p.util.StringCache

    public class StringCache

extends java.lang.Object

Implementation of a cache of strings

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

### size

    public int size()

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

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

### 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:
    `key` - the key whose associated value is to be returned.
  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:
    `key` - the key whose associated value is to be returned.
  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)`

### clear

    public void clear()

  Removes all mappings from this map.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.