org.graphstream.graph.implementations
Class AdjacencyListNode

java.lang.Object
  extended by org.graphstream.graph.implementations.AbstractElement
      extended by org.graphstream.graph.implementations.AbstractNode
          extended by org.graphstream.graph.implementations.AdjacencyListNode
All Implemented Interfaces:
Iterable<Edge>, Element, Node
Direct Known Subclasses:
MultiNode, SingleNode

public class AdjacencyListNode
extends AbstractNode

Nodes used with AdjacencyListGraph


Nested Class Summary
 
Nested classes/interfaces inherited from class org.graphstream.graph.implementations.AbstractElement
AbstractElement.AttributeChangeEvent
 
Method Summary
 int getDegree()
          Total number of relations with other nodes or this node.
<T extends Edge>
T
getEdge(int i)
          I-th edge.
<T extends Edge>
T
getEdgeBetween(Node node)
          Retrieves an edge between this node and and another node if one exists.
<T extends Edge>
T
getEdgeFrom(Node node)
          Retrieves an edge that leaves given node toward this node.
<T extends Edge>
Iterator<T>
getEdgeIterator()
          Iterator on the set of connected edges.
<T extends Edge>
T
getEdgeToward(Node node)
          Retrieves an edge that leaves this node toward another node.
<T extends Edge>
T
getEnteringEdge(int i)
          I-th entering edge.
<T extends Edge>
Iterator<T>
getEnteringEdgeIterator()
          Iterator only on leaving edges.
 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.
 int getOutDegree()
          Number of leaving edges.
 
Methods inherited from class org.graphstream.graph.implementations.AbstractNode
getBreadthFirstIterator, getBreadthFirstIterator, getDepthFirstIterator, getDepthFirstIterator, getEachEdge, getEachEnteringEdge, getEachLeavingEdge, getEdgeBetween, getEdgeBetween, getEdgeFrom, getEdgeFrom, getEdgeSet, getEdgeToward, getEdgeToward, getEnteringEdgeSet, getGraph, getLeavingEdgeSet, getNeighborNodeIterator, hasEdgeBetween, hasEdgeBetween, hasEdgeBetween, hasEdgeFrom, hasEdgeFrom, hasEdgeFrom, hasEdgeToward, hasEdgeToward, hasEdgeToward, isEnteringEdge, isIncidentEdge, isLeavingEdge, iterator
 
Methods inherited from class org.graphstream.graph.implementations.AbstractElement
addAttribute, 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, toString, 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
 

Method Detail

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
Specified by:
getDegree in class AbstractNode
Returns:
The number of edges/relations/links.

getInDegree

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

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

getOutDegree

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

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

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
Specified by:
getEdge in class AbstractNode
Parameters:
i - Index of the edge.
Returns:
The i-th edge.

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
Specified by:
getEnteringEdge in class AbstractNode
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
Specified by:
getLeavingEdge in class AbstractNode
Parameters:
i - Index of the edge.
Returns:
The i-th leaving edge.

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
Specified by:
getEdgeBetween in class AbstractNode
Parameters:
node - The opposite node.
Returns:
Edge between this node and the parameter 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
Specified by:
getEdgeFrom in class AbstractNode
Parameters:
node - 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
Specified by:
getEdgeToward in class AbstractNode
Parameters:
node - The target node.
Returns:
Directed edge going from this node to the parameter 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
Specified by:
getEdgeIterator in class AbstractNode
Returns:
The iterator, edges are iterated in arbitrary order.

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
Specified by:
getEnteringEdgeIterator in class AbstractNode
Returns:
The iterator, edges are iterated in arbitrary order.

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
Specified by:
getLeavingEdgeIterator in class AbstractNode
Returns:
The iterator, edges are iterated in arbitrary order.


Copyright © 2012. All Rights Reserved.