Class TradeTokenEvaluator


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

    This merges the Trade and TradeInfo objects, giving priority to Trade.

    • Constructor Detail

      • TradeTokenEvaluator

        public TradeTokenEvaluator()
    • Method Detail

      • getTargetType

        public java.lang.Class<Trade> getTargetType()
        Description copied from class: TokenEvaluator
        Gets the type against which tokens can be evaluated in this implementation.
        Specified by:
        getTargetType in class TokenEvaluator<Trade>
        Returns:
        the evaluation type
      • tokens

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

        public EvaluationResult evaluate​(Trade trade,
                                         CalculationFunctions functions,
                                         java.lang.String firstToken,
                                         java.util.List<java.lang.String> remainingTokens)
        Description copied from class: TokenEvaluator
        Evaluates a token against a given object.
        Specified by:
        evaluate in class TokenEvaluator<Trade>
        Parameters:
        trade - 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