org.graphstream.ui.graphicGraph
Class GraphicNode

java.lang.Object
  extended by org.graphstream.graph.implementations.AbstractElement
      extended by org.graphstream.ui.graphicGraph.GraphicElement
          extended by org.graphstream.ui.graphicGraph.GraphicNode
All Implemented Interfaces:
Iterable<Edge>, Element, Node

public class GraphicNode
extends GraphicElement
implements Node

Graphical node.

A graphic node defines a position (x,y,z), a string label, and a style from the style sheet.

See Also:
GraphicGraph

Nested Class Summary
 
Nested classes/interfaces inherited from class org.graphstream.ui.graphicGraph.GraphicElement
GraphicElement.SwingElementRenderer
 
Nested classes/interfaces inherited from class org.graphstream.graph.implementations.AbstractElement
AbstractElement.AttributeChangeEvent
 
Field Summary
 boolean positionned
           
 double x
          The position of the node.
 double y
          The position of the node.
 double z
          The position of the node.
 
Fields inherited from class org.graphstream.ui.graphicGraph.GraphicElement
component, hidden, label, style
 
Constructor Summary
GraphicNode(GraphicGraph graph, String id, HashMap<String,Object> attributes)
          New graphic node.
 
Method Summary
 Iterator<Node> getBreadthFirstIterator()
          Not implemented.
 Iterator<Node> getBreadthFirstIterator(boolean directed)
          Not implemented.
 int getDegree()
          Total number of relations with other nodes or this node.
 Iterator<Node> getDepthFirstIterator()
          Not implemented.
 Iterator<Node> getDepthFirstIterator(boolean directed)
          Not implemented.
<T extends Edge>
Iterable<T>
getEachEdge()
          Set of all entering and leaving edges.
<T extends Edge>
Iterable<T>
getEachEnteringEdge()
          Set of all entering edges.
<T extends Edge>
Iterable<T>
getEachLeavingEdge()
          Set of all leaving edges.
<T extends Edge>
T
getEdge(int i)
          I-th edge.
<T extends Edge>
T
getEdgeBetween(int index)
          Retrieves an edge between this node and the node with index i if one exists.
<T extends Edge>
T
getEdgeBetween(Node Node)
          Retrieves an edge between this node and and another node if one exists.
<T extends Edge>
T
getEdgeBetween(String id)
          Retrieve an edge between this node and the node 'id', if it exits.
<T extends Edge>
T
getEdgeFrom(int index)
          Retrieves an edge that leaves node with given index toward this node.
<T extends Edge>
T
getEdgeFrom(Node Node)
          Retrieves an edge that leaves given node toward this node.
<T extends Edge>
T
getEdgeFrom(String id)
          Retrieve an edge that leaves node 'id' toward this node.
<T extends Edge>
Iterator<T>
getEdgeIterator()
          Iterator on the set of connected edges.
<T extends Edge>
Collection<T>
getEdgeSet()
          Set of all entering and leaving edges.
<T extends Edge>
T
getEdgeToward(int index)
          Retrieves an edge that leaves this node toward the node with given index.
<T extends Edge>
T
getEdgeToward(Node Node)
          Retrieves an edge that leaves this node toward another node.
<T extends Edge>
T
getEdgeToward(String id)
          Retrieve an edge that leaves this node toward 'id'.
<T extends Edge>
T
getEnteringEdge(int i)
          I-th entering edge.
<T extends Edge>
Iterator<T>
getEnteringEdgeIterator()
          Iterator only on leaving edges.
<T extends Edge>
Collection<T>
getEnteringEdgeSet()
          Set of all entering edges.
 Graph getGraph()
          Parent graph.
 String getGraphName()
           
 String getHost()
           
 int getInDegree()
          Number of entering edges.
<T extends Edge>
T
getLeavingEdge(int i)
          I-th leaving edge.
<T extends Edge>
Iterator<T>
getLeavingEdgeIterator()
          Iterator only on entering edges.
