Class EquivalenceRelation<A>

java.lang.Object
eu.bandm.tools.ops.EquivalenceRelation<A>
All Implemented Interfaces:
Serializable, BiPredicate<A,A>

public class EquivalenceRelation<A> extends Object implements BiPredicate<A,A>, Serializable
Finite partial equivalence relations modulo equals, implemented as union-find trees.
See Also:
  • Constructor Details

    • EquivalenceRelation

      public EquivalenceRelation()
  • Method Details

    • domain

      public Set<A> domain()
    • test

      public boolean test(A x, A y)
      Specified by:
      test in interface BiPredicate<A,A>
    • find

      @Opt public A find(A x)
    • add

      public boolean add(A x)
    • addAll

      public final boolean addAll(Collection<? extends A> xs)
    • union

      public boolean union(A x, A y)
    • addAndUnion

      public boolean addAndUnion(A x, A y)
    • remove

      public boolean remove(A x)
    • classOf

      public Set<A> classOf(A x)
      DOCME
      Parameters:
      x - must be in the domain of the graph.
      Throws:
      IllegalArgumentException - if x is not in the domain of the graph
    • toString

      public String toString()
      Overrides:
      toString in class Object