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 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 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.


Method Index

 o add(Anchorable, Unanchorable)
Displace (add) an Anchorable with an Unanchorable.
 o add(Unanchorable, Anchorable)
Displace (add) an Unanchorable with an Anchorable.
 o contains(Anchorable, Anchorable)
Does one Anchorable contain another?
 o divide(Unanchorable, TimeValue)
Divide an Unanchorable by a TimeValue.
 o divide(Unanchorable, Unanchorable)
Divide an Unanchorable by an Unanchorable.
 o equalTo(Anchorable, Anchorable)
Is one Anchorable equalTo another?
 o meets(Anchorable, Anchorable)
Does one Anchorable meet another?
 o multiply(Unanchorable, TimeValue)
Multiply an Anchorable by a TimeValue.
 o negate(Unanchorable)
Negate an Unanchorable.
 o overlaps(Anchorable, Anchorable)
Does one Anchorable overlap another?
 o precedes(Anchorable, Anchorable)
Does one Anchorable precede an Anchorable?
 o subtract(Anchorable, Unanchorable)
Displace (subtract) an Anchorable with an Unanchorable.
 o subtract(Unanchorable, Anchorable)
Displace (subtract) an Unanchorable with an Anchorable.

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o add
  public abstract Anchorable add(Anchorable alpha,
                                 Unanchorable beta)
Displace (add) an Anchorable with an Unanchorable.

Parameters:
alpha - - displacee
beta - - displacor
Returns:
- (alpha + beta)
 o add
  public abstract Anchorable add(Unanchorable alpha,
                                 Anchorable beta)
Displace (add) an Unanchorable with an Anchorable.

Parameters:
alpha - - displacor
beta - - displacee
Returns:
- (beta + alpha)
 o subtract
  public abstract Anchorable subtract(Anchorable alpha,
                                      Unanchorable beta)
Displace (subtract) an Anchorable with an Unanchorable.

Parameters:
alpha - - displacee
beta - - displacor
Returns:
- (alpha - beta)
 o subtract
  public abstract Anchorable subtract(Unanchorable alpha,
                                      Anchorable beta)
Displace (subtract) an Unanchorable with an Anchorable.

Parameters:
alpha - - displacor
beta - - displacee
Returns:
- (beta - alpha)
 o negate
  public abstract Unanchorable negate(Unanchorable alpha)
Negate an Unanchorable. Note this will mutate the result parameter.

Parameters:
alpha - - Unanchorable to negate
Returns:
- -alpha
 o 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)
 o divide
  public abstract TimeValue[] divide(Unanchorable alpha,
                                     Unanchorable beta)
Divide an Unanchorable by an Unanchorable.

Parameters:
alpha - - divisee
beta - - divisor
result - - (TimeValue) alpha/beta
 o 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