|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wpi.cs.cs509.graph.processors.graphcustomizer.Vertex
Represents a Vertex in a Graph.
Each vertex has a unique String label (unique within its Graph). Each vertex has an x and y coordinate for the location of the vertex when drawn to the screen.
A vertex has an associated color (defaults to Color.black).
Note that each vertex is simply a placeholder for simple information; in particular, a vertex is unaware of its incident edges or its neighboring vertices.
Field Summary | |
protected java.awt.Color |
color
vertex color. |
protected int |
id
id of this vertex. |
protected PropertyManager |
properties
Manages the properties for IMetaInformation |
protected int |
status
Status number of a graph. |
Constructor Summary | |
Vertex(INode n)
Vertex constructor copying an existing Vertex object. |
|
Vertex(int id)
Default Vertex constructor. |
Method Summary | |
void |
accept(IGraphVisitor gv)
Implement visitor pattern by allowing any GraphVisitor to visit. |
void |
copyProperty(java.lang.String key,
IMetaInformation base)
Copy given property value from the base object. |
java.lang.String |
getProperty(java.lang.String key)
Return the value of a property identified by key. |
int |
getStatus()
Return status number of this vertex. |
int |
getX()
Return x coordinate of this vertex. |
int |
getY()
Return x coordinate of this vertex. |
java.util.Iterator |
keys()
Return the used keys for the available meta information. |
int |
nodeId()
Return the unique identifier for this node. |
void |
removeProperty(java.lang.String key)
Removes the value of a specific property identified by key. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Sets the value of a specific property identified by key. |
void |
setStatus(int s)
Set status number of this vertex. |
void |
setX(int x)
Set x position of this vertex. |
void |
setY(int y)
Set y position of this vertex. |
java.lang.String |
toString()
Return string representation of vertex. |
java.lang.String |
toXML()
Output an XML representation of the meta information. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int id
protected int status
protected java.awt.Color color
protected PropertyManager properties
Constructor Detail |
public Vertex(int id)
public Vertex(INode n)
The only information copied is the label. Note: no Properties are copied.
Method Detail |
public void accept(IGraphVisitor gv) throws java.lang.Exception
GraphVisitor
to visit.
accept
in interface INode
gv
- a GraphVisitor
object.
java.lang.Exception
- if visitor sequence interrupted unexpectedly.public void copyProperty(java.lang.String key, IMetaInformation base) throws java.lang.Exception
copyProperty
in interface IMetaInformation
key
- a String
representing the key to the Meta Information.base
- The IMetaInformation object containing the property to be copied.
java.lang.Exception
- if key or base is invalid.public java.lang.String getProperty(java.lang.String key) throws java.lang.Exception
getProperty
in interface IMetaInformation
key
- the String
identifying the property of interest.
java.lang.Exception
- if key is null or invalidpublic int getStatus()
public int getX()
public int getY()
public java.util.Iterator keys() throws java.lang.Exception
keys
in interface IMetaInformation
String
keys of the properties available for the current object.
java.lang.Exception
- for unforeseen error while processing Iterator.public int nodeId() throws java.lang.Exception
nodeId
in interface INode
java.lang.Exception
- if the current node has been deleted from its IGraph
or is otherwise
unassociated with a valid IGraph
object.public void removeProperty(java.lang.String key) throws java.lang.Exception
removeProperty
in interface IMetaInformation
key
- a String
representing the key of the property whose data is to be removed.
java.lang.Exception
- if key is null or invalid.public void setProperty(java.lang.String key, java.lang.String value) throws java.lang.Exception
If the value is 'null' then the property is removed
setProperty
in interface IMetaInformation
key
- a String
identifying the key in a (key, value) pair to be set.value
- a String
identifying the value in a (key, value) pair to be set.
java.lang.Exception
- if (1) key is null; (2) key is invalidpublic void setStatus(int s)
public void setX(int x)
Uses Meta Information Graph.XString
public void setY(int y)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toXML() throws java.lang.Exception
toXML
in interface IMetaInformation
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |