fri.gui.swing.polytreetable
Class NodeCache

java.lang.Object
  |
  +--fri.gui.swing.polytreetable.NodeCache

public abstract class NodeCache
extends java.lang.Object

A node cache that holds different caches for different classes. For polytreetable it holds the userObject as key and the PolyTreeNode as value.

Do not forget to implement equals() method of userObject to satisfy Hashtable!

                PolyTreeNode node = NodeCache.get(userObject);
                if (node == null)	{
                        node = new SomeNodeClass(userObject);
                        NodeCache.put(userObject, node);
                }
        

Author:
Ritzberger Fritz

Method Summary
static void clear()
          Clear all class caches.
static void clear(java.lang.Class cls)
          Clear the cache for passed class.
static java.util.Enumeration elements(java.lang.Class cls)
          Returns the elements (PolyTreeNode) from the cache of passed class, or null.
static PolyTreeNode get(java.lang.Object userObject)
          Find an Object's node in a class cache.
static java.util.Enumeration keys(java.lang.Class cls)
          Returns the keys (userObject) from the cache of passed class, or null.
static void put(java.lang.Object userObject, PolyTreeNode node)
          Store an Object and its node to a class cache.
static void remove(java.lang.Object userObject)
          Remove an Object and its node from a class cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static PolyTreeNode get(java.lang.Object userObject)
Find an Object's node in a class cache. The userObject.getClass() class is used to identify the cache.


put

public static void put(java.lang.Object userObject,
                       PolyTreeNode node)
Store an Object and its node to a class cache. The userObject.getClass() class is used to create class caches if not already exisiting.


remove

public static void remove(java.lang.Object userObject)
Remove an Object and its node from a class cache. The userObject.getClass() class is used to identify the cache.


clear

public static void clear(java.lang.Class cls)
Clear the cache for passed class. The userObject.getClass() class was used to create class caches.


clear

public static void clear()
Clear all class caches.


keys

public static java.util.Enumeration keys(java.lang.Class cls)
Returns the keys (userObject) from the cache of passed class, or null.


elements

public static java.util.Enumeration elements(java.lang.Class cls)
Returns the elements (PolyTreeNode) from the cache of passed class, or null.