-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDirected.java
42 lines (39 loc) · 1.05 KB
/
Directed.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.github.vincentk.dedekind.sets.ordered;
import com.github.vincentk.dedekind.sets.Cardinality;
import com.github.vincentk.dedekind.sets.Element;
import com.github.vincentk.dedekind.sets.NonEmptySet;
import com.github.vincentk.dedekind.sets.Set;
import com.github.vincentk.dedekind.sets.binary.relation.homogeneous.Identity;
import com.github.vincentk.dedekind.sets.binary.relation.homogeneous.PreOrder;
/**
* A non-empty {@link Set} with a preorder and an upper bound ∈ set.
*
* @param <C> cardinality
* @param <T> implementation type
*
* @see https://en.wikipedia.org/wiki/Directed_set
*/
public interface Directed<
E extends Directed.De<E>,
C extends Cardinality,
T extends Directed<E, C, T>
>
extends NonEmptySet<E, T> {
interface De<E extends De<E>>
extends
Element<E>, PreOrder.Directed<E>
{
/**
* A trivial {@link PreOrder} using the {@link Identity} relation.
*
* <p>
* {@inheritDoc}
* </p>
*/
@SuppressWarnings("unchecked")
@Override
default boolean leq(E that) {
return ((E) this).eq(that);
}
}
}