java.lang.Object
de.grogra.xl.lang.Filter
An instance of
Filter
is used in filter method
invocations as specified by the XL programming language.
Filter methods use such an instance to store state information
which they need to perform the filtering.- Author:
- Ole Kniemeyer
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
An invocation of a filter method has to set this field to indicate whether the invocation has passed the filter or not.This field contains the result if the type is a reference type.This field may be used freely by filter methods.This field may be used freely by filter methods.This field may be used freely by filter methods.double
This field contains the result if the type isdouble
.double
This field may be used freely by filter methods.double
This field may be used freely by filter methods.double
This field may be used freely by filter methods.float
This field contains the result if the type isfloat
.float
This field may be used freely by filter methods.float
This field may be used freely by filter methods.float
This field may be used freely by filter methods.int
This field contains the result if the type isboolean
,byte
,short
,char
, orint
.int
This field may be used freely by filter methods.int
This field may be used freely by filter methods.int
This field may be used freely by filter methods.long
This field contains the result if the type islong
.long
This field may be used freely by filter methods.long
This field may be used freely by filter methods.long
This field may be used freely by filter methods. -
Method Summary
Modifier and TypeMethodDescriptionstatic Filter
getType()
Returns the result type of the filter.boolean
Returnstrue
the first time it is invoked.boolean
Returnstrue
iffsetFinished()
has been called previously.void
Sets thefinished
-flags totrue
.
-
Field Details
-
accept
public boolean acceptAn invocation of a filter method has to set this field to indicate whether the invocation has passed the filter or not. If this field is set totrue
, the filter method also has to set theval
-field corresponding to the result type to the filtered value. Otherwise, the invocation has not passed the filter. -
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 filter methods. -
ival2
public int ival2This field may be used freely by filter methods. -
ival3
public int ival3This field may be used freely by filter methods. -
lval1
public long lval1This field may be used freely by filter methods. -
lval2
public long lval2This field may be used freely by filter methods. -
lval3
public long lval3This field may be used freely by filter methods. -
fval1
public float fval1This field may be used freely by filter methods. -
fval2
public float fval2This field may be used freely by filter methods. -
fval3
public float fval3This field may be used freely by filter methods. -
dval1
public double dval1This field may be used freely by filter methods. -
dval2
public double dval2This field may be used freely by filter methods. -
dval3
public double dval3This field may be used freely by filter methods. -
aval1
This field may be used freely by filter methods. -
aval2
This field may be used freely by filter methods. -
aval3
This field may be used freely by filter methods.
-
-
Method Details
-
allocate
-
initialize
public boolean initialize()Returnstrue
the first time it is invoked. This has to be queried in implementations of filter methods to initialize their state.- Returns:
true
iff this method is invoked the first time for a specific invocation of a filter method
-
setFinished
public void setFinished()Sets thefinished
-flags totrue
. This may only be invoked by filter methods.- See Also:
-
isFinished
public boolean isFinished()Returnstrue
iffsetFinished()
has been called previously. This is used to indicate the invoker of the filter method that it must not invoke the filter method any more, even if there are values left for filtering.- Returns:
true
iffsetFinished()
has been called previously
-
getType
Returns the result type of the filter. This has to be respected by filter method implementations which compute resulting values of reference type.- Returns:
- the result type
- See Also:
-