package gve.calc.formula;
import java.awt.*;
import java.util.Vector;
public class OperatorComma extends InfixBinaryOp {
public String getName() { return ","; }
public int getPri() { return 500; }
public int getLeftPri() { return 510; }
public int getRightPri() { return 490; }
public OperatorComma(Part l,Part r) {
super(l,r);
}
public Part evaluate(Evaluator ev) {
return new OperatorComma(left.evaluate(ev),right.evaluate(ev));
}
| Converts a tree containing "a,b,c,..." to an array with elements a, b, c, ... Warning: the subtrees are not copied. You just get a bunch of pointers into the existing formula back. |
| If this is the leftmost comma of a list, create a copy of it, except one part. If you also want to handle lists with 0 or 1 elements (which have no commas), use the static copyListExcept(Part,Part) variant. |
| Copy a list, excluding one element. The list may be a single identifier or a chain of Comma operators. Empty lists are represented by an empty identifier. |
| Add 'toAdd' in front of the list. The list should not be inside brackets. The list may also be a single identifier. |