Package org.graph4j.util
Class EdgeArray
java.lang.Object
org.graph4j.util.EdgeArray
Deprecated.
A primitive collection of edges in a graph.
- Author:
- Cristian Frăsinaru
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intDeprecated.protected int[][]Deprecated.protected final GraphDeprecated.protected intDeprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(int v, int u) Deprecated.Adds an edge to the collection.booleanDeprecated.Adds an edge to the collection.voidaddAll(int[]... edges) Deprecated.booleancontains(int v, int u) Deprecated.Checks if an edge belongs to the collection.int[][]edges()Deprecated.For performance reasons, the returned array represents the actual data structure where edges of the collection are stored, so it must not be modified.booleanDeprecated.protected voidgrow()Deprecated.inthashCode()Deprecated.intindexOf(int v, int u) Deprecated.intindexOf(int v, int u, int startPos) Deprecated.booleanisEmpty()Deprecated.intnumEdges()Deprecated.Same assize().booleanremove(int v, int u) Deprecated.Removes an edge from the collection.booleanDeprecated.Removes an edge from the collection.voidremoveFromPos(int pos) Deprecated.voidDeprecated.Removes the last edge of the collection.intsize()Deprecated.Same asnumVertices().toString()Deprecated.Deprecated.int[]vertices()Deprecated.doubleweight()Deprecated.Computes the sum of the weights associated with each edge in the collection.
-
Field Details
-
graph
Deprecated. -
edges
protected int[][] edgesDeprecated. -
numEdges
protected int numEdgesDeprecated. -
DEFAULT_CAPACITY
protected static final int DEFAULT_CAPACITYDeprecated.- See Also:
-
-
Constructor Details
-
EdgeArray
Deprecated.- Parameters:
graph- the graph the edges belong to.
-
EdgeArray
Deprecated.- Parameters:
graph- the graph the edges belong to.initialCapacity- the initial capacity of this collection.
-
EdgeArray
Deprecated.- Parameters:
graph- the graph the edges belong to.edges- the initial set of edges.
-
EdgeArray
Deprecated.- Parameters:
graph- the graph the edges belong to.edges- the initial set of edges.
-
-
Method Details
-
isEmpty
public boolean isEmpty()Deprecated.- Returns:
trueif this collection has no edges.
-
numEdges
public int numEdges()Deprecated.Same assize().- Returns:
- the number of edges in the collection.
-
size
public int size()Deprecated.Same asnumVertices().- Returns:
- the number of edges in the collection.
-
edges
public int[][] edges()Deprecated.For performance reasons, the returned array represents the actual data structure where edges of the collection are stored, so it must not be modified.- Returns:
- the edges in the collection.
-
indexOf
public int indexOf(int v, int u) Deprecated. -
indexOf
public int indexOf(int v, int u, int startPos) Deprecated. -
add
public boolean add(int v, int u) Deprecated.Adds an edge to the collection.- Parameters:
v- a vertex number.u- a vertex number.- Returns:
true, if the collection changed as a result of this call,falseotherwise.
-
add
Deprecated.Adds an edge to the collection.- Parameters:
e- an edge.- Returns:
trueif the collection was modified as a result of this invocation,falseotherwise.
-
addAll
public void addAll(int[]... edges) Deprecated.- Parameters:
edges- an array of edges.
-
remove
public boolean remove(int v, int u) Deprecated.Removes an edge from the collection.- Parameters:
v- a vertex number.u- a vertex number.- Returns:
true, if the collection was modified as a result of this invocation,falseotherwise.
-
remove
Deprecated.Removes an edge from the collection.- Parameters:
e- the edge to be removed.- Returns:
true, if the collection was modified as a result of this invocation,falseotherwise.
-
removeLast
public void removeLast()Deprecated.Removes the last edge of the collection. -
removeFromPos
public void removeFromPos(int pos) Deprecated. -
contains
public boolean contains(int v, int u) Deprecated.Checks if an edge belongs to the collection.- Parameters:
v- a vertex number.u- a vertex number.- Returns:
true, if this collection contains the edge (v,u),falseotherwise.
-
weight
public double weight()Deprecated.Computes the sum of the weights associated with each edge in the collection.- Returns:
- the sum of all weights of the edges in the collection, including duplicates.
-
grow
protected void grow()Deprecated. -
vertexSet
Deprecated.- Returns:
- the vertices representing endpoints of the edges in this collection.
-
vertices
public int[] vertices()Deprecated.- Returns:
- the vertices representing endpoints of the edges in this collection.
-
hashCode
public int hashCode()Deprecated. -
equals
Deprecated. -
toString
Deprecated.
-