public enum Intersection extends java.lang.Enum<Intersection>
SAME
i == s <= j == e
...|~~~|...
...|~~~|...
FRAGMENT | CONTAINER
i < s <= e < j
.<--~~~-->.
...|~~~|...
START | AHEAD
i == s <= e < j
.|----~~~>.
.|--->.....
END | BEHIND
i < s <= e == j
.<~~~----|.
.....<---|.
OVERFLOW | UNDERFLOW
i < s < j < e
.<~~--|....
....|--~~>.
NEXT | PREVIOUS
i < j == s < e
.<---|.....
.....|--->.
AFTER | BEFORE
i <= j < s <= e
.<~~|......
......|~~>.
| Enum Constant and Description |
|---|
AFTER
After The Source
opposite
When the other source is after the source but not immediately. |
AHEAD
This And Ahead
(opposite)
When the source is contained at the very start of the other source. |
BEFORE
Before The Source
opposite
When the other source is before the source but not immediately. |
BEHIND
This And Behind
(opposite)
When the source is contained at the very end of the other source. |
CONTAINER
Containing Source
(opposite)
When the bounds of the source are contained in the bounds of the other source but do not touch. |
END
At The End
(opposite)
When the source contains the other source at its end. |
FRAGMENT
Fragment Source
(opposite)
When the source has its bounds containing the bounds of the other source but do not touch. |
NEXT
Next Source
(opposite)
When the source is followed immediately by the other source. |
OVERFLOW
Overflowed Slice
(opposite)
When the first fragment of the source is before the other source but the second fragment is in it. |
PREVIOUS
Previous Source
(opposite)
When the source has the other source immediately before it. |
SAME
Same Source
(opposite)
When the source has the exact bounds as the other source. |
START
At The Start
(opposite)
When the source contains the other source at its start. |
UNDERFLOW
Underflowed Slice
(opposite)
When the first fragment of the source is in the other source but the second fragment is after it. |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull Intersection |
compute(int i,
int j,
int s,
int e)
Calculate what is the intersection between the areas
[i, j) and [s,
e). |
static @NotNull Intersection |
compute(@NotNull Reference reference,
int s,
int e)
Calculate what is the intersection between the given
reference and the
given area [s, e). |
static @NotNull Intersection |
compute(@NotNull Reference reference,
@NotNull Reference other)
Calculate the intersection between the references
reference and other. |
static @NotNull Intersection |
compute(@NotNull Tree tree,
int s,
int e)
Calculate what is the intersection between the given
sketch and the given
area [s, e). |
static @NotNull Intersection |
compute(@NotNull Tree tree,
@NotNull Reference other)
Calculate the intersection between the sketches
sketch and other. |
static @NotNull Intersection |
compute(@NotNull Tree tree,
@NotNull Tree other)
Calculate the intersection between the sketches
sketch and other. |
@NotNull Dominance |
dominance()
Returns how dominance this intersection over its opposite intersection.
|
abstract @NotNull Intersection |
opposite()
Get the opposite intersection of this intersection.
|
@Nullable Relation |
relation()
Returns the relation from this the opposite intersection to this intersection.
|
@NotNull java.lang.String |
toString() |
static Intersection |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Intersection[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Intersection CONTAINER
(opposite)
...|---|...
.<------->.
(s < i <= j < e)
{s < i} & {j < e}
Dominance.CONTAIN,
Relation.PARENTpublic static final Intersection AHEAD
(opposite)
.|--->.....
.|------->.
(s == i <= j < e)
{i == s} & {j < e}
Dominance.CONTAIN,
Relation.PARENTpublic static final Intersection BEHIND
(opposite)
.....<---|.
.<-------|.
(s < i <= j == e)
{s < i} & {j == e}
Dominance.CONTAIN,
Relation.PARENTpublic static final Intersection SAME
(opposite)
...|---|...
...|---|...
(i == s <= j == e)
{i == s} & {j == e}
Dominance.EXACTpublic static final Intersection OVERFLOW
(opposite)
.<----|....
....|---->.
(i < s < j < e)
{i < s} & {s < j} & {j < e}
Dominance.SHAREpublic static final Intersection UNDERFLOW
(opposite)
....|---->.
.<----|....
(s < i < e < j)
{s < i} & {i < e} & {e < j}
Dominance.SHAREpublic static final Intersection FRAGMENT
(opposite)
.<------->.
...|---|...
(i < s <= e < j)
{i < s} & {e < j}
Dominance.PART,
Relation.CHILDpublic static final Intersection START
(opposite)
.|------->.
.|--->.....
(i == s <= e < j)
{i == s} & {e < j}
Dominance.PART,
Relation.CHILDpublic static final Intersection END
(opposite)
.<-------|.
.....<---|.
(i < s <= e == j)
{i < s} & {j == e}
Dominance.PART,
Relation.CHILDpublic static final Intersection NEXT
(opposite)
.<---|.....
.....|--->.
(i < j == s < e)
{i < j} & {j == s} & {s < e}
Dominance.NONE,
Relation.NEXTpublic static final Intersection AFTER
opposite
.<--|......
......|-->.
(i <= j < s <= e)
{j < s}
Dominance.NONE,
Relation.NEXTpublic static final Intersection PREVIOUS
(opposite)
.....|--->.
.<---|.....
(s < e == i < j)
{s < e} & {e == i} & {i < j}
Dominance.NONE,
Relation.PREVIOUSpublic static final Intersection BEFORE
opposite
......|-->.
.<--|......
(s <= e < i <= j)
{e < i}
Dominance.NONE,
Relation.PREVIOUSpublic static Intersection[] values()
for (Intersection c : Intersection.values()) System.out.println(c);
public static Intersection 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 Intersection compute(int i, int j, int s, int e)
[i, j) and [s,
e).
fragmnet will be returned.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 Intersection compute(@NotNull @NotNull Reference reference, int s, int e)
reference and the
given area [s, e).reference - the reference (first area).s - the first index of the second area.e - one past the last index of the second area.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 Intersection compute(@NotNull @NotNull Reference reference, @NotNull @NotNull Reference other)
reference and other.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 Intersection compute(@NotNull @NotNull Tree tree, int s, int e)
sketch and the given
area [s, e).tree - the sketch (first area).s - the first index of the second area.e - one past the last index of the second area.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 Intersection compute(@NotNull @NotNull Tree tree, @NotNull @NotNull Reference other)
sketch and other.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 static @NotNull Intersection compute(@NotNull @NotNull Tree tree, @NotNull @NotNull Tree other)
sketch and other.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<Intersection>@NotNull @Contract(pure=true) public @NotNull Dominance dominance()
@Nullable @Contract(pure=true) public @Nullable Relation relation()
null if there cannot be a direction
between them.@NotNull @Contract(pure=true) public abstract @NotNull Intersection opposite()