All Packages Class Hierarchy This Package Previous Next Index
Interface tadt.standard.Semantics
 public interface Semantics
The Semantics interface contains all the operations, such as
arithmetic and comparison operations, that are available on
Anchorable and Unanchorable objects.
This is an interface because there are lots of different semantics
for even standard operations such as precedes, such as leftoperand
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 Semantics).
LeftOperandSemantics ops = new LeftOperandSemantics();
Instant j = new Instant(new Granularity("months", 32));
Instant i = new Instant(new Granularity("days", 32));
Instant k = ops.add(i,j); // k is in the granularity of "days"
Most of the operations are currently represented to give an idea of the
eventual interface, although we anticipate a few will be added.

add(Anchorable, Unanchorable)

Displace (add) an Anchorable with an Unanchorable.

add(Unanchorable, Anchorable)

Displace (add) an Unanchorable with an Anchorable.

contains(Anchorable, Anchorable)

Does one Anchorable contain another?

divide(Unanchorable, TimeValue)

Divide an Unanchorable by a TimeValue.

divide(Unanchorable, Unanchorable)

Divide an Unanchorable by an Unanchorable.

equalTo(Anchorable, Anchorable)

Is one Anchorable equalTo another?

meets(Anchorable, Anchorable)

Does one Anchorable meet another?

multiply(Unanchorable, TimeValue)

Multiply an Anchorable by a TimeValue.

negate(Unanchorable)

Negate an Unanchorable.

overlaps(Anchorable, Anchorable)

Does one Anchorable overlap another?

precedes(Anchorable, Anchorable)

Does one Anchorable precede an Anchorable?

subtract(Anchorable, Unanchorable)

Displace (subtract) an Anchorable with an Unanchorable.

subtract(Unanchorable, Anchorable)

Displace (subtract) an Unanchorable with an Anchorable.
precedes
public abstract ExtendedBoolean precedes(Anchorable alpha,
Anchorable beta)
 Does one Anchorable precede an Anchorable?
 Parameters:
 alpha   Anchorable to compare
 beta   Anchorable to compare
 result   ExtendedBoolean
 Returns:
 ExtendedBoolean
overlaps
public abstract ExtendedBoolean overlaps(Anchorable alpha,
Anchorable beta)
 Does one Anchorable overlap another?
 Parameters:
 alpha   Anchorable to compare
 beta   Anchorable to compare
 Returns:
 ExtendedBoolean
meets
public abstract ExtendedBoolean meets(Anchorable alpha,
Anchorable beta)
 Does one Anchorable meet another?
 Parameters:
 alpha   Anchorable to compare
 beta   Anchorable to compare
 Returns:
 ExtendedBoolean
contains
public abstract ExtendedBoolean contains(Anchorable alpha,
Anchorable beta)
 Does one Anchorable contain another?
 Parameters:
 alpha   Anchorable to compare
 beta   Anchorable to compare
 Returns:
 ExtendedBoolean
equalTo
public abstract ExtendedBoolean equalTo(Anchorable alpha,
Anchorable beta)
 Is one Anchorable equalTo another?
 Parameters:
 alpha   Anchorable to compare
 beta   Anchorable to compare
 Returns:
 ExtendedBoolean
add
public abstract Anchorable add(Anchorable alpha,
Unanchorable beta)
 Displace (add) an Anchorable with an Unanchorable.
 Parameters:
 alpha   displacee
 beta   displacor
 Returns:
  (alpha + beta)
add
public abstract Anchorable add(Unanchorable alpha,
Anchorable beta)
 Displace (add) an Unanchorable with an Anchorable.
 Parameters:
 alpha   displacor
 beta   displacee
 Returns:
  (beta + alpha)
subtract
public abstract Anchorable subtract(Anchorable alpha,
Unanchorable beta)
 Displace (subtract) an Anchorable with an Unanchorable.
 Parameters:
 alpha   displacee
 beta   displacor
 Returns:
  (alpha  beta)
subtract
public abstract Anchorable subtract(Unanchorable alpha,
Anchorable beta)
 Displace (subtract) an Unanchorable with an Anchorable.
 Parameters:
 alpha   displacor
 beta   displacee
 Returns:
  (beta  alpha)
negate
public abstract Unanchorable negate(Unanchorable alpha)
 Negate an Unanchorable. Note this will mutate
the result parameter.
 Parameters:
 alpha   Unanchorable to negate
 Returns:
  alpha
multiply
public abstract Unanchorable multiply(Unanchorable alpha,
TimeValue n)
 Multiply an Anchorable by a TimeValue.
 Parameters:
 alpha   Anchorable to multiply
 n   how many
 Returns:
 result  (alpha * n)
divide
public abstract TimeValue[] divide(Unanchorable alpha,
Unanchorable beta)
 Divide an Unanchorable by an Unanchorable.
 Parameters:
 alpha   divisee
 beta   divisor
 result   (TimeValue) alpha/beta
divide
public abstract Unanchorable divide(Unanchorable alpha,
TimeValue beta)
 Divide an Unanchorable by a TimeValue.
 Parameters:
 alpha   divisee
 n   divisor
 result   alpha/n
All Packages Class Hierarchy This Package Previous Next Index