|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The DeterminateSemantics
interface contains all the
arithmetic and comparison operations that are available on
determinate time values.
In a determinate semantics, all granularity conversions must be casts
instead of scales, and ExtendedBoolean values are not used.
This is an interface because there are lots of different semantics
for even standard operations such as precedes, such as left-operand
semantics where the operation is performed at the granularity of the left
operand.
Below is an example of how one might use a semantics (assume that
LeftOperandSemantics implements DeterminateSemantics).
LeftOperandSemantics ops = new LeftOperandSemantics(); Instant j = new Instant("July 3, 2003"); Interval i = new Interval("1 month"); Instant k = ops.add(i,j); // k is in the granularity of "days" Instant m = ops.add(j,i); // k is in the granularity of "months"Just a few operations are currently represented to give an idea of the eventual interface. All the operations are on individual kinds of time values, e.g., Instant, Period, Interval. We need to expand this with a complete set of temporal operators implementing Allen's algebra.
Instant
,
Period
,
Interval
Method Summary | |
Instant |
add(Instant alpha,
Interval beta)
Displace (add) an Instant on the time-line by an Interval |
Interval |
add(Interval alpha,
Interval beta)
Add one Interval to another |
Period |
add(Period alpha,
Interval beta)
Displace (add) a Period on the time-line by an Interval |
boolean |
contains(Period alpha,
Period beta)
Does this Period contain another? |
Interval |
divide(Interval alpha,
int n)
Divide an Interval by an integer constant. |
int |
divide(Interval alpha,
Interval beta)
Divide an Interval by an Interval (integer division). |
boolean |
during(Period alpha,
Period beta)
Is this Period during another? |
boolean |
equalTo(Instant alpha,
Instant beta)
Does this Instant represent the same times as another? |
boolean |
equalTo(Period alpha,
Period beta)
Does this Period represent the same times as another? |
boolean |
finishes(Period alpha,
Period beta)
Does this Period finish at the same time as another, but start after it, that is, is alpha.end == beta.end but alpha.start < beta.start? |
Instant |
first(Instant alpha,
Instant beta)
Temporal constructor - Choose the first (earliest) from among a pair of instants |
Instant |
last(Instant alpha,
Instant beta)
Temporal constructor - Choose the last (latest) from among a pair of instants |
boolean |
meets(Period alpha,
Period beta)
Does the end of a Period meet the start of another Period, that is, is alpha.end == beta.start? |
boolean |
metBy(Period alpha,
Period beta)
Is the start of a Period metBy the start of another Period, that is, is beta.end == alpha.start? |
Interval |
multiply(Interval alpha,
int n)
Multiply an Interval by an integer constant. |
Interval |
negate(Interval alpha)
Negate an Interval. |
boolean |
overlaps(Period alpha,
Period beta)
Does one Period overlap another? |
boolean |
precedes(Instant alpha,
Instant beta)
Does one Instant precede another, that is, is alpha < beta? |
boolean |
precedes(Instant alpha,
Period beta)
Does an Instant precede the start of a Period, that is, is alpha < beta.start? |
boolean |
precedes(Period alpha,
Instant beta)
Does the end of a Period precede the start of an Instant, that is, is alpha.end < beta? |
boolean |
precedes(Period alpha,
Period beta)
Does the end of a Period precede the start of another, that is, is alpha.end < beta.start? |
boolean |
starts(Period alpha,
Period beta)
Does this Period begin at the same time as another, but end before it, that is, is alpha.start == beta.start but alpha.end < beta.end? |
Instant |
subtract(Instant alpha,
Interval beta)
Displace (subtract) an Instant on the time-line by an Interval |
Interval |
subtract(Interval alpha,
Interval beta)
Subtract one Interval from another |
Period |
subtract(Period alpha,
Interval beta)
Displace (subtract) a Period on the time-line by an Interval |
Method Detail |
public boolean precedes(Instant alpha, Instant beta)
alpha
- - Instant to comparebeta
- - Instant to compare
public boolean precedes(Instant alpha, Period beta)
alpha
- - Instant to comparebeta
- - Period to compare
public boolean precedes(Period alpha, Instant beta)
alpha
- - Period to comparebeta
- - Instant to compare
public boolean precedes(Period alpha, Period beta)
alpha
- - Period to comparebeta
- - Period to compare
public boolean starts(Period alpha, Period beta)
alpha
- - Period to comparebeta
- - Period to compare
public boolean finishes(Period alpha, Period beta)
alpha
- - Period to comparebeta
- - Period to compare
public boolean meets(Period alpha, Period beta)
alpha
- - Period to comparebeta
- - Period to compare
public boolean metBy(Period alpha, Period beta)
alpha
- - Period to comparebeta
- - Period to compare
public boolean overlaps(Period alpha, Period beta)
alpha
- - Period to comparebeta
- - Period to compare
public boolean contains(Period alpha, Period beta)
alpha
- - Period to comparebeta
- - Period to compare
public boolean during(Period alpha, Period beta)
alpha
- - Period to comparebeta
- - Period to compare
public boolean equalTo(Period alpha, Period beta)
alpha
- - Period to comparebeta
- - Period to compare
public boolean equalTo(Instant alpha, Instant beta)
alpha
- - Instant to comparebeta
- - Instant to compare
public Period add(Period alpha, Interval beta)
alpha
- - displaceebeta
- - displacor
public Instant add(Instant alpha, Interval beta)
alpha
- - displaceebeta
- - displacor
public Interval add(Interval alpha, Interval beta)
alpha
- - displaceebeta
- - displacor
public Period subtract(Period alpha, Interval beta)
alpha
- - displaceebeta
- - displacor
public Instant subtract(Instant alpha, Interval beta)
alpha
- - displaceebeta
- - displacor
public Interval subtract(Interval alpha, Interval beta)
alpha
- - displaceebeta
- - displacor
public Interval negate(Interval alpha)
alpha
- - Interval to negate
public Interval multiply(Interval alpha, int n)
alpha
- - Interval to multiplyn
- - by how many
public Interval divide(Interval alpha, int n)
alpha
- - Interval to dividen
- - by how many
public int divide(Interval alpha, Interval beta)
alpha
- - diviseebeta
- - divisorpublic Instant first(Instant alpha, Instant beta)
alpha
- - Instantbeta
- - Instant
public Instant last(Instant alpha, Instant beta)
alpha
- - Instantbeta
- - Instant
|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |