Class BoundVariable

All Implemented Interfaces:
Formattable, Serializable, Cloneable

public class BoundVariable extends Variable
Variable identified by an index number, resolved by un-named arguments by counting their positions.
See Also:
  • Constructor Details

  • Method Details

    • getIndex

      public int getIndex()
      Return the position of the argument to be replaced by this variable.
      Returns:
      the position of the argument to be replaced by this variable.
    • eval

      public Format eval(Context c, boolean partial)
      Return the Format value bound to position index of this variable in the given context. If the index is higher than the defined range of arguemnts: if partial==true the index is adjusted by subtracting the number of arguments in the context. Otherwise an exception is thrown by returning Variable.bottom().
      Overrides:
      eval in class Format
      Parameters:
      c - defines the replacement for variables by name and number.
      partial - decides when a Variable not defined in the context is found: if true the Variable stays aunaltered; if false an IllegalArgumentException is thrown.
      Returns:
      a format with all or some variables replaced