org.apache.slide.structure
Class ObjectNode

java.lang.Object
  |
  +--org.apache.slide.structure.ObjectNode
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
ActionNode, GroupNode, LinkNode, SubjectNode

public abstract class ObjectNode
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Represents any kind of object node.

This includes actors, activities and collections.

Version:
$Revision: 1.5 $
Author:
Remy Maucherat
See Also:
Serialized Form

Field Summary
protected  java.util.Vector children
          Vector of children's Uris.
protected  java.util.Vector links
          Vector of inbound links' Uris.
protected  java.lang.String uri
          Unique ressource identifier of the object.
 
Constructor Summary
ObjectNode()
          Default constructor.
ObjectNode(java.lang.String uri)
          Default constructor.
ObjectNode(java.lang.String uri, java.util.Vector children, java.util.Vector links)
          Default constructor.
 
Method Summary
(package private)  void addChild(ObjectNode child)
          Add a new child.
(package private)  void addChild(java.lang.String uri)
          Add a new child to this object.
 ObjectNode cloneObject()
          Clone.
 ObjectNode copyObject()
          Copy.
 java.util.Enumeration enumerateChildren()
          Return this object's children
 java.util.Enumeration enumerateLinks()
          Return this object's inbound links
 boolean equals(java.lang.Object obj)
          Equals.
 java.util.Enumeration getChildren()
          Deprecated.  
 java.lang.String getUri()
          Get object's unique resource identifier.
 boolean hasChild(ObjectNode child)
          Test if this object has the specified child.
 boolean hasChild(java.lang.String uri)
          Test if object has the specified child.
 boolean hasChildren()
          Test if object has children.
(package private)  void removeChild(java.lang.String uri)
          Remove child.
(package private)  void removeChildren()
          Remove all children.
(package private)  void setUri(java.lang.String uri)
          Set object's unique identifier.
 void validate(java.lang.String expectedUri)
          Validate an ObjectNode.
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uri

protected java.lang.String uri
Unique ressource identifier of the object.

children

protected java.util.Vector children
Vector of children's Uris.

links

protected java.util.Vector links
Vector of inbound links' Uris.
Constructor Detail

ObjectNode

public ObjectNode()
Default constructor.

ObjectNode

public ObjectNode(java.lang.String uri)
Default constructor.

ObjectNode

public ObjectNode(java.lang.String uri,
                  java.util.Vector children,
                  java.util.Vector links)
Default constructor.
Method Detail

getUri

public java.lang.String getUri()
Get object's unique resource identifier.
Returns:
String Uri

setUri

void setUri(java.lang.String uri)
Set object's unique identifier.
Parameters:
uri - Object Uri

getChildren

public java.util.Enumeration getChildren()
Deprecated.  

Return this object's children
Returns:
Enumeration Children's uris

enumerateChildren

public java.util.Enumeration enumerateChildren()
Return this object's children
Returns:
Enumeration Children's uris

addChild

void addChild(ObjectNode child)
Add a new child.
Parameters:
object - Child

addChild

void addChild(java.lang.String uri)
Add a new child to this object.
Parameters:
uri - Child's uri

removeChildren

void removeChildren()
Remove all children.

removeChild

void removeChild(java.lang.String uri)
Remove child.
Parameters:
uri - Child's Uri

hasChild

public boolean hasChild(java.lang.String uri)
Test if object has the specified child.
Parameters:
object - Child's uri
Returns:
boolean true if this object has the specified child, false otherwise

hasChild

public boolean hasChild(ObjectNode child)
Test if this object has the specified child.
Parameters:
child - Child object
Returns:
boolean true if this object has the specified child, false otherwise

hasChildren

public boolean hasChildren()
Test if object has children.
Returns:
boolean true if this object has children, false otherwise

enumerateLinks

public java.util.Enumeration enumerateLinks()
Return this object's inbound links
Returns:
Enumeration Inbound links uris

equals

public boolean equals(java.lang.Object obj)
Equals.
Overrides:
equals in class java.lang.Object
Parameters:
obj - Object to test
Returns:
boolean True if the two object are equal :
  • obj is of type ObjectNode and is not null
  • The Uris are equal

  • cloneObject

    public ObjectNode cloneObject()
    Clone.
    Returns:
    Object clone

    copyObject

    public ObjectNode copyObject()
    Copy.
    Returns:
    Object copy

    validate

    public void validate(java.lang.String expectedUri)
    Validate an ObjectNode.
    Parameters:
    expectedUri - Uri