E - The type of elements in the equivalence relation.public abstract class AbstractEquivalenceRelation<E> extends java.util.AbstractCollection<java.util.Set<E>> implements java.util.Collection<java.util.Set<E>>, IEquivalenceRelation<E>
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<E,java.util.Set<E>> |
leaderToClass |
| Constructor and Description |
|---|
AbstractEquivalenceRelation() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkValidElement(E e)
Extension point to restrict the valid entries of the equivalence class.
|
boolean |
equals(java.lang.Object o) |
java.util.Set<E> |
getClass(E e)
Get the equivalence class of the given element.
|
int |
hashCode() |
boolean |
isEquivalent(E e1,
E e2)
Check if the given elements are in the same equivalence class.
|
abstract java.util.Iterator<java.util.Set<E>> |
iterator() |
java.util.Set<E> |
joinClasses(E e1,
E e2)
Join the equivalence classes of two elements.
|
protected boolean |
refine(AbstractEquivalenceRelation<? super E> newRelation,
IEquivalenceRelation<? super E> relation)
Refine this equivalence relation via another relation.
|
abstract AbstractEquivalenceRelation<E> |
refine(IEquivalenceRelation<? super E> relation)
Refine this equivalence relation via another relation.
|
int |
size() |
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic abstract AbstractEquivalenceRelation<E> refine(IEquivalenceRelation<? super E> relation)
relation - The relation to use for refinement.protected void checkValidElement(E e)
protected boolean refine(AbstractEquivalenceRelation<? super E> newRelation, IEquivalenceRelation<? super E> relation)
joinClasses on the given new relation.newRelation - The relation where classes should be joined.relation - The relation to use for refinement.public java.util.Set<E> joinClasses(E e1, E e2)
e1 - The first element to join classes withe2 - The other element to join classes withpublic java.util.Set<E> getClass(E e)
e - the element whose class is neededpublic boolean isEquivalent(E e1, E e2)
IEquivalenceRelationisEquivalent in interface IEquivalenceRelation<E>e1 - The first element to checke2 - The other element to checkpublic int size()
public abstract java.util.Iterator<java.util.Set<E>> iterator()
public boolean equals(java.lang.Object o)
equals in interface java.util.Collection<java.util.Set<E>>equals in class java.lang.Objectpublic int hashCode()
hashCode in interface java.util.Collection<java.util.Set<E>>hashCode in class java.lang.Object