org.jboss.cache
Class AbstractNode

java.lang.Object
  |
  +--org.jboss.cache.AbstractNode
All Implemented Interfaces:
DataNode, TreeNode
Direct Known Subclasses:
Node

public abstract class AbstractNode
extends java.lang.Object
implements DataNode

Author:
manik

Field Summary
protected  java.util.Map children
           
protected  java.util.Map data
           
protected  Fqn fqn
           
protected static int INDENT
           
protected  java.lang.Object name
           
protected  DataNode parent
           
 
Fields inherited from interface org.jboss.cache.DataNode
LOCK_TYPE_NONE, LOCK_TYPE_READ, LOCK_TYPE_WRITE, PRINT_LOCK_DETAILS
 
Constructor Summary
AbstractNode()
           
 
Method Summary
 void addChild(java.lang.Object child_name, TreeNode n)
          Adds the (already created) child node.
 boolean childExists(java.lang.Object child_name)
           
protected  java.util.Map children()
          Override this if concurrent thread access may occur.
abstract  java.lang.Object clone()
           
protected  java.util.Map data()
          Needs to be called with a lock on dataLock if concurrency is a concern.
 TreeNode getChild(java.lang.Object child_name)
           
 java.util.Map getChildren()
          Will always return an unmodifiable map.
 Fqn getFqn()
           
 java.lang.Object getName()
           
 TreeNode getParent()
           
 boolean hasChildren()
           
 void print(java.lang.StringBuffer sb, int indent)
           
protected  void printDetailsInMap(java.lang.StringBuffer sb, int indent, java.util.Map map)
           
 void printIndent(java.lang.StringBuffer sb, int indent)
           
 void put(java.util.Map data)
           
 void removeAllChildren()
           
 void removeChild(java.lang.Object child_name)
           
 void setChildren(java.util.Map children)
          Sets Map
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.cache.DataNode
acquire, acquireAll, containsKey, createChild, getChildrenLoaded, getData, getDataKeys, getLock, getOrCreateChild, isLocked, numAttributes, printDetails, printLockInfo, releaseAll, releaseAllForce, setChildrenLoaded, setRecursiveTreeCacheInstance
 
Methods inherited from interface org.jboss.cache.TreeNode
clear, createChild, get, getImmutableLock, put, put, release, releaseForce, remove
 

Field Detail

name

protected java.lang.Object name

fqn

protected Fqn fqn

parent

protected DataNode parent

children

protected java.util.Map children

data

protected java.util.Map data

INDENT

protected static final int INDENT
See Also:
Constant Field Values
Constructor Detail

AbstractNode

public AbstractNode()
Method Detail

getName

public java.lang.Object getName()
Specified by:
getName in interface TreeNode

getFqn

public Fqn getFqn()
Specified by:
getFqn in interface TreeNode

getChild

public TreeNode getChild(java.lang.Object child_name)
Specified by:
getChild in interface TreeNode

getParent

public TreeNode getParent()
Specified by:
getParent in interface TreeNode

childExists

public boolean childExists(java.lang.Object child_name)
Specified by:
childExists in interface DataNode
See Also:
DataNode

getChildren

public java.util.Map getChildren()
Description copied from interface: TreeNode
Will always return an unmodifiable map. Implementations need to make sure of this. Use createChild or removeChild ...

Specified by:
getChildren in interface TreeNode
Returns:
Map
See Also:
DataNode

setChildren

public void setChildren(java.util.Map children)
Description copied from interface: DataNode
Sets Map

Specified by:
setChildren in interface DataNode
See Also:
DataNode

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in interface DataNode
See Also:
DataNode

put

public void put(java.util.Map data)
Specified by:
put in interface TreeNode

removeChild

public void removeChild(java.lang.Object child_name)
Specified by:
removeChild in interface TreeNode

removeAllChildren

public void removeAllChildren()
Specified by:
removeAllChildren in interface DataNode
See Also:
DataNode

print

public void print(java.lang.StringBuffer sb,
                  int indent)
Specified by:
print in interface DataNode

printIndent

public void printIndent(java.lang.StringBuffer sb,
                        int indent)
Specified by:
printIndent in interface DataNode

addChild

public void addChild(java.lang.Object child_name,
                     TreeNode n)
Description copied from interface: DataNode
Adds the (already created) child node. Replaces existing node if present.

Specified by:
addChild in interface DataNode
Parameters:
child_name -
n -

data

protected java.util.Map data()
Needs to be called with a lock on dataLock if concurrency is a concern.


children

protected java.util.Map children()
Override this if concurrent thread access may occur.


printDetailsInMap

protected void printDetailsInMap(java.lang.StringBuffer sb,
                                 int indent,
                                 java.util.Map map)

clone

public abstract java.lang.Object clone()
                                throws java.lang.CloneNotSupportedException
Specified by:
clone in interface DataNode
Overrides:
clone in class java.lang.Object
java.lang.CloneNotSupportedException


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.