Package li.selman.jpbe.dsl.expression
Class ConstantStringExpression
java.lang.Object
li.selman.jpbe.dsl.expression.ConstantStringExpression
- All Implemented Interfaces:
DslElement
,Expression
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
ConstantStringExpression
- Parameters:
constant
- will always be returned regardless the input string- Throws:
IllegalArgumentException
- ifconstant
is null or empty
-
-
Method Details
-
apply
- Specified by:
apply
in interfaceExpression
-
getDslWeight
public int getDslWeight()Description copied from interface:DslElement
The weight can be used to find an optimal program in a set of valid programs. "Optimal" is subjective and can go into different directions. Some examples include:- Weight by how expensive a DSL element is to execute.
-
Weight by how likely a DSL element is to be part of a generic full program.
A ConstantPosition generally is less generic.
Thus, the user has to specify their intent more often to finish their wrangling task.
- Specified by:
getDslWeight
in interfaceDslElement
- Returns:
- the weight of the DSL element
-
equals
-
hashCode
public int hashCode() -
toString
-