| Enum Constant and Description |
|---|
CHILD
Child
(opposite)
When the other source fits inside the source but is not filling it. |
NEXT
Next
(opposite)
When the other source occurs after the source. |
PARENT
Parent
(opposite)
When the other source can fit the source without being filled. |
PREVIOUS
Previous
(opposite)
When the other source occurs before the source. |
| Modifier and Type | Method and Description |
|---|---|
static @Nullable Relation |
compute(int i,
int j,
int s,
int e)
Calculate the direction from the area
[i, j) to the area [s, e). |
static @Nullable Relation |
compute(@NotNull Reference reference,
int s,
int e)
Calculate the direction from the given
reference to the area [s,
e). |
static @Nullable Relation |
compute(@NotNull Reference reference,
@NotNull Reference other)
Calculate the direction from the given
reference to the other. |
static @Nullable Relation |
compute(@NotNull Tree tree,
int s,
int e)
Calculate the direction from the given
sketch to the area [s, e). |
static @Nullable Relation |
compute(@NotNull Tree tree,
@NotNull Reference other)
Calculate the direction from the given
sketch to the other. |
static @Nullable Relation |
compute(@NotNull Tree tree,
@NotNull Tree other)
Calculate the direction from the given
sketch to the other. |
@NotNull Dominance |
dominance()
Returns how dominant this direction over the opposite direction.
|
abstract @NotNull Relation |
opposite()
The opposite direction of this direction.
|
@NotNull java.lang.String |
toString() |
static Relation |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Relation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Relation PARENT
(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}
Dominance.CONTAIN,
Intersection.CONTAINER,
Intersection.AHEAD,
Intersection.BEHINDpublic static final Relation CHILD
(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}
Dominance.PART,
Intersection.FRAGMENT,
Intersection.START,
Intersection.ENDpublic static final Relation PREVIOUS
(opposite)
.....|--->.
.<---|.....
......|-->.
.<--|......
(s < e == i < j)
(s <= e < i <= j)
{s < e} & {e == i} & {i < j}
{e < i}
Dominance.NONE,
Intersection.PREVIOUS,
Intersection.BEFOREpublic static final Relation NEXT
(opposite)
.<---|.....
.....|--->.
.<--|......
......|-->.
(i < j == s < e)
(i <= j < s <= e)
{i < j} & {j == s} & {s < e}
{j < s}
Dominance.NONE,
Intersection.NEXT,
Intersection.AFTERpublic static Relation[] values()
for (Relation c : Relation.values()) System.out.println(c);
public static Relation 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@Nullable @Contract(pure=true) public static @Nullable Relation compute(int i, int j, int s, int e)
[i, j) to the area [s, e).
A is inside B then the direction from A to
B will be PARENT.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].@Nullable @Contract(pure=true) public static @Nullable Relation compute(@NotNull @NotNull Reference reference, int s, int e)
reference to the area [s,
e).
A is inside B then the direction from A to
B will be PARENT.reference - the reference (first area).s - the first index of the second area.e - one past the last index of the second area.reference to the second area given.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)@Nullable @Contract(pure=true) public static @Nullable Relation compute(@NotNull @NotNull Reference reference, @NotNull @NotNull Reference other)
reference to the other.
A is inside B then the direction from A to
B will be PARENT.reference - the first reference.other - the second reference.reference to the given other.java.lang.NullPointerException - if the given reference or other is
null.compute(int, int, int, int)@Nullable @Contract(pure=true) public static @Nullable Relation compute(@NotNull @NotNull Tree tree, int s, int e)
sketch to the area [s, e).
A is inside B then the direction from A to
B will be PARENT.tree - the sketch (first area).s - the first index of the second area.e - one past the last index of the second area.sketch to the second area given.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)@Nullable @Contract(pure=true) public static @Nullable Relation compute(@NotNull @NotNull Tree tree, @NotNull @NotNull Reference other)
sketch to the other.
A is inside B then the direction from A to
B will be PARENT.tree - the first sketch.other - the second sketch.sketch to the given other.java.lang.NullPointerException - if the given sketch or other is null.compute(int, int, int, int)@Nullable @Contract(pure=true) public static @Nullable Relation compute(@NotNull @NotNull Tree tree, @NotNull @NotNull Tree other)
sketch to the other.
A is inside B then the direction from A to
B will be PARENT.tree - the first sketch.other - the second sketch.sketch to the given other.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<Relation>@NotNull @Contract(pure=true) public @NotNull Dominance dominance()
@NotNull @Contract(pure=true) public abstract @NotNull Relation opposite()