Package org.graffiti.graph
Interface Node
- All Superinterfaces:
Attributable
,Comparable<GraphElement>
,GraphElement
- All Known Implementing Classes:
AbstractNode
,AdjListNode
,MergedNode
,NodeHelper
public interface Node extends GraphElement
Provides an interfaces for a graph node. All directed edges whose source is
the current
Node
are regarded as outgoing edges. Ingoing edges
are those directed edges whose target is the current Node
.
Undirected edges are regarded separately since a Graph
can have
both directed and indirected edges.- Version:
- $Revision: 1.6 $
- See Also:
Edge
,GraphElement
,Graph
-
Method Summary
Modifier and Type Method Description Collection<Edge>
getAllInEdges()
Union ofgetDirectedInEdges()
andgetUndirectedEdges()
.Collection<Node>
getAllInNeighbors()
Union ofgetInNeighbors()
andgetUndirectedNeighbors()
.Collection<Edge>
getAllOutEdges()
Union ofgetDirectedOutEdges()
andgetUndirectedEdges()
.Collection<Node>
getAllOutNeighbors()
Union ofgetOutNeighbors()
andgetUndirectedNeighbors()
.int
getDegree()
Returns the degree of a nodeCollection<Edge>
getDirectedInEdges()
Returns a collection containing the directed ingoing edges of theNode
.Iterator<Edge>
getDirectedInEdgesIterator()
Returns an iterator containing the directed ingoing edges of theNode
.Collection<Edge>
getDirectedOutEdges()
Returns a collection containing the outgoing directed edges of theNode
.Iterator<Edge>
getDirectedOutEdgesIterator()
Returns an iterator containing the outgoing directed edges of theNode
.Collection<Edge>
getEdges()
Returns a collection containing all the ingoing and outgoing directed and undirected edges of the currentNode
.Iterator<Edge>
getEdgesIterator()
Returns an iterator containing all the ingoing and outgoing directed and undirected edges of the currentNode
.int
getInDegree()
Returns the in-degree of the currentNode
.Set<Node>
getInNeighbors()
Returns a collection containing the neighbor nodes belonging to incoming edges.Iterator<Node>
getInNeighborsIterator()
Returns an iterator over the neighbor nodes belonging to incoming edges.Set<Node>
getNeighbors()
Returns a collection containing all the neighbor nodes of the currentNode
.Iterator<Node>
getNeighborsIterator()
Returns an interator over the neighbor nodes of the currentNode
.int
getOutDegree()
Returns the out-degree of the currentNode
.Set<Node>
getOutNeighbors()
Returns a collection containing all the neighbors of the currentNode
which are connected by an outgoingEdge
.Iterator<Node>
getOutNeighborsIterator()
Returns an iterator containing all the neighbors of the currentNode
which are connected by an outgoingEdge
.Collection<Edge>
getUndirectedEdges()
Returns a collection containing the undirected ingoing and outgoing edges of theNode
.Iterator<Edge>
getUndirectedEdgesIterator()
Returns an iterator containing all undirected edges of theNode
.Collection<Node>
getUndirectedNeighbors()
Returns a collection containing all the neighbors which are connected to the currentNode
by an undirectedEdge
.Iterator<Node>
getUndirectedNeighborsIterator()
void
setGraph(Graph graph)
Methods inherited from interface org.graffiti.attributes.Attributable
addAttribute, addBoolean, addByte, addDouble, addFloat, addInteger, addLong, addShort, addString, changeBoolean, changeByte, changeDouble, changeFloat, changeInteger, changeLong, changeShort, changeString, getAttribute, getAttributes, getBoolean, getByte, getDouble, getFloat, getInteger, getListenerManager, getLong, getShort, getString, removeAttribute, setBoolean, setByte, setDouble, setFloat, setInteger, setLong, setShort, setString
Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getAllInEdges
Collection<Edge> getAllInEdges()Union ofgetDirectedInEdges()
andgetUndirectedEdges()
.- Returns:
- Collection
-
getAllInNeighbors
Collection<Node> getAllInNeighbors()Union ofgetInNeighbors()
andgetUndirectedNeighbors()
.- Returns:
- Collection
-
getAllOutEdges
Collection<Edge> getAllOutEdges()Union ofgetDirectedOutEdges()
andgetUndirectedEdges()
.- Returns:
- Collection
-
getAllOutNeighbors
Collection<Node> getAllOutNeighbors()Union ofgetOutNeighbors()
andgetUndirectedNeighbors()
.- Returns:
- Collection
-
getDirectedInEdges
Collection<Edge> getDirectedInEdges()Returns a collection containing the directed ingoing edges of theNode
.- Returns:
- a collection containing the directed ingoing edges of the
Node
.
-
getDirectedInEdgesIterator
Returns an iterator containing the directed ingoing edges of theNode
.- Returns:
- an iterator containing the directed ingoing edges of the
Node
.
-
getDirectedOutEdges
Collection<Edge> getDirectedOutEdges()Returns a collection containing the outgoing directed edges of theNode
.- Returns:
- a collection containing the outgoing directed edges of the
Node
.
-
getDirectedOutEdgesIterator
Returns an iterator containing the outgoing directed edges of theNode
.- Returns:
- an iterator containing the outgoing directed edges of the
Node
.
-
getEdges
Collection<Edge> getEdges()Returns a collection containing all the ingoing and outgoing directed and undirected edges of the currentNode
. Ingoing and outgoing edges will not be separated and there will be no ordering on the collection.- Returns:
- a collection containing all ingoing and outgoing directed and
undirected edges of the current
Node
.
-
getEdgesIterator
Returns an iterator containing all the ingoing and outgoing directed and undirected edges of the currentNode
. Ingoing and outgoing edges will not be separated and there will be no ordering on the collection.- Returns:
- an iterator containing all ingoing and outgoing directed and
undirected edges of the current
Node
.
-
getInDegree
int getInDegree()Returns the in-degree of the currentNode
. The in-degree is defined as the number of ingoing, directed edges plus the number of undirected edges.- Returns:
- the in-degree of the current
Node
.
-
getInNeighbors
Returns a collection containing the neighbor nodes belonging to incoming edges. Note that the number of Elements returned by this function might be less than the number returned bygetInDegree()
, due to the fact that multiple edges between the same two nodes are possible but the correspondingNode
is only inserted once.- Returns:
- a collection containing the neighbor nodes belonging to incoming edges.
-
getInNeighborsIterator
Returns an iterator over the neighbor nodes belonging to incoming edges.- Returns:
- a Iterator over the neighbor nodes belonging to incoming edges.
-
getNeighbors
Returns a collection containing all the neighbor nodes of the currentNode
. A neighborNode
is either the source or the target of either an ingoing or an outgoing or an undirectedEdge
.- Returns:
- a collection containing all the neighbor nodes of the current
Node
.
-
getNeighborsIterator
Returns an interator over the neighbor nodes of the currentNode
. A neighborNode
is either the source or the target of either an ingoing or outgoing or undirectedEdge
.- Returns:
- an iterator over the neighbor nodes of the current
Node
.
-
getOutDegree
int getOutDegree()Returns the out-degree of the currentNode
. The out-degree is defined as the number of outgoing, directed edges plus the number of undirected edges.- Returns:
- the out-degree of the current
Node
.
-
getOutNeighbors
Returns a collection containing all the neighbors of the currentNode
which are connected by an outgoingEdge
. Note that the number of elements returned by this function might be less than the number returned bygetOutDegree()
, due to the fact that multiple edges between the same two nodes are possible but the correspondingNode
is only inserted once.- Returns:
- a collection containing all the neighbor nodes of the current
Node
connected by an outgoingEdge
.
-
getOutNeighborsIterator
Returns an iterator containing all the neighbors of the currentNode
which are connected by an outgoingEdge
.- Returns:
- an iterator containing all the neighbor
Node
s of the currentNode
connected by an outgoingEdge
.
-
getUndirectedEdges
Collection<Edge> getUndirectedEdges()Returns a collection containing the undirected ingoing and outgoing edges of theNode
.- Returns:
- a collection containing the undirected ingoing and outgoing edges of
the
Node
.
-
getUndirectedEdgesIterator
Returns an iterator containing all undirected edges of theNode
.- Returns:
- an iterator containing all undirected edges of the
Node
.
-
getUndirectedNeighbors
Collection<Node> getUndirectedNeighbors()Returns a collection containing all the neighbors which are connected to the currentNode
by an undirectedEdge
.- Returns:
- a collection containing all the neighbors which are connected to the
current
Node
by an undirectedEdge
.
-
getUndirectedNeighborsIterator
-
setGraph
- Parameters:
graph
-
-
getDegree
int getDegree()Returns the degree of a node- Returns:
- Returns the number of incoming directed edges + outgooing directed edges + number of connected undirected edges.
-