Class Expr.Var
- java.lang.Object
-
- at.jku.ssw.fp.sect04_4.visitor_fp.Expr
-
- at.jku.ssw.fp.sect04_4.visitor_fp.Expr.Var
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Consumer<Expr.Lit> litFn, Consumer<Expr.Var> varFn, Consumer<Expr.And> andFn, Consumer<Expr.Or> orFn, Consumer<Expr.Not> notFn)
Executes the action for theExpr.Var
type.<R> R
apply(Function<Expr.Lit,R> litFn, Function<Expr.Var,R> varFn, Function<Expr.And,R> andFn, Function<Expr.Or,R> orFn, Function<Expr.Not,R> notFn)
Applies the function for theExpr.Var
type.String
toString()
Returns a string representation.
-
-
-
Field Detail
-
name
public final String name
The variable name
-
-
Constructor Detail
-
Var
public Var(String name)
Constructor for variable expressions.- Parameters:
name
- the variable name
-
-
Method Detail
-
toString
public String toString()
Returns a string representation.
-
apply
public <R> R apply(Function<Expr.Lit,R> litFn, Function<Expr.Var,R> varFn, Function<Expr.And,R> andFn, Function<Expr.Or,R> orFn, Function<Expr.Not,R> notFn)
Applies the function for theExpr.Var
type.- Specified by:
apply
in classExpr
- Type Parameters:
R
- the type of the return value- Parameters:
litFn
- the function forExpr.Lit
objectsvarFn
- the function forExpr.Var
objectsandFn
- the function forExpr.And
objectsorFn
- the function forExpr.Or
objectsnotFn
- the function forExpr.Not
objects- Returns:
- the result of the function application
-
-