- java.lang.Object
-
- org.jruby.dirgra.Vertex<T>
-
- All Implemented Interfaces:
java.lang.Comparable<Vertex<T>>
public class Vertex<T extends ExplicitVertexID> extends java.lang.Object implements java.lang.Comparable<Vertex<T>>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
Vertex.DestinationCompare
(package private) class
Vertex.SourceCompare
-
Field Summary
Fields Modifier and Type Field Description private T
data
private static Edge[]
EMPTY_EDGE_LIST
private DirectedGraph
graph
(package private) int
id
private Edge<T>[]
incoming
private int
incomingLength
private Edge<T>[]
outgoing
private int
outgoingLength
-
Constructor Summary
Constructors Constructor Description Vertex(DirectedGraph graph, T data, int id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEdgeTo(Vertex destination)
void
addEdgeTo(Vertex destination, java.lang.Object type)
void
addEdgeTo(T destination)
void
addEdgeTo(T destination, java.lang.Object type)
protected void
addIncomingEdge(Edge<T> newEdge)
protected void
addOutgoingEdge(Edge<T> newEdge)
int
compareTo(Vertex<T> that)
T
getData()
private Edge<T>
getFirstEdge(java.util.Iterator<Edge<T>> iterator)
int
getID()
Edge<T>
getIncomingEdge()
Edge<T>
getIncomingEdgeOfType(java.lang.Object type)
java.util.Collection<Edge<T>>
getIncomingEdges()
java.lang.Iterable<Edge<T>>
getIncomingEdgesNotOfType(java.lang.Object type)
java.lang.Iterable<Edge<T>>
getIncomingEdgesOfType(java.lang.Object type)
T
getIncomingSourceData()
T
getIncomingSourceDataOfType(java.lang.Object type)
java.lang.Iterable<T>
getIncomingSourcesData()
java.lang.Iterable<T>
getIncomingSourcesDataNotOfType(java.lang.Object type)
java.lang.Iterable<T>
getIncomingSourcesDataOfType(java.lang.Object type)
T
getOutgoingDestinationData()
T
getOutgoingDestinationDataOfType(java.lang.Object type)
java.lang.Iterable<T>
getOutgoingDestinationsData()
java.lang.Iterable<T>
getOutgoingDestinationsDataNotOfType(java.lang.Object type)
java.lang.Iterable<T>
getOutgoingDestinationsDataOfType(java.lang.Object type)
Edge<T>
getOutgoingEdge()
Edge<T>
getOutgoingEdgeOfType(java.lang.Object type)
java.util.Collection<Edge<T>>
getOutgoingEdges()
java.lang.Iterable<Edge<T>>
getOutgoingEdgesNotOfType(java.lang.Object type)
java.lang.Iterable<Edge<T>>
getOutgoingEdgesOfType(java.lang.Object type)
int
inDegree()
int
outDegree()
void
removeAllEdges()
void
removeAllIncomingEdges()
void
removeAllOutgoingEdges()
boolean
removeEdgeTo(Vertex destination)
protected void
removeIncomingEdge(Edge<T> edge)
protected void
removeOutgoingEdge(Edge<T> edge)
java.lang.String
toString()
-
-
-
Field Detail
-
EMPTY_EDGE_LIST
private static final Edge[] EMPTY_EDGE_LIST
-
graph
private DirectedGraph graph
-
data
private T extends ExplicitVertexID data
-
incoming
private Edge<T extends ExplicitVertexID>[] incoming
-
incomingLength
private int incomingLength
-
outgoing
private Edge<T extends ExplicitVertexID>[] outgoing
-
outgoingLength
private int outgoingLength
-
id
int id
-
-
Constructor Detail
-
Vertex
public Vertex(DirectedGraph graph, T data, int id)
-
-
Method Detail
-
addEdgeTo
public void addEdgeTo(Vertex destination)
-
addEdgeTo
public void addEdgeTo(Vertex destination, java.lang.Object type)
-
addEdgeTo
public void addEdgeTo(T destination)
-
addEdgeTo
public void addEdgeTo(T destination, java.lang.Object type)
-
removeEdgeTo
public boolean removeEdgeTo(Vertex destination)
-
removeAllIncomingEdges
public void removeAllIncomingEdges()
-
removeAllOutgoingEdges
public void removeAllOutgoingEdges()
-
removeAllEdges
public void removeAllEdges()
-
inDegree
public int inDegree()
-
outDegree
public int outDegree()
-
getIncomingEdgesOfType
public java.lang.Iterable<Edge<T>> getIncomingEdgesOfType(java.lang.Object type)
-
getIncomingEdgesNotOfType
public java.lang.Iterable<Edge<T>> getIncomingEdgesNotOfType(java.lang.Object type)
-
getOutgoingEdgesOfType
public java.lang.Iterable<Edge<T>> getOutgoingEdgesOfType(java.lang.Object type)
-
getIncomingSourceData
public T getIncomingSourceData()
-
getIncomingSourceDataOfType
public T getIncomingSourceDataOfType(java.lang.Object type)
-
getIncomingSourcesData
public java.lang.Iterable<T> getIncomingSourcesData()
-
getIncomingSourcesDataOfType
public java.lang.Iterable<T> getIncomingSourcesDataOfType(java.lang.Object type)
-
getIncomingSourcesDataNotOfType
public java.lang.Iterable<T> getIncomingSourcesDataNotOfType(java.lang.Object type)
-
getOutgoingEdgesNotOfType
public java.lang.Iterable<Edge<T>> getOutgoingEdgesNotOfType(java.lang.Object type)
-
getOutgoingDestinationsData
public java.lang.Iterable<T> getOutgoingDestinationsData()
-
getOutgoingDestinationsDataOfType
public java.lang.Iterable<T> getOutgoingDestinationsDataOfType(java.lang.Object type)
-
getOutgoingDestinationsDataNotOfType
public java.lang.Iterable<T> getOutgoingDestinationsDataNotOfType(java.lang.Object type)
-
getOutgoingDestinationData
public T getOutgoingDestinationData()
-
getOutgoingDestinationDataOfType
public T getOutgoingDestinationDataOfType(java.lang.Object type)
-
getData
public T getData()
-
getID
public int getID()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(Vertex<T> that)
- Specified by:
compareTo
in interfacejava.lang.Comparable<T extends ExplicitVertexID>
-
-