t

# Relation 

### Companion object Relation

#### trait Relation[A, B] extends AnyRef

Binary relation between A and B. It is a set of pairs (_1, _2) for _1 in A, _2 in B.

Linear Supertypes
AnyRef, Any
Ordering
1. Alphabetic
2. By Inheritance
Inherited
1. Relation
2. AnyRef
3. Any
1. Hide All
2. Show All
Visibility
1. Public
2. All

### Abstract Value Members

1. abstract def +(a: A, bs: Traversable[B]): Relation[A, B]

Includes in the relation `(a, b)` for all `b` in `bs`.

2. abstract def +(a: A, b: B): Relation[A, B]

Includes `(a, b)` in the relation.

3. abstract def +(pair: (A, B)): Relation[A, B]

Includes `pair` in the relation.

4. abstract def ++(rs: Traversable[(A, B)]): Relation[A, B]

Includes the given pairs in this relation.

5. abstract def ++(r: Relation[A, B]): Relation[A, B]

Returns the union of the relation `r` with this relation.

6. abstract def -(pair: (A, B)): Relation[A, B]

Removes `pair` from this relation.

7. abstract def -(_1: A): Relation[A, B]

Removes all pairs `(_1, _2)` from this relation.

8. abstract def --(relations: Relation[A, B]): Relation[A, B]

Removes all `relations` from this relation.

9. abstract def --(pairs: TraversableOnce[(A, B)]): Relation[A, B]

Removes all `pairs` from this relation.

10. abstract def --(_1s: Traversable[A]): Relation[A, B]

Removes all elements `(_1, _2)` for all `_1` in `_1s` from this relation.

11. abstract def _1s: Set[A]

Returns the set of all `_1`s such that `(_1, _2)` is in this relation.

12. abstract def _2s: Set[B]

Returns the set of all `_2`s such that `(_1, _2)` is in this relation.

13. abstract def all: Traversable[(A, B)]

Returns all pairs in this relation.

14. abstract def contains(a: A, b: B): Boolean

Returns true iff `(a,b)` is in this relation

15. abstract def filter(f: (A, B) ⇒ Boolean): Relation[A, B]

Returns a relation with only pairs `(a,b)` for which `f(a,b)` is true.

16. abstract def forward(_1: A): Set[B]

Returns the set of all `_2`s such that `(_1, _2)` is in this relation.

17. abstract def forwardMap: Map[A, Set[B]]

Represents this relation as a `Map` from a `_1` to the set of `_2`s such that `(_1, _2)` is in this relation.

Represents this relation as a `Map` from a `_1` to the set of `_2`s such that `(_1, _2)` is in this relation.

Specifically, there is one entry for each `_1` such that `(_1, _2)` is in this relation for some `_2`. The value associated with a given `_1` is the set of all `_2`s such that `(_1, _2)` is in this relation.

18. abstract def groupBy[K](discriminator: ((A, B)) ⇒ K): Map[K, Relation[A, B]]

Partitions this relation into a map of relations according to some discriminator function.

19. abstract def partition(f: (A, B) ⇒ Boolean): (Relation[A, B], Relation[A, B])

Returns a pair of relations: the first contains only pairs `(a,b)` for which `f(a,b)` is true and the other only pairs `(a,b)` for which `f(a,b)` is false.

20. abstract def reverse(_2: B): Set[A]

Returns the set of all `_1`s such that `(_1, _2)` is in this relation.

21. abstract def reverseMap: Map[B, Set[A]]

Represents this relation as a `Map` from a `_2` to the set of `_1`s such that `(_1, _2)` is in this relation.

Represents this relation as a `Map` from a `_2` to the set of `_1`s such that `(_1, _2)` is in this relation.

Specifically, there is one entry for each `_2` such that `(_1, _2)` is in this relation for some `_1`. The value associated with a given `_2` is the set of all `_1`s such that `(_1, _2)` is in this relation.

22. abstract def size: Int

Returns the number of pairs in this relation

### Concrete Value Members

1. final def !=(arg0: Any): Boolean
Definition Classes
AnyRef → Any
2. final def ##(): Int
Definition Classes
AnyRef → Any
3. final def ==(arg0: Any): Boolean
Definition Classes
AnyRef → Any
4. final def asInstanceOf[T0]: T0
Definition Classes
Any
5. def clone()
Attributes
protected[lang]
Definition Classes
AnyRef
Annotations
@throws( ... ) @native()
6. final def eq(arg0: AnyRef): Boolean
Definition Classes
AnyRef
7. def equals(arg0: Any): Boolean
Definition Classes
AnyRef → Any
8. def finalize(): Unit
Attributes
protected[lang]
Definition Classes
AnyRef
Annotations
@throws( classOf[java.lang.Throwable] )
9. final def getClass(): Class[_]
Definition Classes
AnyRef → Any
Annotations
@native()
10. def hashCode(): Int
Definition Classes
AnyRef → Any
Annotations
@native()
11. final def isInstanceOf[T0]: Boolean
Definition Classes
Any
12. final def ne(arg0: AnyRef): Boolean
Definition Classes
AnyRef
13. final def notify(): Unit
Definition Classes
AnyRef
Annotations
@native()
14. final def notifyAll(): Unit
Definition Classes
AnyRef
Annotations
@native()
15. final def synchronized[T0](arg0: ⇒ T0): T0
Definition Classes
AnyRef
16. def toString(): String
Definition Classes
AnyRef → Any
17. final def wait(): Unit
Definition Classes
AnyRef
Annotations
@throws( ... )
18. final def wait(arg0: Long, arg1: Int): Unit
Definition Classes
AnyRef
Annotations
@throws( ... )
19. final def wait(arg0: Long): Unit
Definition Classes
AnyRef
Annotations
@throws( ... ) @native()