All Packages Class Hierarchy This Package Previous Next Index
Class tadt.standard.LeftOperandSemantics
java.lang.Object

+tadt.standard.LeftOperandSemantics
 public class LeftOperandSemantics
 extends Object
 implements Semantics
LeftOperandSemantics implements a left operand semantics whereby
the right operand is cast to the granularity of the left operand
prior to performing the operation.
Below is an example of the semantics.
LeftOperandSemantics ops = new LeftOperandSemantics();
Granularity months = new Granularity("months", 32);
Granularity days = new Granularity("days", 32);
Instant i = new Instant(days, "34");
Interval j = new Interval(months, "100");
Instant k = ops.add(i,j); // k is in the granularity of "days"

LeftOperandSemantics()


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? Currently this does not
distinguish the "kinds" of Anchorables, although we could
change this as needed to just do each kind.

meets(Anchorable, Anchorable)

Does one Anchorable meet another?

multiply(Unanchorable, TimeValue)

Multiply an Unanchorable by a TimeValue.

negate(Unanchorable)

Negate an Unanchorable.

overlaps(Anchorable, Anchorable)

Does one Anchorable overlap another? This is true
iff there is some Period in the Anchorable that overalps some
Period in the other Anchorable.

precedes(Anchorable, Anchorable)

Does one Anchorable precede another?

subtract(Anchorable, Unanchorable)

Displace (subtract) an Anchorable with an Unanchorable.

subtract(Unanchorable, Anchorable)

Displace (subtract) an Unanchorable with an Anchorable
LeftOperandSemantics
public LeftOperandSemantics()
precedes
public ExtendedBoolean precedes(Anchorable alpha,
Anchorable beta)
 Does one Anchorable precede another?
 Parameters:
 alpha   Anchorable to compare
 beta   Anchorable to compare
 Returns:
 true or false
overlaps
public ExtendedBoolean overlaps(Anchorable alpha,
Anchorable beta)
 Does one Anchorable overlap another? This is true
iff there is some Period in the Anchorable that overalps some
Period in the other Anchorable.
 Parameters:
 alpha   Anchorable to compare
 beta   Anchorable to compare
 Returns:
 true or false
meets
public ExtendedBoolean meets(Anchorable alpha,
Anchorable beta)
 Does one Anchorable meet another?
 Parameters:
 alpha   Anchorable to compare
 beta   Anchorable to compare
 Returns:
 ExtendedBoolean
contains
public ExtendedBoolean contains(Anchorable alpha,
Anchorable beta)
 Does one Anchorable contain another?
 Parameters:
 alpha   Anchorable to compare
 beta   Anchorable to compare
 Returns:
 ExtendedBoolean
equalTo
public ExtendedBoolean equalTo(Anchorable alpha,
Anchorable beta)
 Is one Anchorable equalTo another? Currently this does not
distinguish the "kinds" of Anchorables, although we could
change this as needed to just do each kind.
 Parameters:
 alpha   Anchorable to compare
 beta   Anchorable to compare
 Returns:
 ExtendedBoolean
add
public Anchorable add(Anchorable alpha,
Unanchorable beta)
 Displace (add) an Anchorable with an Unanchorable.
 Parameters:
 alpha   displacee
 beta   displacor
 Returns:
  (alpha + cast(beta,alpha.granularity))
add
public Anchorable add(Unanchorable alpha,
Anchorable beta)
 Displace (add) an Unanchorable with an Anchorable.
 Parameters:
 alpha   displacor
 beta   displacee
 Returns:
  (alpha + cast(beta,alpha.granularity))
subtract
public Anchorable subtract(Anchorable alpha,
Unanchorable beta)
 Displace (subtract) an Anchorable with an Unanchorable.
 Parameters:
 alpha   displacee
 beta   displacor
 Returns:
  (alpha  cast(beta,alpha.granularity))
subtract
public Anchorable subtract(Unanchorable alpha,
Anchorable beta)
 Displace (subtract) an Unanchorable with an Anchorable
 Parameters:
 alpha   displacor
 beta   displacee
 Returns:
  (alpha + cast(beta,alpha.granularity))
negate
public Unanchorable negate(Unanchorable alpha)
 Negate an Unanchorable. Note this will mutate
the result parameter.
 Parameters:
 alpha   Unanchorable to negate
 Returns:
  alpha
multiply
public Unanchorable multiply(Unanchorable alpha,
TimeValue n)
 Multiply an Unanchorable by a TimeValue.
 Parameters:
 alpha   Unanchorable to multiply
 n   how many
 Returns:
 result  (alpha * n)
divide
public TimeValue[] divide(Unanchorable alpha,
Unanchorable beta)
 Divide an Unanchorable by an Unanchorable.
 Parameters:
 alpha   divisee
 beta   divisor
 result   (TimeValue) alpha/beta
divide
public Unanchorable divide(Unanchorable alpha,
TimeValue n)
 Divide an Unanchorable by a TimeValue.
 Parameters:
 alpha   divisee
 n   divisor
 result   alpha/n
All Packages Class Hierarchy This Package Previous Next Index