mima.domain
Class SubNode

java.lang.Object
  extended by mima.domain.Node
      extended by mima.domain.SubNode

public class SubNode
extends Node

INV: Invariant from super class
INV: getSubNodes() != null

Author:
Virginio Carfagno

Nested Class Summary
 
Nested classes/interfaces inherited from class mima.domain.Node
Node.Frame
 
Field Summary
private  java.util.Collection _subNodes
           
private  Node _superNode
           
private static Node.Frame DEFAULT_FRAME
           
private static java.lang.String DEFAULT_TITLE
           
 
Constructor Summary
SubNode(Node superNode)
           
 
Method Summary
protected  void doAdd(SubNode subNode)
           
protected  void doRemove(SubNode subNode)
           
 java.util.Collection getSubNodes()
          This method doesn't return _subNodes directly to ensure the encapsulation and consistency of this object.
 Node getSuperNode()
           
protected  void invariant()
           
 boolean isRight()
           
protected  boolean isRight(SubNode subNode)
           
 void removeFromSuperNode()
          POST: getSuperNode() == null;
 void setSuperNode(Node superNode)
          POST: getSuperNode() == superNode
 
Methods inherited from class mima.domain.Node
add, checkNotNull, deregisterObserver, expand, expandAll, getFrame, getLink, getNote, getSubNodesCount, getTitle, hasLink, hasNote, hasSubNode, hasSubNodes, isExpanded, isRegisteredObserver, registerObserver, remove, setFrame, setLink, setNote, setTitle, toggleExpansion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FRAME

private static final Node.Frame DEFAULT_FRAME

DEFAULT_TITLE

private static final java.lang.String DEFAULT_TITLE
See Also:
Constant Field Values

_subNodes

private java.util.Collection _subNodes

_superNode

private Node _superNode
Constructor Detail

SubNode

public SubNode(Node superNode)
Method Detail

doAdd

protected void doAdd(SubNode subNode)
Specified by:
doAdd in class Node

doRemove

protected void doRemove(SubNode subNode)
Specified by:
doRemove in class Node

getSubNodes

public java.util.Collection getSubNodes()
This method doesn't return _subNodes directly to ensure the encapsulation and consistency of this object. A manipulation to the returned Collection doesn't have any effects on this object. To add or remove a SubNode to this node you should use the method setSuperNode(Node) or removeFromSuperNode() from SubNode.

Specified by:
getSubNodes in class Node

getSuperNode

public Node getSuperNode()

invariant

protected void invariant()
Overrides:
invariant in class Node

isRight

public boolean isRight()

isRight

protected boolean isRight(SubNode subNode)
Specified by:
isRight in class Node

removeFromSuperNode

public void removeFromSuperNode()
POST: getSuperNode() == null;


setSuperNode

public void setSuperNode(Node superNode)
POST: getSuperNode() == superNode