public enum IntervalRelation extends Enum<IntervalRelation>
Represents an Allen-relation between two intervals.
Given any two intervals, there is always a unique and distinct relation between them without ambivalence. There are 13 possible relations.
| precedes | ![]() |
| meets | ![]() |
| overlaps | ![]() |
| finishedBy | ![]() |
| encloses | ![]() |
| starts | ![]() |
| equivalent | ![]() |
| startedBy | ![]() |
| enclosedBy | ![]() |
| finishes | ![]() |
| overlappedBy | ![]() |
| metBy | ![]() |
| precededBy | ![]() |
Further explanations can be found at the website of Allen's interval algebra.
| Enum Constant and Description |
|---|
ENCLOSED_BY
|
ENCLOSES
|
EQUIVALENT
|
FINISHED_BY
|
FINISHES
|
MEETS
|
MET_BY
|
OVERLAPPED_BY
|
OVERLAPS
|
PRECEDED_BY
|
PRECEDES
|
STARTED_BY
|
STARTS
|
| Modifier and Type | Method and Description |
|---|---|
static IntervalRelation |
between(ClockInterval a,
ClockInterval b)
Determines the relation between given intervals.
|
static IntervalRelation |
between(DateInterval a,
DateInterval b)
Determines the relation between given intervals.
|
static IntervalRelation |
between(MomentInterval a,
MomentInterval b)
Determines the relation between given intervals.
|
static IntervalRelation |
between(TimestampInterval a,
TimestampInterval b)
Determines the relation between given intervals.
|
IntervalRelation |
inverse()
Determines the opposite relation.
|
boolean |
matches(ClockInterval a,
ClockInterval b)
Does this relation match the relation between given intervals?
|
boolean |
matches(DateInterval a,
DateInterval b)
Does this relation match the relation between given intervals?
|
boolean |
matches(MomentInterval a,
MomentInterval b)
Does this relation match the relation between given intervals?
|
boolean |
matches(TimestampInterval a,
TimestampInterval b)
Does this relation match the relation between given intervals?
|
static IntervalRelation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IntervalRelation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IntervalRelation PRECEDES
public static final IntervalRelation MEETS
public static final IntervalRelation OVERLAPS
public static final IntervalRelation FINISHES
public static final IntervalRelation STARTS
public static final IntervalRelation ENCLOSES
public static final IntervalRelation EQUIVALENT
public static final IntervalRelation ENCLOSED_BY
public static final IntervalRelation STARTED_BY
public static final IntervalRelation FINISHED_BY
public static final IntervalRelation OVERLAPPED_BY
public static final IntervalRelation MET_BY
public static final IntervalRelation PRECEDED_BY
public static IntervalRelation[] values()
for (IntervalRelation c : IntervalRelation.values()) System.out.println(c);
public static IntervalRelation valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic IntervalRelation inverse()
Determines the opposite relation.
public boolean matches(DateInterval a, DateInterval b)
Does this relation match the relation between given intervals?
a - first intervalb - second intervaltrue if both intervals have this relation to each other
else falsepublic boolean matches(ClockInterval a, ClockInterval b)
Does this relation match the relation between given intervals?
a - first intervalb - second intervaltrue if both intervals have this relation to each other
else falsepublic boolean matches(TimestampInterval a, TimestampInterval b)
Does this relation match the relation between given intervals?
a - first intervalb - second intervaltrue if both intervals have this relation to each other
else falsepublic boolean matches(MomentInterval a, MomentInterval b)
Does this relation match the relation between given intervals?
a - first intervalb - second intervaltrue if both intervals have this relation to each other
else falsepublic static IntervalRelation between(DateInterval a, DateInterval b)
Determines the relation between given intervals.
a - first intervalb - second intervalpublic static IntervalRelation between(ClockInterval a, ClockInterval b)
Determines the relation between given intervals.
a - first intervalb - second intervalpublic static IntervalRelation between(TimestampInterval a, TimestampInterval b)
Determines the relation between given intervals.
a - first intervalb - second intervalpublic static IntervalRelation between(MomentInterval a, MomentInterval b)
Determines the relation between given intervals.
a - first intervalb - second intervalCopyright © 2014–2021. All rights reserved.