Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Freenet.node
Class LimitedHashtable  view LimitedHashtable download LimitedHashtable.java

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byFreenet.node.LimitedHashtable
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

class LimitedHashtable
extends java.util.Hashtable

A variant on a Hashtable which only holds a limited number of messages. When more messages than that are put in, old ones are deleted, oldest first.

Version:
Rrevision$

Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
(package private)  java.lang.Object[] ar
           
(package private)  int ptr
           
 
Fields inherited from class java.util.Hashtable
 
Constructor Summary
LimitedHashtable(int size)
           
 
Method Summary
 java.lang.Object[] limput(java.lang.Object key, java.lang.Object value)
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Puts the supplied value into the Map, mapped by the supplied key.
 java.lang.String toString()
          Converts this Hashtable to a String, surrounded by braces, and with key/value pairs listed with an equals sign between, separated by a comma and space.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, putAll, rehash, remove, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ar

java.lang.Object[] ar

ptr

int ptr
Constructor Detail

LimitedHashtable

public LimitedHashtable(int size)
Method Detail

limput

public java.lang.Object[] limput(java.lang.Object key,
                                 java.lang.Object value)

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Description copied from class: java.util.Hashtable
Puts the supplied value into the Map, mapped by the supplied key. Neither parameter may be null. The value may be retrieved by any object which equals() this key.


toString

public java.lang.String toString()
Description copied from class: java.util.Hashtable
Converts this Hashtable to a String, surrounded by braces, and with key/value pairs listed with an equals sign between, separated by a comma and space. For example, "{a=1, b=2}".

NOTE: if the toString() method of any key or value throws an exception, this will fail for the same reason.