Package org.terracotta.context
Class AbstractTreeNode
- java.lang.Object
-
- org.terracotta.context.AbstractTreeNode
-
- All Implemented Interfaces:
TreeNode,WeakIdentityHashMap.Cleanable
- Direct Known Subclasses:
MutableTreeNode,RootNode
abstract class AbstractTreeNode extends java.lang.Object implements TreeNode
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.CopyOnWriteArraySet<AbstractTreeNode>children
-
Constructor Summary
Constructors Constructor Description AbstractTreeNode()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaddChild(AbstractTreeNode child)(package private) abstract voidaddedParent(AbstractTreeNode child)voidclean()static java.lang.StringdumpSubtree(int indent, TreeNode node)(package private) abstract java.util.Set<AbstractTreeNode>getAncestors()java.util.Set<? extends AbstractTreeNode>getChildren()Returns the immediate children of this context.(package private) abstract java.util.Collection<ContextListener>getListeners()java.util.List<? extends TreeNode>getPath()Returns the unique rooting path of this context element.booleanremoveChild(AbstractTreeNode child)(package private) abstract voidremovedParent(AbstractTreeNode child)java.lang.StringtoTreeString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.terracotta.context.TreeNode
getContext, getPaths
-
-
-
-
Field Detail
-
children
private final java.util.concurrent.CopyOnWriteArraySet<AbstractTreeNode> children
-
-
Method Detail
-
addChild
public boolean addChild(AbstractTreeNode child)
-
removeChild
public boolean removeChild(AbstractTreeNode child)
-
getChildren
public java.util.Set<? extends AbstractTreeNode> getChildren()
Description copied from interface:TreeNodeReturns the immediate children of this context.- Specified by:
getChildrenin interfaceTreeNode- Returns:
- the context children
-
getPath
public java.util.List<? extends TreeNode> getPath()
Description copied from interface:TreeNodeReturns the unique rooting path of this context element.If this context element is not connected to a root in any ContextManager instance or is rooted via multiple distinct paths then an
IllegalStateExceptionwill be thrown.
-
toTreeString
public java.lang.String toTreeString()
- Specified by:
toTreeStringin interfaceTreeNode
-
dumpSubtree
public static java.lang.String dumpSubtree(int indent, TreeNode node)
-
addedParent
abstract void addedParent(AbstractTreeNode child)
-
removedParent
abstract void removedParent(AbstractTreeNode child)
-
getAncestors
abstract java.util.Set<AbstractTreeNode> getAncestors()
-
getListeners
abstract java.util.Collection<ContextListener> getListeners()
-
clean
public void clean()
- Specified by:
cleanin interfaceWeakIdentityHashMap.Cleanable
-
-