<T extends Edge>
Collection<T>
getLeavingEdgeSet()
          Set of all leaving edges.
 Iterator<Node> getNeighborNodeIterator()
          Iterator on the set of neighbor nodes connected to this node via one or more edges.
 int getOutDegree()
          Number of leaving edges.
 Selector.Type getSelectorType()
          Type of selector for the graphic element (Node, Edge, Sprite ?).
 double getX()
          Abscissa of the element, always in GU (graph units).
 double getY()
          Ordinate of the element, always in GU (graph units).
 double getZ()
          Depth of the element, always in GU (graph units).
 boolean hasEdgeBetween(int index)
          True if an edge exists between this node and a node with given index.
 boolean hasEdgeBetween(Node node)
          True if an edge exists between this node and another node.
 boolean hasEdgeBetween(String id)
          True if an edge exists between this node and node 'id'.
 boolean hasEdgeFrom(int index)
          True if an edge enters this node from a node with given index.
 boolean hasEdgeFrom(Node node)
          True if an edge enters this node from a given node.
 boolean hasEdgeFrom(String id)
          True if an edge enters this node from node 'id'.
 boolean hasEdgeToward(int index)
          True if an edge leaves this node toward a node with given index.
 boolean hasEdgeToward(Node node)
          True if an edge leaves this node toward a given node.
 boolean hasEdgeToward(String id)
          True if an edge leaves this node toward node 'id'.
 boolean isDistributed()
           
 Iterator<Edge> iterator()
           
 void move(double x, double y, double z)
          Try to force the element to move at the give location in graph units (GU).
 void setGraph(Graph graph)
           
 void setGraphName(String newHost)
           
 void setHost(String newHost)
           
 
Methods inherited from class org.graphstream.ui.graphicGraph.GraphicElement
addAttribute, getComponent, getLabel, getStyle, myGraph, setComponent
 
Methods inherited from class org.graphstream.graph.implementations.AbstractElement
addAttributes, changeAttribute, clearAttributes, getArray, getAttribute, getAttribute, getAttributeCount, getAttributeKeyIterator, getAttributeKeySet, getEachAttributeKey, getFirstAttributeOf, getFirstAttributeOf, getHash, getId, getIndex, getLabel, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasHash, hasLabel, hasNumber, hasVector, removeAttribute, setAttribute, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.graphstream.graph.Node
toString
 
Methods inherited from interface org.graphstream.graph.Element
addAttribute, addAttributes, changeAttribute, clearAttributes, getArray, getAttribute, getAttribute, getAttributeCount, getAttributeKeyIterator, getAttributeKeySet, getFirstAttributeOf, getFirstAttributeOf, getHash, getId, getIndex, getLabel, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasHash, hasLabel, hasNumber, hasVector, removeAttribute, setAttribute
 

Field Detail

x

public double x
The position of the node. In graph units.


y

public double y
The position of the node. In graph units.


z

public double z
The position of the node. In graph units.


positionned

public boolean positionned
Constructor Detail

GraphicNode

public GraphicNode(GraphicGraph graph,
                   String id,
                   HashMap<String,Object> attributes)
New graphic node.

Parameters:
id - The node identifier.
attributes - The node attribute set (can be null).
Method Detail

getSelectorType

public Selector.Type getSelectorType()
Description copied from class: GraphicElement
Type of selector for the graphic element (Node, Edge, Sprite ?).

Specified by:
getSelectorType in class GraphicElement

getX

public double getX()
Description copied from class: GraphicElement
Abscissa of the element, always in GU (graph units). For edges this is the X of the "from" node.

Specified by:
getX in class GraphicElement

getY

public double getY()
Description copied from class: GraphicElement
Ordinate of the element, always in GU (graph units). For edges this is the Y of the "from" node.

Specified by:
getY in class GraphicElement

getZ

public double getZ()
Description copied from class: GraphicElement
Depth of the element, always in GU (graph units). For edges this is the Z of the "from" node.

