story.dbcore.links
Class WritableRelatedNodes

java.lang.Object
  extended by story.dbcore.links.RelatedNodes
      extended by story.dbcore.links.WritableRelatedNodes

public class WritableRelatedNodes
extends RelatedNodes

Extension of RelatedNodes that supports write operations and thus should not be passed around out of the LinkRepository.


Constructor Summary
WritableRelatedNodes(GenericNode newOriginNode, LinkType newLinkType, LinkDirection direction, LinkRepository linkRepository, boolean simple)
          Public constructor.
 
Method Summary
 void add(GenericNode newRelatedNode, LinkLabelAddress newLabelAddress)
          Add a new related node.
 void clearAllRelations()
          Clear all links to all nodes.
 void remove(GenericNode deadRelatedNode)
          Remove all links to a particular node.
 void remove(GenericNode deadRelatedNode, LinkLabelAddress deadLabelAddress)
          Remove a particular link to a particular node.
 
Methods inherited from class story.dbcore.links.RelatedNodes
findLinkLabelAddress, getLinkSet, isDirectlyRelatedTo, isDirectlyRelatedTo, isIndirectlyRelatedTo, numberOfLinks, numRelatedNodes, render, render
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WritableRelatedNodes

public WritableRelatedNodes(GenericNode newOriginNode,
                            LinkType newLinkType,
                            LinkDirection direction,
                            LinkRepository linkRepository,
                            boolean simple)
Public constructor.

Parameters:
newOriginNode - The node to which this object's set of nodes are to be related
newLinkType - The type of link to which this object's set of nodes are to be related to newOriginNode
parentLR - The LinkRepository of which we will be a member.
direction - The semantic distinction: are these nodes related From or To the originNode?
linkProperties - A LinkProperties object
Method Detail

add

public void add(GenericNode newRelatedNode,
                LinkLabelAddress newLabelAddress)
         throws Scheherexception
Add a new related node. In other words, store the data for a new link directly from the origin node to some other node.

Parameters:
newRelatedNode - The new related node to add. (This will add blindly without any circularity checks, type checks, etc. That all happens in LinkRepository.)
newLabel - Label to attach to the new link to the related node.
Throws:
Scheherexception

remove

public void remove(GenericNode deadRelatedNode,
                   LinkLabelAddress deadLabelAddress)
            throws Scheherexception
Remove a particular link to a particular node.

Parameters:
deadRelatedNode - The node you'd like to remove a particular link to.
deadLabel - The label of the particular link you'd like to remove.
Throws:
Sceheherexception - Throws an error if the node is not connected with that particular label.
Scheherexception

remove

public void remove(GenericNode deadRelatedNode)
            throws Scheherexception
Remove all links to a particular node.

Parameters:
deadRelatedNode - The node you'd like to remove all links to.
Throws:
Scheherexception

clearAllRelations

public void clearAllRelations()
Clear all links to all nodes.



Copyright © 2011 David K. Elson. All Rights Reserved.