SourceJammer 1.2.0.1 May 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan

org.sourcejammer.project.controller
Class ControllerNode

java.lang.Object
  |
  +--org.sourcejammer.project.controller.ControllerNode
All Implemented Interfaces:
java.lang.Comparable, Node
Direct Known Subclasses:
FileNode, ProjectNode, VersionNode

public abstract class ControllerNode
extends java.lang.Object
implements Node, java.lang.Comparable

Highest level Node for Controller Nodes.


Constructor Summary
ControllerNode()
           
 
Method Summary
 void checkKey(long key)
          This method throws BadMethodArgumentException (runtime) if the node is not locked or if the keys do not match.
abstract  int childCount()
          Returns count of number of child of this Node.
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
           
 java.util.Date getCreatedDate()
           
 java.lang.String getNodeName()
          Returns the name of the node.
 ControllerNode getParent()
          Deprecated.  
 ControllerNode getRootParent()
           
 ControllerNode getShareParent()
          If this ControllerNode is shared, this returns the "original" ControllerNode of the share, unless this IS the original ControllerNode, in which case this should be null.
 long getUniqueID()
          Returns unique ID of this node.
 boolean isCorrectKey(long key)
          Included to allow subclasses to check combination.
 boolean isLocked()
           
 boolean isShared()
          Returns true if the Node is shared to another location in the archive.
 void lock(long key)
          Locks this node so that set methods can only be run if this combination is included.
 void setCreatedDate(java.util.Date d, long key)
           
 void setNodeName(java.lang.String s, long key)
           
 void setParent(ControllerNode nd, long key)
          Deprecated.  
 void setShared(boolean b, long key)
          Note: When this property is set to false, if a shareParent has previously been set, the shareParent will be set to null.
 void setShareParent(ControllerNode nd, long key)
          If this ControllerNode is shared, this should be set to the the "original" ControllerNode of this share, unless this IS the original ControllerNode, in which case this should be null.
 void setUniqueID(long l, long key)
           
abstract  void store(long key, ArchiveInfo info)
          To be implemented by model implementation of this class for storing needed data from this node.
 java.lang.String toString()
          Prints path up to this project node.
 void unlock(long key)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControllerNode

public ControllerNode()
Method Detail

lock

public void lock(long key)
          throws SecurityException
Locks this node so that set methods can only be run if this combination is included.

unlock

public void unlock(long key)
            throws SecurityException

isCorrectKey

public boolean isCorrectKey(long key)
Included to allow subclasses to check combination.

checkKey

public void checkKey(long key)
This method throws BadMethodArgumentException (runtime) if the node is not locked or if the keys do not match. Otherwise, it returns nothing and makes no changes.

isLocked

public boolean isLocked()

getNodeName

public java.lang.String getNodeName()
Description copied from interface: Node
Returns the name of the node.
Specified by:
getNodeName in interface Node

setNodeName

public void setNodeName(java.lang.String s,
                        long key)

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getCreatedDate

public java.util.Date getCreatedDate()

setCreatedDate

public void setCreatedDate(java.util.Date d,
                           long key)

isShared

public boolean isShared()
Description copied from interface: Node
Returns true if the Node is shared to another location in the archive.
Specified by:
isShared in interface Node

setShared

public void setShared(boolean b,
                      long key)
Note: When this property is set to false, if a shareParent has previously been set, the shareParent will be set to null.

setShareParent

public void setShareParent(ControllerNode nd,
                           long key)
If this ControllerNode is shared, this should be set to the the "original" ControllerNode of this share, unless this IS the original ControllerNode, in which case this should be null.
Parameters:
nd - -- the "original" Controller node that this is a share of.
Throws:
BadMethodArgmentException - if shared property is not true.

getShareParent

public ControllerNode getShareParent()
If this ControllerNode is shared, this returns the "original" ControllerNode of the share, unless this IS the original ControllerNode, in which case this should be null.
Returns:
the "original" ControllerNode of the share, or null if this is the original.
Throws:
BadMethodArgmentException - if shared property is not true.

childCount

public abstract int childCount()
Description copied from interface: Node
Returns count of number of child of this Node.
Specified by:
childCount in interface Node

toString

public java.lang.String toString()
Prints path up to this project node. For example:

/this/is/a/path
Overrides:
toString in class java.lang.Object

getRootParent

public ControllerNode getRootParent()

setUniqueID

public void setUniqueID(long l,
                        long key)

getUniqueID

public long getUniqueID()
Description copied from interface: Node
Returns unique ID of this node.
Specified by:
getUniqueID in interface Node

setParent

public void setParent(ControllerNode nd,
                      long key)
Deprecated.  


getParent

public ControllerNode getParent()
Deprecated.  


store

public abstract void store(long key,
                           ArchiveInfo info)
                    throws FileAccessException
To be implemented by model implementation of this class for storing needed data from this node.

SourceJammer 1.2.0.1 May 20, 2002
Copyright (c) 2001, 2002 Robert MacGrogan