package LBJ2.infer; /** * Anonymous inner classes extending this class are instantiated by the code * generated by the LBJ compiler when creating * <code>FirstOrderConstraint</code> representations. The methods of this * class are used to compute new values for the arguments of a quantified * <code>FirstOrderEquality</code>. Only certain value returning methods are * overridden. The others will throw * <code>UnsupportedOperationException</code>s. * * @see LBJ2.infer.FirstOrderConstraint * @see LBJ2.infer.FirstOrderEquality * @see java.lang.UnsupportedOperationException * @author Nick Rizzolo **/ abstract public class EqualityArgumentReplacer extends ArgumentReplacer { /** * This flag is set if the left hand side of the equality is not * quantified. **/ public boolean leftConstant; /** * This flag is set if the right hand side of the equality is not * quantified. **/ public boolean rightConstant; /** * Initializing constructor. * * @param c The context of the corresponding equality, except for * quantification variables. **/ public EqualityArgumentReplacer(Object[] c) { super(c); leftConstant = rightConstant = false; } /** * Use this constructor to indicate which of the two arguments of the * equality is in fact not quantified. * * @param c The context of the corresponding equality, except for * quantification variables. * @param r Set to <code>false</code> if the unquantified argument is the * left; set to <code>true</code> if the unquantified argument is * the right. **/ public EqualityArgumentReplacer(Object[] c, boolean r) { super(c); leftConstant = !r; rightConstant = r; } /** * Computes the value on the left hand side of the equality. This method * needs to be overridden if it is to be called, since by default it simply * throws an <code>UnsupportedOperationException</code>. **/ public String getLeftValue() { throw new UnsupportedOperationException( "LBJ ERROR: getLeftValue() not supported."); } /** * Computes the value on the right hand side of the equality. This method * needs to be overridden if it is to be called, since by default it simply * throws an <code>UnsupportedOperationException</code>. **/ public String getRightValue() { throw new UnsupportedOperationException( "LBJ ERROR: getRightValue() not supported."); } /** * Computes the object on the left hand side of the equality. This method * needs to be overridden if it is to be called, since by default it simply * throws an <code>UnsupportedOperationException</code>. **/ public Object getLeftObject() { throw new UnsupportedOperationException( "LBJ ERROR: getLeftObject() not supported."); } /** * Computes the object on the right hand side of the equality. This method * needs to be overridden if it is to be called, since by default it simply * throws an <code>UnsupportedOperationException</code>. **/ public Object getRightObject() { throw new UnsupportedOperationException( "LBJ ERROR: getRightObject() not supported."); } }