Class Expressions

java.lang.Object
li.selman.jpbe.dsl.expression.Expressions
All Implemented Interfaces:
DslElement, Expression

public class Expressions extends Object implements Expression
Represents a full program p which can be applied on a input string to get the intended output. p is made up of n Expressions, while itself being an Expression.
  • Constructor Details

  • Method Details

    • apply

      public Optional<String> apply(String s)
      Applies all expressions on s and joins the results in order.
      Specified by:
      apply in interface Expression
      Parameters:
      s - input string
      Returns:
      the whole output string
    • 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 interface DslElement
      Returns:
      the weight of the DSL element
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object