java.lang.Object
de.grogra.xl.lang.Aggregate
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
Modifier and TypeFieldDescriptionThis 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 isdouble
.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 isfloat
.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 isboolean
,byte
,short
,char
, orint
.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 islong
.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 TypeMethodDescriptionstatic Aggregate
static Object
static double
static float
getType()
Returns the result type of the aggregation.boolean
Returnstrue
the first time it is invoked.boolean
Returnstrue
iffsetFinished()
has been called previously.static int
static long
void
Sets thefinished
-flags totrue
.
-
Field Details
-
ival
public int ivalThis field contains the result if the type isboolean
,byte
,short
,char
, orint
. -
lval
public long lvalThis field contains the result if the type islong
. -
fval
public float fvalThis field contains the result if the type isfloat
. -
dval
public double dvalThis field contains the result if the type isdouble
. -
aval
This field contains the result if the type is a reference type. It has to be of the type returned bygetType()
. -
ival1
public int ival1This field may be used freely by aggregate methods. -
ival2
public int ival2This field may be used freely by aggregate methods. -
ival3
public int ival3This field may be used freely by aggregate methods. -
ival4
public int ival4This field may be used freely by aggregate methods. -
lval1
public long lval1This field may be used freely by aggregate methods. -
lval2
public long lval2This field may be used freely by aggregate methods. -
lval3
public long lval3This field may be used freely by aggregate methods. -
lval4
public long lval4This field may be used freely by aggregate methods. -
fval1
public float fval1This field may be used freely by aggregate methods. -
fval2
public float fval2This field may be used freely by aggregate methods. -
fval3
public float fval3This field may be used freely by aggregate methods. -
fval4
public float fval4This field may be used freely by aggregate methods. -
dval1
public double dval1This field may be used freely by aggregate methods. -
dval2
public double dval2This field may be used freely by aggregate methods. -
dval3
public double dval3This field may be used freely by aggregate methods. -
dval4
public double dval4This field may be used freely by aggregate methods. -
aval1
This field may be used freely by aggregate methods. -
aval2
This field may be used freely by aggregate methods. -
aval3
This field may be used freely by aggregate methods. -
aval4
This field may be used freely by aggregate methods.
-
-
Method Details
-
allocate
-
ival
-
lval
-
fval
-
dval
-
aval
-
initialize
public boolean initialize()Returnstrue
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 thefinished
-flags totrue
.- See Also:
-
isFinished
public boolean isFinished()Returnstrue
iffsetFinished()
has been called previously. This is used for two purposes:- 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
, oraval
). - 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
iffsetFinished()
has been called previously
- 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
(
-
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:
-