Package org.graffiti.graph
Class AdjListNode
java.lang.Object
org.graffiti.attributes.AbstractAttributable
org.graffiti.graph.AbstractGraphElement
org.graffiti.graph.AbstractNode
org.graffiti.graph.AdjListNode
- All Implemented Interfaces:
Comparable<GraphElement>
,Attributable
,GraphElement
,Node
- Direct Known Subclasses:
MergedNode
public class AdjListNode extends AbstractNode implements Node, GraphElement
Implements a graph node with adjacency list representation.
- Version:
- $Revision: 1.10 $
- See Also:
AdjListGraph
,AdjListEdge
-
Method Summary
Modifier and Type Method Description int
compareTo(GraphElement arg0)
int
getDegree()
Returns the degree of a nodeIterator<Edge>
getDirectedInEdgesIterator()
Returns an iterator containing the directed ingoing 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
.int
getOutDegree()
Returns the out-degree of the currentNode
.Iterator<Edge>
getUndirectedEdgesIterator()
Returns an iterator containing the undirected ingoing and outgoing edges of theNode
.void
setGraph(Graph graph)
String
toString()
Methods inherited from class org.graffiti.graph.AbstractNode
getAllInEdges, getAllInNeighbors, getAllOutEdges, getAllOutNeighbors, getDirectedInEdges, getDirectedOutEdges, getInNeighbors, getInNeighborsIterator, getNeighbors, getNeighborsIterator, getOutNeighbors, getOutNeighborsIterator, getUndirectedEdges, getUndirectedNeighbors, getUndirectedNeighborsIterator
Methods inherited from class org.graffiti.graph.AbstractGraphElement
compareTo, getGraph, getID, getListenerManager, getViewID, setID, setViewID
Methods inherited from class org.graffiti.attributes.AbstractAttributable
addAttribute, addBoolean, addByte, addDouble, addFloat, addInteger, addLong, addShort, addString, changeBoolean, changeByte, changeDouble, changeFloat, changeInteger, changeLong, changeShort, changeString, getAttribute, getAttributes, getBoolean, getByte, getDouble, getFloat, getInteger, getLong, getShort, getString, removeAttribute, setBoolean, setByte, setDouble, setFloat, setInteger, setLong, setShort, setString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
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 org.graffiti.graph.GraphElement
getGraph, getID, getViewID, setID, setViewID
Methods inherited from interface org.graffiti.graph.Node
getAllInEdges, getAllInNeighbors, getAllOutEdges, getAllOutNeighbors, getDirectedInEdges, getDirectedOutEdges, getInNeighbors, getInNeighborsIterator, getNeighbors, getNeighborsIterator, getOutNeighbors, getOutNeighborsIterator, getUndirectedEdges, getUndirectedNeighbors, getUndirectedNeighborsIterator
-
Method Details
-
getDirectedInEdgesIterator
Returns an iterator containing the directed ingoing edges of theNode
.- Specified by:
getDirectedInEdgesIterator
in interfaceNode
- Returns:
- an iterator containing the directed ingoing edges of the
Node
.
-
getDirectedOutEdgesIterator
Returns an iterator containing the outgoing directed edges of theNode
.- Specified by:
getDirectedOutEdgesIterator
in interfaceNode
- Returns:
- an iterator containing the outgoing directed edges of the
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.- Specified by:
getEdgesIterator
in interfaceNode
- Returns:
- an iterator containing all ingoing and outgoing directed and
undirected edges of the current
Node
.
-
getInDegree
public 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.- Specified by:
getInDegree
in interfaceNode
- Overrides:
getInDegree
in classAbstractNode
- Returns:
- the in-degree of the current
Node
.
-
getOutDegree
public 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.- Specified by:
getOutDegree
in interfaceNode
- Overrides:
getOutDegree
in classAbstractNode
- Returns:
- the out-degree of the current
Node
.
-
getUndirectedEdgesIterator
Returns an iterator containing the undirected ingoing and outgoing edges of theNode
.- Specified by:
getUndirectedEdgesIterator
in interfaceNode
- Returns:
- a iterator containing the undirected ingoing and outgoing edges of
the
Node
.
-
getEdges
Description copied from class:AbstractNode
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.- Specified by:
getEdges
in interfaceNode
- Overrides:
getEdges
in classAbstractNode
- Returns:
- a collection containing all ingoing and outgoing directed and
undirected edges of the current
Node
.
-
setGraph
-
toString
-
getDegree
public int getDegree()Description copied from interface:Node
Returns the degree of a node -
compareTo
- Specified by:
compareTo
in interfaceComparable<GraphElement>
-