You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
495 B
29 lines
495 B
package net.mightypork.rcalc.tokens;
|
|
|
|
|
|
import net.mightypork.rcalc.TokenList;
|
|
import net.mightypork.rcalc.operations.Operation;
|
|
import net.mightypork.rcalc.operations.OperationFactorial;
|
|
|
|
|
|
/**
|
|
* Factorial token
|
|
*
|
|
* @author Ondrej Hruska
|
|
*/
|
|
public class TokenOperatorFactorial extends TokenUnaryOperatorLeft {
|
|
|
|
@Override
|
|
public String toString() {
|
|
|
|
return "!";
|
|
}
|
|
|
|
|
|
@Override
|
|
public Operation toOperation(TokenList argument) {
|
|
|
|
return new OperationFactorial(argument.parse());
|
|
}
|
|
|
|
}
|
|
|