Class MatchingAlgorithm.MatchingImpl<V,​E>

  • Type Parameters:
    V - the graph vertex type
    E - the graph edge type
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<E>, MatchingAlgorithm.Matching<V,​E>
    Enclosing interface:
    MatchingAlgorithm<V,​E>

    public static class MatchingAlgorithm.MatchingImpl<V,​E>
    extends java.lang.Object
    implements MatchingAlgorithm.Matching<V,​E>, java.io.Serializable
    A default implementation of the matching interface.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      MatchingImpl​(Graph<V,​E> graph, java.util.Set<E> edges, double weight)
      Construct a new instance
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<E> getEdges()
      Get the edges of the matching.
      Graph<V,​E> getGraph()
      Returns the graph over which this matching is defined.
      double getWeight()
      Returns the weight of the matching.
      boolean isMatched​(V v)
      Returns true if vertex v is incident to an edge in this matching.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • MatchingImpl

        public MatchingImpl​(Graph<V,​E> graph,
                            java.util.Set<E> edges,
                            double weight)
        Construct a new instance
        Parameters:
        graph - graph on which the matching is defined
        edges - the edges of the matching
        weight - the weight of the matching
    • Method Detail

      • getWeight

        public double getWeight()
        Returns the weight of the matching.
        Specified by:
        getWeight in interface MatchingAlgorithm.Matching<V,​E>
        Returns:
        the weight of the matching
      • getEdges

        public java.util.Set<E> getEdges()
        Get the edges of the matching.
        Specified by:
        getEdges in interface MatchingAlgorithm.Matching<V,​E>
        Returns:
        the edges of the matching
      • isMatched

        public boolean isMatched​(V v)
        Returns true if vertex v is incident to an edge in this matching.
        Specified by:
        isMatched in interface MatchingAlgorithm.Matching<V,​E>
        Parameters:
        v - vertex
        Returns:
        true if vertex v is incident to an edge in this matching.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object