Specified by:
getZ in class GraphicElement

move

public void move(double x,
                 double y,
                 double z)
Description copied from class: GraphicElement
Try to force the element to move at the give location in graph units (GU). For edges, this may move the two attached nodes.

Specified by:
move in class GraphicElement
Parameters:
x - The new X.
y - The new Y.
z - the new Z.

getBreadthFirstIterator

public Iterator<Node> getBreadthFirstIterator()
Not implemented.

Specified by:
getBreadthFirstIterator in interface Node
Returns:
An iterator able to explore the graph in a breadth first way starting at this node.

getBreadthFirstIterator

public Iterator<Node> getBreadthFirstIterator(boolean directed)
Not implemented.

Specified by:
getBreadthFirstIterator in interface Node
Parameters:
directed - If false, the iterator will ignore edge orientation (the default is "True").
Returns:
An iterator able to explore the graph in a breadth first way starting at this node.

getDepthFirstIterator

public Iterator<Node> getDepthFirstIterator()
Not implemented.

Specified by:
getDepthFirstIterator in interface Node
Returns:
An iterator able to explore the graph in a depth first way starting at this node.

getDepthFirstIterator

public Iterator<Node> getDepthFirstIterator(boolean directed)
Not implemented.

Specified by:
getDepthFirstIterator in interface Node
Parameters:
directed - If false, the iterator will ignore edge orientation (the default is "True").
Returns:
An iterator able to explore the graph in a depth first way starting at this node.

getDegree

public int getDegree()
Description copied from interface: Node
Total number of relations with other nodes or this node.

Specified by:
getDegree in interface Node
Returns:
The number of edges/relations/links.

getEdge

public <T extends Edge> T getEdge(int i)
Description copied from interface: Node
I-th edge. Edges are stored in no given order.

However this method allows to iterate very quickly on all edges, or to choose a given edge with direct access.

This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getEdge(i);
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getEdge in interface Node
Parameters:
i - Index of the edge.
Returns:
The i-th edge.

getEdgeBetween

public <T extends Edge> T getEdgeBetween(String id)
Description copied from interface: Node
Retrieve an edge between this node and the node 'id', if it exits.

This method selects directed or undirected edges. If the edge is directed, its direction is not important and leaving or entering edges will be selected.

This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getEdgeBetween("...");
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getEdgeBetween in interface Node
Parameters:
id - Identifier of the opposite node.
Returns:
Edge between node 'id' and this node if it exists, else null.

getEdgeFrom

public <T extends Edge> T getEdgeFrom(String id)
Description copied from interface: Node
Retrieve an edge that leaves node 'id' toward this node.

This method selects only edges leaving node 'id' an pointing at this node (this also selects undirected edges).

This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getEdgeFrom("...");
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getEdgeFrom in interface Node
Parameters:
id - Identifier of the source node.
Returns:
Directed edge going from node 'id' to this node, or undirected edge if it exists, else null.

getEdgeIterator

public <T extends Edge> Iterator<T> getEdgeIterator()
Description copied from interface: Node
Iterator on the set of connected edges.

This iterator iterates on all edges leaving and entering (this includes any non-directed edge present, and a non-directed edge is only iterated once).

This method is implicitly generic and return an Iterator over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 Iterator<ExtendedEdge> ite = node.getEdgeIterator();
 
the method will return an Iterator<ExtendedEdge>. If no left part exists, method will just return an Iterator<Edge>.

Specified by:
getEdgeIterator in interface Node
Returns:
The iterator, edges are iterated in arbitrary order.

iterator

public Iterator<Edge> iterator()
Specified by:
iterator in interface Iterable<Edge>

getEachEdge

public <T extends Edge> Iterable<T> getEachEdge()
Description copied from interface: Node
Set of all entering and leaving edges.

This method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 Iterable<ExtendedEdge> ite = node.getEdgeSet();
 
the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.

