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.
34 lines
507 B
34 lines
507 B
11 years ago
|
package net.mightypork.rcalc.operations;
|
||
|
|
||
|
|
||
|
import net.mightypork.rcalc.IEvaluable;
|
||
|
import net.mightypork.rcalc.numbers.Fraction;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Abstract unary operator
|
||
|
*
|
||
|
* @author Ondrej Hruska
|
||
|
*/
|
||
|
public abstract class UnaryOperation extends Operation {
|
||
|
|
||
|
/** Operand */
|
||
|
protected IEvaluable operand = null;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Create unary operation
|
||
|
*
|
||
|
* @param operand operand
|
||
|
*/
|
||
|
public UnaryOperation(IEvaluable operand) {
|
||
|
|
||
|
this.operand = operand;
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public abstract Fraction evaluate();
|
||
|
|
||
|
}
|