public class PolyNode { int _power; double _coefficient; PolyNode _next; char _sign;
public PolyNode() { _next = null; _sign = '+'; _coefficient = 1; _power = 1; }
public PolyNode(char daSign, double co, int daPower, PolyNode daLink) { _sign = daSign; _coefficient = co; _power = daPower; _next = daLink; }
public PolyNode(PolyNode next) { _next = next; }
public void setSign(char setTo) { _sign = setTo; }
public void setCoef(double coef) { _coefficient = coef; }
public void setPower(int whatsMyPower) { _power = whatsMyPower; }
public void setNext(PolyNode next) { _next = next; }
public char getSign() { return _sign; }
public double getCoef() { return _coefficient; }
public int getPower() { return _power; }
public PolyNode getNext() { return _next; }
public boolean isEnd() { return (_next == null); } } |