Specified by:
getEachEdge in interface Node
Returns:
A collection containing all directed and undirected edges, leaving or entering.

getEdgeSet

public <T extends Edge> Collection<T> getEdgeSet()
Description copied from interface: Node
Set of all entering and leaving edges.

This method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 Iterable<ExtendedEdge> ite = node.getEdgeSet();
 
the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.

Specified by:
getEdgeSet in interface Node
Returns:
A collection containing all directed and undirected edges, leaving or entering.

getEdgeToward

public <T extends Edge> T getEdgeToward(String id)
Description copied from interface: Node
Retrieve an edge that leaves this node toward 'id'.

This method selects only edges leaving this node an pointing at node 'id' (this also selects undirected edges).

This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getEdgeToward("...");
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getEdgeToward in interface Node
Parameters:
id - Identifier of the target node.
Returns:
Directed edge going from this node to 'id', or undirected edge if it exists, else null.

getEnteringEdgeIterator

public <T extends Edge> Iterator<T> getEnteringEdgeIterator()
Description copied from interface: Node
Iterator only on leaving edges.

This iterator iterates only on directed edges going from this node to others (non-directed edges are included in the iteration).

This method is implicitly generic and return an Iterator over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 Iterator<ExtendedEdge> ite = node.getEnteringEdgeIterator();
 
the method will return an Iterator<ExtendedEdge>. If no left part exists, method will just return an Iterator<Edge>.

Specified by:
getEnteringEdgeIterator in interface Node
Returns:
The iterator, edges are iterated in arbitrary order.

getEachEnteringEdge

public <T extends Edge> Iterable<T> getEachEnteringEdge()
Description copied from interface: Node
Set of all entering edges.

This method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 Iterable<ExtendedEdge> ite = node.getEnteringEdgeSet();
 
the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.

Specified by:
getEachEnteringEdge in interface Node
Returns:
A collection of only edges that enter this node plus all undirected edges.

getEnteringEdgeSet

public <T extends Edge> Collection<T> getEnteringEdgeSet()
Description copied from interface: Node
Set of all entering edges.

This method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 Iterable<ExtendedEdge> ite = node.getEnteringEdgeSet();
 
the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.

Specified by:
getEnteringEdgeSet in interface Node
Returns:
A collection of only edges that enter this node plus all undirected edges.

getGraph

public Graph getGraph()
Description copied from interface: Node
Parent graph. Some elements are not able to give their parent graph.

Specified by:
getGraph in interface Node
Returns:
The graph containing this node or null if unknown.

getGraphName

public String getGraphName()

getHost

public String getHost()

getInDegree

public int getInDegree()
Description copied from interface: Node
Number of entering edges.

Specified by:
getInDegree in interface Node
Returns:
the count of edges that only leave this node plus all undirected edges.

getLeavingEdgeIterator

public <T extends Edge> Iterator<T> getLeavingEdgeIterator()
Description copied from interface: Node
Iterator only on entering edges.

This iterator iterates only on directed edges going from other nodes toward this node (non-directed edges are included in the iteration).

This method is implicitly generic and return an Iterator over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 Iterator<ExtendedEdge> ite = node.getLeavingEdgeIterator();
 
the method will return an Iterator<ExtendedEdge>. If no left part exists, method will just return an Iterator<Edge>.

Specified by:
getLeavingEdgeIterator in interface Node
Returns:
The iterator, edges are iterated in arbitrary order.

getEachLeavingEdge

public <T extends Edge> Iterable<T> getEachLeavingEdge()
Description copied from interface: Node
Set of all leaving edges.

This method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 Iterable<ExtendedEdge> ite = node.getLeavingEdgeSet();
 
the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.

Specified by:
getEachLeavingEdge in interface Node
Returns:
A collection of only edges that leave this node plus all undirected edges.

getLeavingEdgeSet

public <T extends Edge> Collection<T> getLeavingEdgeSet()
Description copied from interface: Node
Set of all leaving edges.

