Module xl.core

Class Filter

java.lang.Object
de.grogra.xl.lang.Filter

public final class Filter extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    boolean
    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 is double.
    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 is float.
    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 is boolean, byte, short, char, or int.
    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 is long.
    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 Type
    Method
    Description
    static Filter
     
    Returns the result type of the filter.
    boolean
    Returns true the first time it is invoked.
    boolean
    Returns true iff setFinished() has been called previously.
    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

    • accept

      public boolean accept
      An 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 to true, the filter method also has to set the val-field corresponding to the result type to the filtered value. Otherwise, the invocation has not passed the filter.
    • 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 filter methods.
    • ival2

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

      public int ival3
      This field may be used freely by filter methods.
    • lval1

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

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

      public long lval3
      This field may be used freely by filter methods.
    • fval1

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

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

      public float fval3
      This field may be used freely by filter methods.
    • dval1

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

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

      public double dval3
      This field may be used freely by filter methods.
    • aval1

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

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

      public Object aval3
      This field may be used freely by filter methods.
  • Method Details

    • allocate

      public static Filter allocate(Class type)
    • initialize

      public boolean initialize()
      Returns true 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 the finished-flags to true. This may only be invoked by filter methods.
      See Also:
    • isFinished

      public boolean isFinished()
      Returns true iff setFinished() 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 iff setFinished() has been called previously
    • getType

      public Class 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: