Module xl.core

Class Aggregate

java.lang.Object
de.grogra.xl.lang.Aggregate

public final class Aggregate extends Object
An instance of Aggregate is used in aggregate method invocations as specified by the XL programming language. Aggregate methods use such an instance to collect the information about a sequence of values which they need to compute an aggregate value.
Author:
Ole Kniemeyer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    This field contains the result if the type is a reference type.
    This field may be used freely by aggregate methods.
    This field may be used freely by aggregate methods.
    This field may be used freely by aggregate methods.
    This field may be used freely by aggregate methods.
    double
    This field contains the result if the type is double.
    double
    This field may be used freely by aggregate methods.
    double
    This field may be used freely by aggregate methods.
    double
    This field may be used freely by aggregate methods.
    double
    This field may be used freely by aggregate methods.
    float
    This field contains the result if the type is float.
    float
    This field may be used freely by aggregate methods.
    float
    This field may be used freely by aggregate methods.
    float
    This field may be used freely by aggregate methods.
    float
    This field may be used freely by aggregate methods.
    int
    This field contains the result if the type is boolean, byte, short, char, or int.
    int
    This field may be used freely by aggregate methods.
    int
    This field may be used freely by aggregate methods.
    int
    This field may be used freely by aggregate methods.
    int
    This field may be used freely by aggregate methods.
    long
    This field contains the result if the type is long.
    long
    This field may be used freely by aggregate methods.
    long
    This field may be used freely by aggregate methods.
    long
    This field may be used freely by aggregate methods.
    long
    This field may be used freely by aggregate methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Aggregate
     
    static Object
     
    static double
     
    static float
     
    Returns the result type of the aggregation.
    boolean
    Returns true the first time it is invoked.
    boolean
    Returns true iff setFinished() has been called previously.
    static int
     
    static long
     
    void
    Sets the finished-flags to true.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ival

      public int ival
      This field contains the result if the type is boolean, byte, short, char, or int.
    • lval

      public long lval
      This field contains the result if the type is long.
    • fval

      public float fval
      This field contains the result if the type is float.
    • dval

      public double dval
      This field contains the result if the type is double.
    • aval

      public Object aval
      This field contains the result if the type is a reference type. It has to be of the type returned by getType().
    • ival1

      public int ival1
      This field may be used freely by aggregate methods.
    • ival2

      public int ival2
      This field may be used freely by aggregate methods.
    • ival3

      public int ival3
      This field may be used freely by aggregate methods.
    • ival4

      public int ival4
      This field may be used freely by aggregate methods.
    • lval1

      public long lval1
      This field may be used freely by aggregate methods.
    • lval2

      public long lval2
      This field may be used freely by aggregate methods.
    • lval3

      public long lval3
      This field may be used freely by aggregate methods.
    • lval4

      public long lval4
      This field may be used freely by aggregate methods.
    • fval1

      public float fval1
      This field may be used freely by aggregate methods.
    • fval2

      public float fval2
      This field may be used freely by aggregate methods.
    • fval3

      public float fval3
      This field may be used freely by aggregate methods.
    • fval4

      public float fval4
      This field may be used freely by aggregate methods.
    • dval1

      public double dval1
      This field may be used freely by aggregate methods.
    • dval2

      public double dval2
      This field may be used freely by aggregate methods.
    • dval3

      public double dval3
      This field may be used freely by aggregate methods.
    • dval4

      public double dval4
      This field may be used freely by aggregate methods.
    • aval1

      public Object aval1
      This field may be used freely by aggregate methods.
    • aval2

      public Object aval2
      This field may be used freely by aggregate methods.
    • aval3

      public Object aval3
      This field may be used freely by aggregate methods.
    • aval4

      public Object aval4
      This field may be used freely by aggregate methods.
  • Method Details

    • allocate

      public static Aggregate allocate(Class type)
    • ival

      public static int ival(Aggregate a)
    • lval

      public static long lval(Aggregate a)
    • fval

      public static float fval(Aggregate a)
    • dval

      public static double dval(Aggregate a)
    • aval

      public static Object aval(Aggregate a)
    • initialize

      public boolean initialize()
      Returns true the first time it is invoked. This has to be queried in implementations of aggregate methods to initialize their computation.
      Returns:
      true iff this method is invoked the first time for a specific invocation of an aggregate method
    • setFinished

      public void setFinished()
      Sets the finished-flags to true.
      See Also:
    • isFinished

      public boolean isFinished()
      Returns true iff setFinished() has been called previously. This is used for two purposes:
      1. To indicate the aggregate method implementation that no more values are available for aggregation. The aggregate method has to compute the final result and place it in the appropriate field (ival, lval, fval, dval, or aval).
      2. To indicate the invoker of the aggregate method that the computation of the aggregate value has been completed by the aggregate method, even if there are values left for aggregation. E.g., this is the case for a shortcut-implementation of the boolean or where the result is known when the first true-value is encountered. The invoker must not invoke the aggregate method again.
      Returns:
      true iff setFinished() has been called previously
    • getType

      public Class getType()
      Returns the result type of the aggregation. This has to be respected by aggregate method implementations which compute aggregate values of reference type.
      Returns:
      the result type
      See Also: