public class GraphImplLinearEdge<V> extends java.lang.Object implements Graph<V>
Constructor and Description |
---|
GraphImplLinearEdge(java.lang.Class<?> clazz) |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(int source,
int target,
long weight)
Adds an edge.
|
void |
addEdge(V source,
V target,
long weight)
Adds an edge.
|
void |
addVertex(int vertexIndex) |
int |
addVertex(V x)
Add a vertex to the graph.
|
void |
addVertices(java.util.Collection<V> xs) |
void |
addVertices(V[] xs) |
Graph<V> |
clone() |
boolean |
containsEdge(int source,
int target)
Returns whether the graph contains an edge between source and target.
|
boolean |
containsEdge(V source,
V target)
Returns whether the graph contains an edge between source and target.
|
java.lang.Iterable<java.lang.Long> |
getEdges()
Gives an iterable that iterates over all edges; The edges that are
returned are indices.
|
java.lang.Iterable<java.lang.Long> |
getEdgesOf(int indexOfV)
Return an iterable of edgeIndex containing all edges of which v is a
source or a target.
|
java.lang.Iterable<java.lang.Long> |
getEdgesOf(V v)
Return an iterable of edgeIndex containing all edges of which v is a
source or a target.
|
V |
getEdgeSource(long edgeIndex)
Returns the vertex the edgeIndex comes from.
|
int |
getEdgeSourceIndex(long edgeIndex)
Returns the vertex the edgeIndex comes from.
|
V |
getEdgeTarget(long edgeIndex)
Returns the vertex the edgeIndex points to.
|
int |
getEdgeTargetIndex(long edgeIndex)
Returns the index of the vertex the edgeIndex points to.
|
long |
getEdgeWeight(int source,
int target)
Returns the weight of an edge between source and target.
|
long |
getEdgeWeight(long edgeIndex)
Returns the weight of an edge.
|
long |
getEdgeWeight(V source,
V target)
Returns the weight of an edge.
|
java.lang.Iterable<java.lang.Long> |
getIncomingEdgesOf(int v)
Returns an array of edge index, containing all edges of which v is the
target.
|
java.lang.Iterable<java.lang.Long> |
getIncomingEdgesOf(V v)
Returns an array of edge index, containing all edges of which v is the
target.
|
int |
getIndexOfVertex(V v) |
int |
getNumberOfVertices() |
java.lang.Iterable<java.lang.Long> |
getOutgoingEdgesOf(int v)
Returns an array of edge index, containing all edges of which v is the
source.
|
java.lang.Iterable<java.lang.Long> |
getOutgoingEdgesOf(V v)
Returns an array of edge index, containing all edges of which v is the
source.
|
int[] |
getVertexIndices() |
V |
getVertexOfIndex(int index) |
V[] |
getVertices() |
long |
getWeightOfHeaviestEdge()
Returns the weight of the edge with the highest weight.
|
void |
removeEdge(long edge) |
java.lang.String |
toString() |
public int addVertex(V x)
Graph
public void addVertices(java.util.Collection<V> xs)
addVertices
in interface Graph<V>
public void addVertices(V[] xs)
addVertices
in interface Graph<V>
public void addEdge(int source, int target, long weight)
NormalisedIntGraph
addEdge
in interface NormalisedIntGraph
public void removeEdge(long edge)
public void addEdge(V source, V target, long weight)
Graph
public V getVertexOfIndex(int index)
getVertexOfIndex
in interface Graph<V>
public V[] getVertices()
getVertices
in interface Graph<V>
public int[] getVertexIndices()
getVertexIndices
in interface Graph<V>
public int getNumberOfVertices()
getNumberOfVertices
in interface Graph<V>
public java.lang.Iterable<java.lang.Long> getEdges()
NormalisedIntGraph
getEdges
in interface NormalisedIntGraph
public boolean containsEdge(V source, V target)
Graph
containsEdge
in interface Graph<V>
public boolean containsEdge(int source, int target)
NormalisedIntGraph
containsEdge
in interface NormalisedIntGraph
public V getEdgeSource(long edgeIndex)
Graph
getEdgeSource
in interface Graph<V>
public int getEdgeSourceIndex(long edgeIndex)
NormalisedIntGraph
getEdgeSourceIndex
in interface NormalisedIntGraph
public V getEdgeTarget(long edgeIndex)
Graph
getEdgeTarget
in interface Graph<V>
public int getEdgeTargetIndex(long edgeIndex)
NormalisedIntGraph
getEdgeTargetIndex
in interface NormalisedIntGraph
public long getEdgeWeight(long edgeIndex)
NormalisedIntGraph
getEdgeWeight
in interface NormalisedIntGraph
public long getEdgeWeight(int source, int target)
NormalisedIntGraph
getEdgeWeight
in interface NormalisedIntGraph
public long getEdgeWeight(V source, V target)
Graph
getEdgeWeight
in interface Graph<V>
public java.lang.Iterable<java.lang.Long> getIncomingEdgesOf(V v)
Graph
getIncomingEdgesOf
in interface Graph<V>
public java.lang.Iterable<java.lang.Long> getIncomingEdgesOf(int v)
NormalisedIntGraph
getIncomingEdgesOf
in interface NormalisedIntGraph
public java.lang.Iterable<java.lang.Long> getOutgoingEdgesOf(V v)
Graph
getOutgoingEdgesOf
in interface Graph<V>
public java.lang.Iterable<java.lang.Long> getOutgoingEdgesOf(int v)
NormalisedIntGraph
getOutgoingEdgesOf
in interface NormalisedIntGraph
public java.lang.Iterable<java.lang.Long> getEdgesOf(V v)
Graph
getEdgesOf
in interface Graph<V>
public java.lang.Iterable<java.lang.Long> getEdgesOf(int indexOfV)
NormalisedIntGraph
getEdgesOf
in interface NormalisedIntGraph
public long getWeightOfHeaviestEdge()
NormalisedIntGraph
getWeightOfHeaviestEdge
in interface NormalisedIntGraph
public java.lang.String toString()
toString
in class java.lang.Object
public Graph<V> clone()
clone
in interface Graph<V>
clone
in interface NormalisedIntGraph
clone
in class java.lang.Object
public int getIndexOfVertex(V v)
getIndexOfVertex
in interface Graph<V>
public void addVertex(int vertexIndex)