This method is implicitly generic and return an Iterable over something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 Iterable<ExtendedEdge> ite = node.getLeavingEdgeSet();
 
the method will return an Iterable<ExtendedEdge>. If no left part exists, method will just return an Iterable<Edge>.

Specified by:
getLeavingEdgeSet in interface Node
Returns:
A collection of only edges that leave this node plus all undirected edges.

getNeighborNodeIterator

public Iterator<Node> getNeighborNodeIterator()
Description copied from interface: Node
Iterator on the set of neighbor nodes connected to this node via one or more edges. This iterator iterates across any leaving, entering and non directed edges (nodes are neighbors even if they only have a directed edge from them toward this node). If there are multiple edges connecting the same node, it might be iterated several times.

Specified by:
getNeighborNodeIterator in interface Node
Returns:
The iterator, neighbors are iterated in arbitrary order.

getOutDegree

public int getOutDegree()
Description copied from interface: Node
Number of leaving edges.

Specified by:
getOutDegree in interface Node
Returns:
the count of edges that only enter this node plus all undirected edges.

hasEdgeBetween

public boolean hasEdgeBetween(String id)
Description copied from interface: Node
True if an edge exists between this node and node 'id'.

Specified by:
hasEdgeBetween in interface Node
Parameters:
id - Identifier of another node.
Returns:
True if a edge exists between this node and node 'id'.

hasEdgeFrom

public boolean hasEdgeFrom(String id)
Description copied from interface: Node
True if an edge enters this node from node 'id'.

Specified by:
hasEdgeFrom in interface Node
Parameters:
id - Identifier of the source node.
Returns:
True if a directed edge goes from this node to 'id' or if an undirected edge exists.

hasEdgeToward

public boolean hasEdgeToward(String id)
Description copied from interface: Node
True if an edge leaves this node toward node 'id'.

Specified by:
hasEdgeToward in interface Node
Parameters:
id - Identifier of the target node.
Returns:
True if a directed edge goes from this node to 'id' or if an undirected edge exists.

isDistributed

public boolean isDistributed()

setGraph

public void setGraph(Graph graph)

setGraphName

public void setGraphName(String newHost)

setHost

public void setHost(String newHost)

getEdgeBetween

public <T extends Edge> T getEdgeBetween(Node Node)
Description copied from interface: Node
Retrieves an edge between this node and and another node if one exists.

This method selects directed or undirected edges. If the edge is directed, its direction is not important and leaving or entering edges will be selected.

This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getEdgeBetween(...);
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getEdgeBetween in interface Node
Parameters:
Node - The opposite node.
Returns:
Edge between this node and the parameter node if it exists, else null.

getEdgeBetween

public <T extends Edge> T getEdgeBetween(int index)
Description copied from interface: Node
Retrieves an edge between this node and the node with index i if one exists.

This method selects directed or undirected edges. If the edge is directed, its direction is not important and leaving or entering edges will be selected.

This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getEdgeBetween(...);
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getEdgeBetween in interface Node
Parameters:
index - The index of the opposite node.
Returns:
Edge between node with index i and this node if it exists, else null.

getEdgeFrom

public <T extends Edge> T getEdgeFrom(Node Node)
Description copied from interface: Node
Retrieves an edge that leaves given node toward this node.

This method selects only edges leaving the other node an pointing at this node (this also selects undirected edges).

This method is implicitly generic and returns something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getEdgeFrom(...);
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getEdgeFrom in interface Node
Parameters:
Node - The source node.
Returns:
Directed edge going from the parameter node to this node, or undirected edge if it exists, else null.

getEdgeFrom

public <T extends Edge> T getEdgeFrom(int index)
Description copied from interface: Node
Retrieves an edge that leaves node with given index toward this node.

This method selects only edges leaving the other node an pointing at this node (this also selects undirected edges).

This method is implicitly generic and returns something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getEdgeFrom("...");
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getEdgeFrom in interface Node
Parameters:
index - Index of the source node.
Returns:
Directed edge going from the parameter node to this node, or undirected edge if it exists, else null.

