Class AdjacencyListNode
- Direct Known Subclasses:
MultiNode,SingleNode
public class AdjacencyListNode extends AbstractNode
AdjacencyListGraph-
Nested Class Summary
Nested classes/interfaces inherited from class org.graphstream.graph.implementations.AbstractElement
AbstractElement.AttributeChangeEvent -
Method Summary
Modifier and Type Method Description Stream<Edge>edges()Stream over all entering and leaving edges.Stream<Edge>enteringEdges()Stream over all entering edges.intgetDegree()Total number of relations with other nodes or this node.EdgegetEdge(int i)I-th edge.EdgegetEdgeBetween(Node node)Retrieves an edge between this node and and another node if one exists.EdgegetEdgeFrom(Node node)Retrieves an edge that leaves given node toward this node.EdgegetEdgeToward(Node node)Retrieves an edge that leaves this node toward another node.EdgegetEnteringEdge(int i)I-th entering edge.intgetInDegree()Number of entering edges.EdgegetLeavingEdge(int i)I-th leaving edge.intgetOutDegree()Number of leaving edges.Stream<Edge>leavingEdges()Stream over all leaving edges.Methods inherited from class org.graphstream.graph.implementations.AbstractNode
getBreadthFirstIterator, getBreadthFirstIterator, getDepthFirstIterator, getDepthFirstIterator, getEdgeBetween, getEdgeBetween, getEdgeFrom, getEdgeFrom, getEdgeToward, getEdgeToward, getGraph, isEnteringEdge, isIncidentEdge, isLeavingEdgeMethods inherited from class org.graphstream.graph.implementations.AbstractElement
attributeKeys, clearAttributes, getAttribute, getAttribute, getAttributeCount, getFirstAttributeOf, getFirstAttributeOf, getId, getIndex, hasAttribute, hasAttribute, removeAttribute, setAttribute, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.graphstream.graph.Element
attributeKeys, clearAttributes, getArray, getAttribute, getAttribute, getAttributeCount, getFirstAttributeOf, getFirstAttributeOf, getId, getIndex, getLabel, getMap, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasLabel, hasMap, hasNumber, hasVector, removeAttribute, setAttribute, setAttributesMethods inherited from interface org.graphstream.graph.Node
hasEdgeBetween, hasEdgeBetween, hasEdgeBetween, hasEdgeFrom, hasEdgeFrom, hasEdgeFrom, hasEdgeToward, hasEdgeToward, hasEdgeToward, iterator, neighborNodes, toString
-
Method Details
-
getDegree
public int getDegree()Description copied from interface:NodeTotal number of relations with other nodes or this node.- Returns:
- The number of edges/relations/links.
-
getInDegree
public int getInDegree()Description copied from interface:NodeNumber of entering edges.- Returns:
- the count of edges that only enter this node plus all undirected edges.
-
getOutDegree
public int getOutDegree()Description copied from interface:NodeNumber of leaving edges.- Returns:
- the count of edges that only leave this node plus all undirected edges.
-
getEdge
Description copied from interface:NodeI-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.- Parameters:
i- Index of the edge.- Returns:
- The i-th edge.
-
getEnteringEdge
Description copied from interface:NodeI-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.- Parameters:
i- Index of the edge.- Returns:
- The i-th entering edge.
-
getLeavingEdge
Description copied from interface:NodeI-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.- Parameters:
i- Index of the edge.- Returns:
- The i-th leaving edge.
-
getEdgeBetween
Description copied from interface:NodeRetrieves 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.- Parameters:
node- The opposite node.- Returns:
- Edge between this node and the parameter node if it exists, else null.
-
getEdgeFrom
Description copied from interface:NodeRetrieves 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.- 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
Description copied from interface:NodeRetrieves 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.- Parameters:
node- The target node.- Returns:
- Directed edge going from this node to the parameter node, or undirected edge if it exists, else null.
-
edges
Description copied from interface:NodeStream over all entering and leaving edges.- Returns:
- A stream over all directed and undirected edges, leaving or entering.
-
enteringEdges
Description copied from interface:NodeStream over all entering edges.- Returns:
- A stream over only edges that enter this node plus all undirected edges.
-
leavingEdges
Description copied from interface:NodeStream over all leaving edges.- Returns:
- A stream over only edges that leave this node plus all undirected edges.
-