public class Node extends Vertex
Network
.
determineExcess(Node)
to determine the excess of a specific node.Vertex
Constructor and Description |
---|
Node(java.lang.String caption)
Creates a new node.
|
Modifier and Type | Method and Description |
---|---|
void |
deserialize(Serializer s)
Deserializes (loads) the object data from the given serializer.
|
static void |
determineExcess(Node n)
Determines the excess of a specified node and saves it using
setExcess(float) . |
float |
getExcess()
Gets the excess of the node.
|
Arc |
getIncomingEdge(int index)
Gets an incoming edge at the given index.
|
Arc |
getOutgoingEdge(int index)
Gets an outgoing edge at the given index.
|
boolean |
hasExcess()
Indicates whether the node has an excess.
|
void |
serialize(Serializer s)
Serializes (saves) the object data to the given serializer.
|
void |
setCaption(java.lang.String caption)
Sets the caption of the node.
|
void |
setExcess(float excess)
Sets the excess of the node.
|
equals, equals, getCaption, getDegree, getGraph, getID, getIncidentEdge, getIncidentEdgeCount, getIncomingEdgeCount, getIndegree, getIndex, getOutdegree, getOutgoingEdgeCount, toString
public Node(java.lang.String caption) throws java.lang.IllegalArgumentException
caption
- the caption of the vertexjava.lang.IllegalArgumentException
- public Arc getIncomingEdge(int index) throws java.lang.IndexOutOfBoundsException
Vertex
getIncomingEdge
in class Vertex
index
- the indexjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getIncomingEdgesCount()
)Edge.getPredecessor(Vertex)
,
Edge.getSuccessor(Vertex)
public Arc getOutgoingEdge(int index) throws java.lang.IndexOutOfBoundsException
Vertex
getOutgoingEdge
in class Vertex
index
- the indexjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getOutgoingEdgesCount()
)Edge.getPredecessor(Vertex)
,
Edge.getSuccessor(Vertex)
public void setCaption(java.lang.String caption) throws java.lang.IllegalArgumentException
setCaption
in class Vertex
caption
- the caption of the nodejava.lang.IllegalArgumentException
- public float getExcess()
Network.determineExcesses()
.public void setExcess(float excess)
Network.determineExcesses()
.excess
- the excess of the nodepublic boolean hasExcess()
true
if the node can have an excess otherwise false
public static void determineExcess(Node n) throws java.lang.IllegalArgumentException
setExcess(float)
.
n
- the nodejava.lang.IllegalArgumentException
- public void serialize(Serializer s)
Serializable
serialize
in interface Serializable
serialize
in class Vertex
s
- the serializer for the objectpublic void deserialize(Serializer s)
Serializable
deserialize
in interface Serializable
deserialize
in class Vertex
s
- the serializer