Class PositionTokenEvaluator


  • public class PositionTokenEvaluator
    extends TokenEvaluator<Position>
    Evaluates a token against a trade to produce another object.

    This merges the Position and PositionInfo objects, giving priority to Position.

    • Constructor Detail

      • PositionTokenEvaluator

        public PositionTokenEvaluator()
    • Method Detail

      • tokens

        public Set<String> tokens​(Position position)
        Description copied from class: TokenEvaluator
        Gets the set of supported token for the given object.
        Specified by:
        tokens in class TokenEvaluator<Position>
        Parameters:
        position - the object against which tokens may be evaluated
        Returns:
        the set of supported tokens
      • evaluate

        public EvaluationResult evaluate​(Position position,
                                         CalculationFunctions functions,
                                         String firstToken,
                                         List<String> remainingTokens)
        Description copied from class: TokenEvaluator
        Evaluates a token against a given object.
        Specified by:
        evaluate in class TokenEvaluator<Position>
        Parameters:
        position - the object against which to evaluate the token
        functions - the calculation functions
        firstToken - the first token of the expression
        remainingTokens - the remaining tokens in the expression, possibly empty
        Returns:
        the result of the evaluation