public class Vertex extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
private Collection<VertexAttribute> |
attributes |
protected String |
id |
protected double |
xCoord |
protected double |
yCoord |
Constructor and Description |
---|
Vertex(String id)
A generic vertex for a graph object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addAttribute(VertexAttribute attribute)
Add an attribute to the vertex, overwriting any attribute of the same name.
|
protected void |
finalize() |
VertexAttribute |
getAttributeByName(String attributeName)
Obtain an attribute of this vertex by the attributes name.
|
void |
setXCoord(double x)
Set the x coordinate for the vertex.
|
void |
setYCoord(double y)
Set the y coordinate for the vertex.
|
protected String id
protected double xCoord
protected double yCoord
private Collection<VertexAttribute> attributes
public Vertex(String id)
id
- an id for the vertex.public final VertexAttribute getAttributeByName(String attributeName)
attributeName
- the name of the attribute to be found.public final boolean addAttribute(VertexAttribute attribute)
attribute
- the attribute to be added.public final void setXCoord(double x)
x
- the x coordinate for the vertex.public final void setYCoord(double y)
y
- the y coordinate for the vertex.Copyright © 2015 University of Glasgow. All rights reserved.