Class UniformIntrusiveEdgesSpecifics<V,E>

java.lang.Object
org.jgrapht.graph.BaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveEdge>
org.jgrapht.graph.UniformIntrusiveEdgesSpecifics<V,E>
Type Parameters:
V - the graph vertex type
E - the graph edge type
All Implemented Interfaces:
Serializable, IntrusiveEdgesSpecifics<V,E>

public class UniformIntrusiveEdgesSpecifics<V,E> extends BaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveEdge> implements IntrusiveEdgesSpecifics<V,E>
An uniform weights variant of the intrusive edges specifics.

The implementation optimizes the use of DefaultEdge and subclasses. For other custom user edge types, a map is used to store vertex source and target.

Author:
Barak Naveh, Dimitrios Michail
See Also:
  • Constructor Details

    • UniformIntrusiveEdgesSpecifics

      public UniformIntrusiveEdgesSpecifics(Map<E,org.jgrapht.graph.IntrusiveEdge> map)
      Constructor
      Parameters:
      map - the map to use for storage
  • Method Details

    • add

      public boolean add(E e, V sourceVertex, V targetVertex)
      Description copied from class: BaseIntrusiveEdgesSpecifics
      Add a new edge
      Specified by:
      add in interface IntrusiveEdgesSpecifics<V,E>
      Specified by:
      add in class BaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveEdge>
      Parameters:
      e - the edge
      sourceVertex - the source vertex of the edge
      targetVertex - the target vertex of the edge
      Returns:
      true if the edge was added, false if the edge was already present
    • getIntrusiveEdge

      protected org.jgrapht.graph.IntrusiveEdge getIntrusiveEdge(E e)
      Description copied from class: BaseIntrusiveEdgesSpecifics
      Get the intrusive edge of an edge.
      Specified by:
      getIntrusiveEdge in class BaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveEdge>
      Parameters:
      e - the edge
      Returns:
      the intrusive edge