getEdgeToward

public <T extends Edge> T getEdgeToward(Node Node)
Description copied from interface: Node
Retrieves an edge that leaves this node toward another node.

This method selects only edges leaving this node an pointing at the parameter node (this also selects undirected edges).

This method is implicitly generic and returns something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getEdgeToward(...);
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getEdgeToward in interface Node
Parameters:
Node - The target node.
Returns:
Directed edge going from this node to the parameter node, or undirected edge if it exists, else null.

getEdgeToward

public <T extends Edge> T getEdgeToward(int index)
Description copied from interface: Node
Retrieves an edge that leaves this node toward the node with given index.

This method selects only edges leaving this node an pointing at the parameter node (this also selects undirected edges).

This method is implicitly generic and returns something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getEdgeToward(...);
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getEdgeToward in interface Node
Parameters:
index - Index of the target node.
Returns:
Directed edge going from this node to the parameter node, or undirected edge if it exists, else null.

hasEdgeBetween

public boolean hasEdgeBetween(Node node)
Description copied from interface: Node
True if an edge exists between this node and another node.

Specified by:
hasEdgeBetween in interface Node
Parameters:
node - Another node.
Returns:
True if an edge exists between this node and the other node.

hasEdgeBetween

public boolean hasEdgeBetween(int index)
Description copied from interface: Node
True if an edge exists between this node and a node with given index.

Specified by:
hasEdgeBetween in interface Node
Parameters:
index - Index of another node.
Returns:
True if an edge exists between this node and the other node.

hasEdgeFrom

public boolean hasEdgeFrom(Node node)
Description copied from interface: Node
True if an edge enters this node from a given node.

Specified by:
hasEdgeFrom in interface Node
Parameters:
node - The source node.
Returns:
True if a directed edge goes from the other node to this node or if an undirected edge exists.

hasEdgeFrom

public boolean hasEdgeFrom(int index)
Description copied from interface: Node
True if an edge enters this node from a node with given index.

Specified by:
hasEdgeFrom in interface Node
Parameters:
index - Index of the source node.
Returns:
True if a directed edge goes from the other node to this node or if an undirected edge exists.

hasEdgeToward

public boolean hasEdgeToward(Node node)
Description copied from interface: Node
True if an edge leaves this node toward a given node.

Specified by:
hasEdgeToward in interface Node
Parameters:
node - The target node.
Returns:
True if a directed edge goes from this node to the other node or if an undirected edge exists.

hasEdgeToward

public boolean hasEdgeToward(int index)
Description copied from interface: Node
True if an edge leaves this node toward a node with given index.

Specified by:
hasEdgeToward in interface Node
Parameters:
index - Index of the target node.
Returns:
True if a directed edge goes from this node to the other node or if an undirected edge exists.

getEnteringEdge

public <T extends Edge> T getEnteringEdge(int i)
Description copied from interface: Node
I-th entering edge. Edges are stored in no given order.

However this method allows to iterate very quickly on all entering edges, or to choose a given entering edge with direct access.

This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getEnteringEdge(i);
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getEnteringEdge in interface Node
Parameters:
i - Index of the edge.
Returns:
The i-th entering edge.

getLeavingEdge

public <T extends Edge> T getLeavingEdge(int i)
Description copied from interface: Node
I-th leaving edge. Edges are stored in no given order.

However this method allows to iterate very quickly on all leaving edges, or to choose a given leaving edge with direct access.

This method is implicitly generic and return something which extends Edge. The return type is the one of the left part of the assignment. For example, in the following call :

 ExtendedEdge e = node.getLeavingEdge(i);
 
the method will return an ExtendedEdge. If no left part exists, method will just return an Edge.

Specified by:
getLeavingEdge in interface Node
Parameters:
i - Index of the edge.
Returns:
The i-th leaving edge.


Copyright © 2011. All Rights Reserved.