private final V process ( final Iterable < DiceNotationExpression > nodes ) { accumulator . reset ( ) ; for ( final DiceNotationExpression current : nodes ) { if ( current instanceof BinaryOperation ) { accumulator . binaryOperation ( ( BinaryOperation ) current ) ; } else if ( current instanceof ConstantOperand ) { accumulator . constantOperand ( ( ConstantOperand ) current ) ; } else if ( current instanceof DiceOperand ) { accumulator . diceOperand ( ( DiceOperand ) current ) ; } else { LOGGER . warn ( "Unsupported expression of type {}" , current . getClass ( ) ) ; } } return accumulator . getValue ( ) ; }
Returns the result from applying the accumulator in all the nodes .