public enum Dominance extends java.lang.Enum<Dominance>
EXACT i == s <= j == e ...|---|... ...|---|... PART | CONTAIN i < s <= e < j .<------->. ...|---|...
i == s <= e < j .|------->. .|--->.....
i < s <= e == j .<-------|. .....<---|. SHARE i < s < j < e .<----|.... ....|---->.
s < i < e < j ....|---->. .<----|.... NONE i < j == s < e .<---|..... .....|--->.
s < e == i < j .....|--->. .<---|.....
i <= j < s <= e .<--|...... ......|-->.
s <= e < i <= j ......|-->. .<--|......
Enum Constant and Description |
---|
CONTAIN
Container
(opposite)
Defines that a source that have the relation contains the other source in it (but not exact). |
EXACT
Mirror
(opposite)
Defines that a source that have the relation has the same relation as the other source. |
NONE
Stranger
(opposite)
Defines that a source that have the relation shares none of the other source. |
PART
Slice
(opposite)
Defines that a source that have the relation shares some (but not all) of the other source. |
SHARE
Clash
(opposite)
Defines that a source that have the relation shares some (but not all) of the other source and vice versa. |
Modifier and Type | Method and Description |
---|---|
static @NotNull Dominance |
compute(int i,
int j,
int s,
int e)
Calculate how much dominant the area [s, e) over the area [i, j).
|
static @NotNull Dominance |
compute(@NotNull Reference reference,
int s,
int e)
Calculate how much dominant the area
[s, e) is over the given reference . |
static @NotNull Dominance |
compute(@NotNull Reference reference,
@NotNull Reference other)
Calculate how much dominant the
other reference over the given reference . |
static @NotNull Dominance |
compute(@NotNull Tree tree,
int s,
int e)
Calculate how much dominant the area
[s, e) is over the given sketch . |
static @NotNull Dominance |
compute(@NotNull Tree tree,
@NotNull Reference other)
Calculate how much dominant the
other reference over the given sketch . |
static @NotNull Dominance |
compute(@NotNull Tree tree,
@NotNull Tree other)
Calculate how much dominant the
other sketch over the given sketch . |
abstract @NotNull Dominance |
opposite()
Get the opposite dominance type of this dominance type.
|
@NotNull java.lang.String |
toString() |
static Dominance |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Dominance[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Dominance CONTAIN
(opposite)
...|---|... .<------->.
.|--->..... .|------->.
.....<---|. .<-------|.
(s < i <= j < e) (s == i <= j < e) (s < i <= j == e)
{s < i} & {j < e}
{i == s} & {j < e}
{s < i} & {j == e}
Relation.PARENT
,
Intersection.CONTAINER
,
Intersection.AHEAD
,
Intersection.BEHIND
public static final Dominance EXACT
(opposite)
...|---|... ...|---|...
(i == s <= j == e)
{i == s} & {j == e}
Intersection.SAME
public static final Dominance SHARE
(opposite)
.<----|.... ....|---->.
....|---->. .<----|....
(i < s < j < e) (s < i < e < j)
{i < s} & {s < j} & {j < e} {s < i} & {i < e} & {e < j}
Intersection.OVERFLOW
,
Intersection.UNDERFLOW
public static final Dominance PART
(opposite)
.<------->. ...|---|...
.|------->. .|--->.....
.<-------|. .....<---|.
(i < s <= e < j) (i == s <= e < j) (i < s <= e == j)
{i < s} & {e < j} {i == s} & {e < j} {i < s} & {j == e}
Relation.CHILD
,
Intersection.FRAGMENT
,
Intersection.START
,
Intersection.END
public static final Dominance NONE
(opposite)
.<---|..... .....|--->.
.....|--->. .<---|.....
.<--|...... ......|-->.
......|-->. .<--|......
(i < j == s < e) (s < e == i < j) (i <= j < s <= e) (s <= e < i <= j)
{i < j} & {j == s} & {s < e} {s < e} & {e == i} & {i < j} {j < s} {e < i}
Relation.NEXT
,
Relation.PREVIOUS
,
Intersection.NEXT
,
Intersection.PREVIOUS
,
Intersection.AFTER
,
Intersection.BEFORE
public static Dominance[] values()
for (Dominance c : Dominance.values()) System.out.println(c);
public static Dominance valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null@NotNull @Contract(pure=true) public static @NotNull Dominance compute(int i, int j, int s, int e)
i
- the first index of the first area.j
- one past the last index of the first area.s
- the first index of the second area.e
- one past the last index of the second area.java.lang.IllegalArgumentException
- if i
is not in the range [0, j]
or
if s
is not in the range [0, e]
.@NotNull @Contract(pure=true) public static @NotNull Dominance compute(@NotNull @NotNull Reference reference, int s, int e)
[s, e)
is over the given reference
.reference
- the reference (first area).s
- the first index of the second area.e
- one past the last index of the second area.reference
.java.lang.NullPointerException
- if the given reference
is null.java.lang.IllegalArgumentException
- if s
is not in the range [0, e]
.compute(int, int, int, int)
@NotNull @Contract(pure=true) public static @NotNull Dominance compute(@NotNull @NotNull Reference reference, @NotNull @NotNull Reference other)
other
reference over the given reference
.reference
- the first reference.other
- the second reference.java.lang.NullPointerException
- if the given reference
or other
is
null.compute(int, int, int, int)
@NotNull @Contract(pure=true) public static @NotNull Dominance compute(@NotNull @NotNull Tree tree, int s, int e)
[s, e)
is over the given sketch
.tree
- the sketch (first area).s
- the first index of the second area.e
- one past the last index of the second area.sketch
.java.lang.NullPointerException
- if the given sketch
is null.java.lang.IllegalArgumentException
- if s
is not in the range [0, e]
.compute(int, int, int, int)
@NotNull @Contract(pure=true) public static @NotNull Dominance compute(@NotNull @NotNull Tree tree, @NotNull @NotNull Reference other)
other
reference over the given sketch
.tree
- the first sketch.other
- the second reference.java.lang.NullPointerException
- if the given sketch
or other
is null.compute(int, int, int, int)
@NotNull @Contract(pure=true) public static @NotNull Dominance compute(@NotNull @NotNull Tree tree, @NotNull @NotNull Tree other)
other
sketch over the given sketch
.tree
- the first sketch.other
- the second sketch.java.lang.NullPointerException
- if the given sketch
or other
is null.compute(int, int, int, int)
@NotNull @Contract(pure=true) public @NotNull java.lang.String toString()
toString
in class java.lang.Enum<Dominance>
@NotNull @Contract(pure=true) public abstract @NotNull Dominance opposite()