Class DynamicPosition

java.lang.Object
li.selman.jpbe.dsl.position.DynamicPosition
All Implemented Interfaces:
DslElement, Position

public class DynamicPosition extends Object implements Position
  • Constructor Details

  • Method Details

    • 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
    • evalToPosition

      public int evalToPosition(String s) throws NoPositionException
      Description copied from interface: Position
      Given an input, dynamically evaluate to an index inside for string manipulation operations.
      Specified by:
      evalToPosition in interface Position
      Parameters:
      s - input
      Returns:
      the index
      Throws:
      NoPositionException - if no position can be evaluated to
    • 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