|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lexonics.edsel.Node
An Edsel node.
A Node has a name and an attribute set.
The name is a valid Edsel identifier;
that is, it is a non-null, non-empty String
that contains no characters other than
upper- and lowercase ASCII letters, digits, and hyphens.
Names beginning with hyphens are reserved.
By convention, node names are concatenations of words
with only the first character of each word uppercase.
The attribute set is a non-null Set of Attributes;
no two Attributes in the attribute set have equal names.
Nodes are immutable.
| Field Summary | |
static Node |
Edge
The predefined structure Node with name -Edge. |
static Node |
MultiAttribute
The predefined structure Node with name -MultiAttribute. |
static Node |
MultiEdge
The predefined structure Node with name -MultiEdge. |
static Node |
Structure
The predefined structure Node with name -Structure. |
| Constructor Summary | |
Node(String name)
Construct a Node with a given name and an empty attribute set. |
|
Node(String name,
Set attributeSet)
Construct a Node with a given name and attribute set. |
|
| Method Summary | |
Attribute |
attribute(String name)
Return the Attribute in this Node with a given name, or null if none. |
Set |
attributeSet()
Return a shallow copy of the attribute set of this Node. |
boolean |
equals(Object o)
Compare a given object with this Node for equality. |
int |
hashCode()
Return the hash code value for this Node. |
String |
name()
Return the name of this Node. |
static Node |
predefinedStructureNode(String name)
Return the predefined structure node with a given name, or null if none. |
String |
toString()
Return a string representation of this Node. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final Node Structure
-Structure.
public static final Node MultiAttribute
-MultiAttribute.
public static final Node Edge
-Edge.
public static final Node MultiEdge
-MultiEdge.
| Constructor Detail |
public Node(String name)
name - The name of the Node. Must be a valid Edsel identifier.
IllegalArgumentException - The name is not a valid Edsel identifier.
public Node(String name,
Set attributeSet)
name - The name of the Node. Must be a valid Edsel identifier.attributeSet - The attribute set of the Node.
Must be a non-null Set of Attributes,
no two of which have equal names.
This set is copied by a shallow copy, to guarantee Node immutability.
IllegalArgumentException - The name is not a valid Edsel identifier,
the attribute set is null,
an element of the attribute set is not an Attribute,
or two Attributes in the attribute set have equal names.| Method Detail |
public Attribute attribute(String name)
Attribute in this Node with a given name, or null if none.
name - The name.
Attribute in this Node with the given name, or null if none.public Set attributeSet()
public boolean equals(Object o)
true if the given object is also a Node,
and the two Nodes have equal names and attribute sets.
o - The object.
true if the object is equal to this Node.public int hashCode()
public String name()
public static Node predefinedStructureNode(String name)
name - The name.
public String toString()
Attribute in the attribute set
is escaped by a backslash.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||