Class EdgeArray

java.lang.Object
org.graph4j.util.EdgeArray

@Deprecated public class EdgeArray extends Object
Deprecated.
A primitive collection of edges in a graph.
Author:
Cristian Frăsinaru
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final int
    Deprecated.
     
    protected int[][]
    Deprecated.
     
    protected final Graph
    Deprecated.
     
    protected int
    Deprecated.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
    EdgeArray(Graph graph, int initialCapacity)
    Deprecated.
     
    EdgeArray(Graph graph, int[][] edges)
    Deprecated.
     
    EdgeArray(Graph graph, Edge[] edges)
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(int v, int u)
    Deprecated.
    Adds an edge to the collection.
    boolean
    add(Edge e)
    Deprecated.
    Adds an edge to the collection.
    void
    addAll(int[]... edges)
    Deprecated.
     
    boolean
    contains(int v, int u)
    Deprecated.
    Checks if an edge belongs to the collection.
    int[][]
    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.
    boolean
    Deprecated.
     
    protected void
    Deprecated.
     
    int
    Deprecated.
     
    int
    indexOf(int v, int u)
    Deprecated.
     
    int
    indexOf(int v, int u, int startPos)
    Deprecated.
     
    boolean
    Deprecated.
     
    int
    Deprecated.
    Same as size().
    boolean
    remove(int v, int u)
    Deprecated.
    Removes an edge from the collection.
    boolean
    Deprecated.
    Removes an edge from the collection.
    void
    removeFromPos(int pos)
    Deprecated.
     
    void
    Deprecated.
    Removes the last edge of the collection.
    int
    Deprecated.
    Same as numVertices().
    Deprecated.
     
    Deprecated.
     
    int[]
    Deprecated.
     
    double
    Deprecated.
    Computes the sum of the weights associated with each edge in the collection.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • graph

      protected final Graph graph
      Deprecated.
    • edges

      protected int[][] edges
      Deprecated.
    • numEdges

      protected int numEdges
      Deprecated.
    • DEFAULT_CAPACITY

      protected static final int DEFAULT_CAPACITY
      Deprecated.
      See Also:
  • Constructor Details

    • EdgeArray

      public EdgeArray(Graph graph)
      Deprecated.
      Parameters:
      graph - the graph the edges belong to.
    • EdgeArray

      public EdgeArray(Graph graph, int initialCapacity)
      Deprecated.
      Parameters:
      graph - the graph the edges belong to.
      initialCapacity - the initial capacity of this collection.
    • EdgeArray

      public EdgeArray(Graph graph, int[][] edges)
      Deprecated.
      Parameters:
      graph - the graph the edges belong to.
      edges - the initial set of edges.
    • EdgeArray

      public EdgeArray(Graph graph, Edge[] edges)
      Deprecated.
      Parameters:
      graph - the graph the edges belong to.
      edges - the initial set of edges.
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Deprecated.
      Returns:
      true if this collection has no edges.
    • numEdges

      public int numEdges()
      Deprecated.
      Same as size().
      Returns:
      the number of edges in the collection.
    • size

      public int size()
      Deprecated.
      Same as numVertices().
      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, false otherwise.
    • add

      public boolean add(Edge e)
      Deprecated.
      Adds an edge to the collection.
      Parameters:
      e - an edge.
      Returns:
      true if the collection was modified as a result of this invocation, false otherwise.
    • 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, false otherwise.
    • remove

      public boolean remove(Edge e)
      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, false otherwise.
    • 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), false otherwise.
    • 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

      public VertexSet 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.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Deprecated.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object