topology
public class BinaryRelation<E extends java.lang.Comparable<E>> extends java.lang.Object
Constructor and Description |
---|
BinaryRelation()
Creates an empty binary relation.
|
BinaryRelation(BinaryRelation<E> relation)
Creates a new BinaryRelation given by a BinaryRelation
|
BinaryRelation(java.util.Set<Pair<E,E>> somePairs)
Creates a new BinaryRelation given by a set of pairs.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Pair<E,E> pair)
Adds a pair to the pairs of this BinaryRelation.
|
boolean |
addAll(java.util.Set<Pair<E,E>> pairSet)
Adds a set of pairs to the pairs of this BinaryRelation.
|
java.util.Set<Pair<E,E>> |
diagonal()
Returns all pairs (e,e) where e is in BinaryRelation with some element
or some element is in BinaryRelation with e.
|
<F extends java.lang.Comparable<F>> |
equals(BinaryRelation<F> relation)
Checks equality of this BinaryRelation with another BinaryRelation.
|
java.util.Set<Pair<E,E>> |
getPairs()
Returns the pairs of this BinaryRelation.
|
java.util.Set<E> |
inLink(E e)
Returns all elements in this BinaryRelation to a given element.
|
boolean |
isAntiSymmetric()
Returns true if BinaryRelation is anti-symmetric.
|
java.util.Set<E> |
outLink(E e)
Returns all elements to which a given element is in this
BinaryRelation with.
|
boolean |
remove(Pair<E,E> pair)
Removes a pair from the pairs of this BinaryRelation.
|
boolean |
removeAll(java.util.Set<Pair<E,E>> pairSet)
Removes a set of pairs from the pairs of this BinaryRelation.
|
public BinaryRelation()
public BinaryRelation(java.util.Set<Pair<E,E>> somePairs)
E
- relation typea
- set of pairspublic BinaryRelation(BinaryRelation<E> relation)
E
- relation typea
- relationpublic java.util.Set<Pair<E,E>> getPairs()
E
- relation typepublic boolean add(Pair<E,E> pair)
E
- relation typepair
- public boolean addAll(java.util.Set<Pair<E,E>> pairSet)
E
- relation typepairSet
- public boolean remove(Pair<E,E> pair)
E
- relation typepair
- public boolean removeAll(java.util.Set<Pair<E,E>> pairSet)
E
- relation typepairSet
- public java.util.Set<E> inLink(E e)
E
- relation typee
- an elementpublic java.util.Set<E> outLink(E e)
E
- relation typee
- an elementpublic java.util.Set<Pair<E,E>> diagonal()
E
- relation typepublic boolean isAntiSymmetric()
public <F extends java.lang.Comparable<F>> boolean equals(BinaryRelation<F> relation)
F
- relation typerelation
-