|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fhstralsund.vinets.structure.GraphAdapter
public class GraphAdapter
A convenience class for Graph-Decorators. All methods are delegated to the encapsulated Graph, so that a special decorator subclass must override only some of these methods. Any instance of the GraphAdapter class is a transparent object, what means that it has no own ID and all its contained NetElements remain hosted by the encapsulated graph.
Field Summary | |
---|---|
protected Graph |
G
|
Constructor Summary | |
---|---|
GraphAdapter(Graph theGraph)
|
Method Summary | |
---|---|
void |
clearLabels()
Clears all labels of this NetElement. |
java.lang.Object |
clone()
Delivers a deep copy of this Graph. |
boolean |
containsLabel(java.lang.Object key)
Returns true if the label contains a mapping for the specified key. |
int |
countEdges()
Returns the number of Links in this Graph. |
int |
countNodes()
Returns the number of Nodes in this Graph. |
Link |
createEdge(Node start,
Node end)
Constructs and returns a new Edge of the appropriate type. |
Link |
createEdge(Node start,
Node end,
boolean directed)
Constructs and returns a new directed or undirected Edge. |
Link |
createEdge(Node start,
Node end,
boolean directed,
java.lang.Object data)
Constructs and returns a new directed or undirected Edge with two end vertices. |
Node |
createNode()
Constructs and returns a new Node. |
Node |
createNode(java.lang.String name)
Constructs and returns a new Node. |
Node |
createNode(java.lang.String name,
java.lang.Object data)
Constructs and returns a new Node. |
java.util.Iterator |
edges()
Delivers an Iterator over all Links in this Graph. |
java.util.Set |
edgeSet()
Delivers the Set of Links in this Graph. |
boolean |
getBooleanLabel(java.lang.Object key)
Returns the label value associated with the passed key as boolean value. |
java.lang.Object |
getData()
Delivers application specific data stored by this NetElement which have no relation to the network algorithms. |
double |
getDoubleLabel(java.lang.Object key)
Returns the label value associated with the passed key as double value. |
NetElementGeometry |
getGeometry()
Delivers the NetElementGeometry instance containing the position and the size of this NetElement in the relative coordinate system of its host. |
GraphType |
getGraphType()
Returns the Type of this Graph. |
NetElement |
getHost()
Delivers the parent of this NetElement in the inclusion hierarchy. |
java.lang.Object |
getID()
Delivers the identifier of this NetElement. |
int |
getIntLabel(java.lang.Object key)
Returns the label value associated with the passed key as int value. |
java.lang.Object |
getLabel(java.lang.Object key)
Returns the label value associated with the passed key, or null if the label Map does not contain a mapping for this key. |
java.util.Set |
getLabelKeySet()
Returns a Set which contains the Keys inside the LabelMap. |
java.lang.String |
getName()
Delivers a human readable name of this NetElement. |
NetElement |
getOriginal()
Delivers the NetElement from which this one was copied. |
de.fhstralsund.vinets.graphics.NetElementRepresentation |
getRepresentation()
Delivers the NetElementRepresentation instance containing information for rendering this NetElement. |
boolean |
isDirected()
All Links of a directed Graph are directed Edges between two Nodes. |
boolean |
isHyperGraph()
A HyperGraph may contain HyperEdges that have more than two end vertices. |
boolean |
isMixed()
A mixed Graph may contain some undirected and some directed Edges, but all Links have exactly two end Nodes. |
boolean |
isUndirected()
All Links of an undirected Graph are undirected Edges between two Nodes. |
java.util.Iterator |
nodes()
Delivers an Iterator over all Nodes in this Graph. |
java.util.Set |
nodeSet()
Delivers the Set of Nodes in this Graph. |
boolean |
remove(NetElement elem)
Removes a NetElement from this Graph. |
java.lang.Object |
removeLabel(java.lang.Object key)
Removes a property stored as label from this NetElement. |
void |
setBooleanLabel(java.lang.Object key,
boolean i)
Adds to this NetElement a boolean value label or changes it. |
void |
setData(java.lang.Object data)
Assigns new application specific data to this NetElement which have no relation to the network algorithms. |
void |
setDoubleLabel(java.lang.Object key,
double i)
Adds to this NetElement a double value label or changes it. |
void |
setGeometry(NetElementGeometry geo)
Assigns a new NetElementGeometry instance containing the position and the size of this NetElement in the relative coordinate system of its host. |
void |
setIntLabel(java.lang.Object key,
int i)
Adds to this NetElement an integer value label or changes it. |
void |
setLabel(java.lang.Object key,
java.lang.Object value)
Adds a new property to be stored as a label of this NetElement or changes the value of an existing property. |
void |
setName(java.lang.String name)
Sets a human readable name for this NetElement. |
void |
setRepresentation(de.fhstralsund.vinets.graphics.NetElementRepresentation repres)
Assigns a new NetElementRepresentation instance containing information for rendering this NetElement. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Graph G
Constructor Detail |
---|
public GraphAdapter(Graph theGraph)
Method Detail |
---|
public boolean isDirected()
Graph
isDirected
in interface Graph
public boolean isUndirected()
Graph
isUndirected
in interface Graph
public boolean isMixed()
Graph
isMixed
in interface Graph
public boolean isHyperGraph()
Graph
isHyperGraph
in interface Graph
public int countNodes()
Graph
countNodes
in interface Graph
public int countEdges()
Graph
countEdges
in interface Graph
public java.util.Iterator nodes()
Graph
nodes
in interface Graph
public java.util.Set nodeSet()
Graph
nodeSet
in interface Graph
public java.util.Iterator edges()
Graph
edges
in interface Graph
public java.util.Set edgeSet()
Graph
edgeSet
in interface Graph
public Node createNode(java.lang.String name, java.lang.Object data)
Graph
createNode
in interface Graph
name
- a name used to identify this Node for the user.data
- external data of any kind that an application may need.
public Node createNode(java.lang.String name)
Graph
createNode
in interface Graph
name
- a name used to identify this Node for the user.
public Node createNode()
Graph
createNode
in interface Graph
public Link createEdge(Node start, Node end, boolean directed, java.lang.Object data)
Graph
createEdge
in interface Graph
start
- the source Node.end
- the target Node.directed
- true if the Edge is directed.data
- external data of any kind that an application may need
public Link createEdge(Node start, Node end, boolean directed)
Graph
createEdge
in interface Graph
start
- source Nodeend
- target Nodedirected
- true if the Edge is directed, false otherwise.
public Link createEdge(Node start, Node end)
Graph
createEdge
in interface Graph
start
- source Nodeend
- target Node
public boolean remove(NetElement elem)
Graph
remove
in interface Graph
elem
- the NetElement to be removed.
public java.lang.Object getID()
NetElement
getID
in interface NetElement
public java.lang.String getName()
NetElement
getName
in interface NetElement
public void setName(java.lang.String name)
NetElement
setName
in interface NetElement
name
- the name.public NetElement getHost()
NetElement
getHost
in interface NetElement
public NetElement getOriginal()
NetElement
getOriginal
in interface NetElement
public NetElementGeometry getGeometry()
NetElement
getGeometry
in interface NetElement
public void setGeometry(NetElementGeometry geo)
NetElement
setGeometry
in interface NetElement
geo
- a reference to the new NetElementGeometry.public de.fhstralsund.vinets.graphics.NetElementRepresentation getRepresentation()
NetElement
getRepresentation
in interface NetElement
public void setRepresentation(de.fhstralsund.vinets.graphics.NetElementRepresentation repres)
NetElement
setRepresentation
in interface NetElement
repres
- a reference to the graphic representation of this
NetElement.public java.lang.Object getData()
NetElement
getData
in interface NetElement
public void setData(java.lang.Object data)
NetElement
setData
in interface NetElement
data
- a reference to the external information to be stored.public void setLabel(java.lang.Object key, java.lang.Object value)
NetElement
setLabel
in interface NetElement
key
- an Object with which the specified value is to be
associated.value
- an Object to be associated with the specified key.public java.lang.Object getLabel(java.lang.Object key)
NetElement
getLabel
in interface NetElement
key
- the key whose associated value is to be returned.
NetElement.setLabel(Object, Object)
public java.util.Set getLabelKeySet()
NetElement
getLabelKeySet
in interface NetElement
public boolean containsLabel(java.lang.Object key)
NetElement
containsLabel
in interface NetElement
key
- the key whose presence as label is to be tested.
NetElement.setLabel(Object, Object)
public void setIntLabel(java.lang.Object key, int i)
NetElement
setIntLabel
in interface NetElement
key
- an Object with which the integer value is to be
associated.i
- an int value to be associated with the specified
key.NetElement.setLabel(Object, Object)
public int getIntLabel(java.lang.Object key)
NetElement
getIntLabel
in interface NetElement
key
- the key whose associated integer value is to be returned.
NetElement.getLabel(Object)
public void setDoubleLabel(java.lang.Object key, double i)
NetElement
setDoubleLabel
in interface NetElement
key
- an Object with which the double value is to be
associated.i
- a double value to be associated with the
specified key.NetElement.setLabel(Object, Object)
public double getDoubleLabel(java.lang.Object key)
NetElement
getDoubleLabel
in interface NetElement
key
- the key whose associated double value is to be returned.
NetElement.getLabel(Object)
public void setBooleanLabel(java.lang.Object key, boolean i)
NetElement
setBooleanLabel
in interface NetElement
key
- an Object with which the boolean value is to be
associated.i
- true or false to be associated with
the specified key.NetElement.setLabel(Object, Object)
public boolean getBooleanLabel(java.lang.Object key)
NetElement
getBooleanLabel
in interface NetElement
key
- the key whose associated boolean value is to be returned.
NetElement.getLabel(Object)
public java.lang.Object removeLabel(java.lang.Object key)
NetElement
removeLabel
in interface NetElement
key
- the key of the property to remove.
NetElement.setLabel(Object, Object)
public void clearLabels()
NetElement
clearLabels
in interface NetElement
public GraphType getGraphType()
Graph
getGraphType
in interface Graph
public java.lang.Object clone()
Graph
clone
in interface Graph
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |