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 intcompareTo(GraphElement arg0)intgetDegree()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.intgetInDegree()Returns the in-degree of the currentNode.intgetOutDegree()Returns the out-degree of the currentNode.Iterator<Edge>getUndirectedEdgesIterator()Returns an iterator containing the undirected ingoing and outgoing edges of theNode.voidsetGraph(Graph graph)StringtoString()Methods inherited from class org.graffiti.graph.AbstractNode
getAllInEdges, getAllInNeighbors, getAllOutEdges, getAllOutNeighbors, getDirectedInEdges, getDirectedOutEdges, getInNeighbors, getInNeighborsIterator, getNeighbors, getNeighborsIterator, getOutNeighbors, getOutNeighborsIterator, getUndirectedEdges, getUndirectedNeighbors, getUndirectedNeighborsIteratorMethods inherited from class org.graffiti.graph.AbstractGraphElement
compareTo, getGraph, getID, getListenerManager, getViewID, setID, setViewIDMethods 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, setStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, setStringMethods inherited from interface org.graffiti.graph.GraphElement
getGraph, getID, getViewID, setID, setViewIDMethods 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:
getDirectedInEdgesIteratorin 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:
getDirectedOutEdgesIteratorin 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:
getEdgesIteratorin 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:
getInDegreein interfaceNode- Overrides:
getInDegreein 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:
getOutDegreein interfaceNode- Overrides:
getOutDegreein classAbstractNode- Returns:
- the out-degree of the current
Node.
-
getUndirectedEdgesIterator
Returns an iterator containing the undirected ingoing and outgoing edges of theNode.- Specified by:
getUndirectedEdgesIteratorin interfaceNode- Returns:
- a iterator containing the undirected ingoing and outgoing edges of
the
Node.
-
getEdges
Description copied from class:AbstractNodeReturns 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:
getEdgesin interfaceNode- Overrides:
getEdgesin 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:NodeReturns the degree of a node -
compareTo
- Specified by:
compareToin interfaceComparable<GraphElement>
-