com.codetaco.algebrain.token.TokOperand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of algebrain Show documentation
Show all versions of algebrain Show documentation
Equation processing for Java
The newest version!
package com.codetaco.algebrain.token;
import com.codetaco.algebrain.EquPart;
import com.codetaco.algebrain.Function;
import com.codetaco.algebrain.ValueStack;
import com.codetaco.algebrain.operator.OpLeftParen;
/**
*
* Abstract TokOperand class.
*
*
* @author Chris DeGreef [email protected]
* @since 1.3.9
*/
public abstract class TokOperand extends Token
{
/**
*
* Constructor for TokOperand.
*
*/
public TokOperand()
{
super();
}
/** {@inheritDoc} */
@Override
public boolean multiplize(final EquPart rightSide)
{
return (rightSide instanceof OpLeftParen || rightSide instanceof TokOperand || rightSide instanceof Function);
}
/** {@inheritDoc} */
@Override
public void resolve(final ValueStack values) throws Exception
{
values.push(getValue());
}
}