Package ptolemy.graph
Class Node
- java.lang.Object
-
- ptolemy.graph.Element
-
- ptolemy.graph.Node
-
public final class Node extends Element
An optionally-weighted node for an undirected or directed graph. More specifically, a node consists of an optional weight (an arbitrary object that is associated with the node). We say that a node is unweighted if it does not have an assigned weight. It is an error to attempt to access the weight of an unweighted node. Node weights must be genuine (non-null) objects.- Since:
- Ptolemy II 2.0
- Version:
- $Id$
- Author:
- Shuvra S. Bhattacharyya
- See Also:
Edge
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
descriptor()
A one-word description of the type of this graph element.java.lang.String
toString()
Return a string representation of the node.-
Methods inherited from class ptolemy.graph.Element
getWeight, hasWeight, removeWeight, setWeight
-
-
-
-
Method Detail
-
descriptor
public java.lang.String descriptor()
A one-word description of the type of this graph element.- Overrides:
descriptor
in classElement
- Returns:
- The description.
-
toString
public java.lang.String toString()
Return a string representation of the node. The string representation is simply a representation of the node weight (or the string"<unweighted node>"
if the node is unweighted.- Overrides:
toString
in classjava.lang.Object
-
-