gumbo.util.relation
Class AbstractTreeNode.Global

java.lang.Object
  |
  +--gumbo.util.AbstractDisposable
        |
        +--gumbo.util.AbstractDelegatable
              |
              +--gumbo.util.AbstractDelegatable.Serial
                    |
                    +--gumbo.util.relation.AbstractRelation
                          |
                          +--gumbo.util.relation.AbstractTreeNode
                                |
                                +--gumbo.util.relation.AbstractTreeNode.Auto
                                      |
                                      +--gumbo.util.relation.AbstractTreeNode.Global
All Implemented Interfaces:
Delegatable, Disposable, Relation, java.io.Serializable, TreeNode
Enclosing class:
AbstractTreeNode

public static class AbstractTreeNode.Global
extends AbstractTreeNode.Auto

An AbstractTreeNode.Auto that uses a singleton (global) relationship, and throws an exception if the relationship is changed. This allows a client to use tree nodes without bothering to set the relationship, but it also means that the global relationship reports events for all relations in the global relationship.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class gumbo.util.relation.AbstractTreeNode
AbstractTreeNode.Auto, AbstractTreeNode.Global
 
Nested classes inherited from class gumbo.util.AbstractDelegatable
AbstractDelegatable.Serial
 
Constructor Summary
AbstractTreeNode.Global()
          Creates an instance with an uninitialized delegator and TreeNodes.GlobalTree as the relationship.
AbstractTreeNode.Global(Relationship relationship)
          Creates an instance with an uninitialized delegator.
 
Method Summary
 void setRelationship(Relationship relationship)
          Sets the relationship that this relation belongs to.
 
Methods inherited from class gumbo.util.relation.AbstractTreeNode.Auto
checkAddChild
 
Methods inherited from class gumbo.util.relation.AbstractTreeNode
addChild, addChild, checkChild, checkParent, checkRemoveChild, checkSetParent, findTreeNode, getChildren, getChildrenGroup, getParent, getTreeNode, hasChildren, implDispose, implReadConnections, implSetParent, implWriteConnections, newChildrenStore, removeChild, toString
 
Methods inherited from class gumbo.util.relation.AbstractRelation
canFindRelation, checkClearedRelationship, checkRelation, checkSettingRelationship, findRelation, getAddedConnectionOut, getRelationship, getRemovingConnectionOut, initedDelegator
 
Methods inherited from class gumbo.util.AbstractDelegatable
getDelegator, initDelegator, initingDelegator, isDelegatorInited
 
Methods inherited from class gumbo.util.AbstractDisposable
dispose, isDisposed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gumbo.util.relation.Relation
canFindRelation, findRelation, getAddedConnectionOut, getRelationship, getRemovingConnectionOut
 
Methods inherited from interface gumbo.util.Disposable
dispose, isDisposed
 
Methods inherited from interface gumbo.util.Delegatable
getDelegator, initDelegator, isDelegatorInited
 

Constructor Detail

AbstractTreeNode.Global

public AbstractTreeNode.Global()
Creates an instance with an uninitialized delegator and TreeNodes.GlobalTree as the relationship. Must call initDelegator() before using this delegate, such as new Global().initDelegator(d).


AbstractTreeNode.Global

public AbstractTreeNode.Global(Relationship relationship)
Creates an instance with an uninitialized delegator. Must call initDelegator() before using this delegate, such as new Global(r).initDelegator(d). Master constructor.

Parameters:
relationship - This relation's singleton relationship. Never null. If not a singleton this class will not work as expected.
Method Detail

setRelationship

public void setRelationship(Relationship relationship)
Description copied from interface: Relation
Sets the relationship that this relation belongs to. If this relation is going dead implementors must satisfy the relation contract by actively disconnecting it from all relations, or passively throwing an exception. Unless otherwise noted, no change in relationship is ignored.

Specified by:
setRelationship in interface Relation
Overrides:
setRelationship in class AbstractRelation
Parameters:
relationship - The relationship. Null if none (dead).
Throws:
java.lang.UnsupportedOperationException - This relation's relationship is immutable.