src/java/isac/bridge/CalcTree.java
changeset 2391 59a60ef2a2c8
parent 2265 724052025566
child 2448 f6065237ac78
     1.1 --- a/src/java/isac/bridge/CalcTree.java	Wed Jun 08 17:37:21 2005 +0200
     1.2 +++ b/src/java/isac/bridge/CalcTree.java	Tue Jun 14 17:22:50 2005 +0200
     1.3 @@ -6,9 +6,11 @@
     1.4  
     1.5  import isac.util.CalcChanged;
     1.6  import isac.util.CalcChangedEvent;
     1.7 +import isac.util.NotInSpecificationPhaseException;
     1.8  import isac.util.StartSolvingException;
     1.9  import isac.util.formulae.CalcHead;
    1.10  import isac.util.formulae.CalcFormula;
    1.11 +import isac.util.formulae.CalcHeadCompoundID;
    1.12  import isac.util.formulae.Position;
    1.13  import isac.util.interfaces.ICalcIterator;
    1.14  import isac.util.interfaces.IToCalc;
    1.15 @@ -510,4 +512,48 @@
    1.16  		return null;
    1.17  	}
    1.18  
    1.19 +	/**
    1.20 +	 * @see isac.util.interfaces.IToCalc#tryMatch(CalcHead, CalcHeadCompoundID)
    1.21 +	 * FIXXXME.WN050610 change to:       tryMatch(          CalcHeadCompoundID)
    1.22 +	 */
    1.23 +	public void tryMatch(CalcHead calcHead, CalcHeadCompoundID problemID)
    1.24 +			throws NotInSpecificationPhaseException {
    1.25 +		CalcHead newCalcHead = null;
    1.26 +		try {
    1.27 +			//WN040924 newCalcHead =
    1.28 +			// bridgeRMI.tryMatch(calcHead.getCalcTreeID(), problemID);
    1.29 +			bridgeRMI_.tryMatch(calcHead.getCalcTreeID(), problemID);
    1.30 +			if (newCalcHead == null) {
    1.31 +				throw new NotInSpecificationPhaseException();
    1.32 +			}
    1.33 +			calcHead.fillValuesfrom(newCalcHead);
    1.34 +		} catch (RemoteException e) {
    1.35 +			// TODO Auto-generated catch block
    1.36 +			e.printStackTrace();
    1.37 +		}
    1.38 +	}
    1.39 +
    1.40 +	/**
    1.41 +	 * Refine a given problem for this CalcTree
    1.42 +	 * 
    1.43 +	 * @param problemID
    1.44 +	 * @return CalcHead, if the operation was successful, else null
    1.45 +	 */
    1.46 +	public void tryRefine(CalcHead calcHead, CalcHeadCompoundID problemID)
    1.47 +			throws NotInSpecificationPhaseException {
    1.48 +		CalcHead newCalcHead = null;
    1.49 +		try {
    1.50 +			//WN040924 newCalcHead =
    1.51 +			// bridgeRMI.tryRefine(calcHead.getCalcTreeID(), problemID);
    1.52 +			bridgeRMI_.tryRefine(calcHead.getCalcTreeID(), problemID);
    1.53 +			if (newCalcHead == null) {
    1.54 +				throw new NotInSpecificationPhaseException();
    1.55 +			}
    1.56 +			calcHead.fillValuesfrom(newCalcHead);
    1.57 +		} catch (RemoteException e) {
    1.58 +			// TODO Auto-generated catch block
    1.59 +			e.printStackTrace();
    1.60 +		}
    1.61 +	}
    1.62 +	
    1.63  }
    1.64 \ No newline at end of file