# HG changeset patch # User wneuper # Date 1118762570 -7200 # Node ID 59a60ef2a2c8bd6e27476e01ef7ff06fcba9c93e # Parent 42e7eb39a0b1844afba81873b6409d36ce532fc2 java: minor changes preparing tryMatch diff -r 42e7eb39a0b1 -r 59a60ef2a2c8 src/java/isac/bridge/CalcTree.java --- a/src/java/isac/bridge/CalcTree.java Wed Jun 08 17:37:21 2005 +0200 +++ b/src/java/isac/bridge/CalcTree.java Tue Jun 14 17:22:50 2005 +0200 @@ -6,9 +6,11 @@ import isac.util.CalcChanged; import isac.util.CalcChangedEvent; +import isac.util.NotInSpecificationPhaseException; import isac.util.StartSolvingException; import isac.util.formulae.CalcHead; import isac.util.formulae.CalcFormula; +import isac.util.formulae.CalcHeadCompoundID; import isac.util.formulae.Position; import isac.util.interfaces.ICalcIterator; import isac.util.interfaces.IToCalc; @@ -510,4 +512,48 @@ return null; } + /** + * @see isac.util.interfaces.IToCalc#tryMatch(CalcHead, CalcHeadCompoundID) + * FIXXXME.WN050610 change to: tryMatch( CalcHeadCompoundID) + */ + public void tryMatch(CalcHead calcHead, CalcHeadCompoundID problemID) + throws NotInSpecificationPhaseException { + CalcHead newCalcHead = null; + try { + //WN040924 newCalcHead = + // bridgeRMI.tryMatch(calcHead.getCalcTreeID(), problemID); + bridgeRMI_.tryMatch(calcHead.getCalcTreeID(), problemID); + if (newCalcHead == null) { + throw new NotInSpecificationPhaseException(); + } + calcHead.fillValuesfrom(newCalcHead); + } catch (RemoteException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * Refine a given problem for this CalcTree + * + * @param problemID + * @return CalcHead, if the operation was successful, else null + */ + public void tryRefine(CalcHead calcHead, CalcHeadCompoundID problemID) + throws NotInSpecificationPhaseException { + CalcHead newCalcHead = null; + try { + //WN040924 newCalcHead = + // bridgeRMI.tryRefine(calcHead.getCalcTreeID(), problemID); + bridgeRMI_.tryRefine(calcHead.getCalcTreeID(), problemID); + if (newCalcHead == null) { + throw new NotInSpecificationPhaseException(); + } + calcHead.fillValuesfrom(newCalcHead); + } catch (RemoteException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } \ No newline at end of file diff -r 42e7eb39a0b1 -r 59a60ef2a2c8 src/java/isac/bridge/MathEngine.java --- a/src/java/isac/bridge/MathEngine.java Wed Jun 08 17:37:21 2005 +0200 +++ b/src/java/isac/bridge/MathEngine.java Tue Jun 14 17:22:50 2005 +0200 @@ -175,51 +175,52 @@ * catch (RemoteException e) { e.printStackTrace(); } } */ - /** - * Refine a given problem for this CalcTree - * - * @param problemID - * @return CalcHead, if the operation was successful, else null - */ - public void tryRefine(CalcHead calcHead, CalcHeadCompoundID problemID) - throws NotInSpecificationPhaseException { - CalcHead newCalcHead = null; - try { - //WN040924 newCalcHead = - // bridgeRMI.tryRefine(calcHead.getCalcTreeID(), problemID); - bridgeRMI.tryRefine(calcHead.getCalcTreeID(), problemID); - if (newCalcHead == null) { - throw new NotInSpecificationPhaseException(); - } - calcHead.fillValuesfrom(newCalcHead); - } catch (RemoteException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } +// /** +// * Refine a given problem for this CalcTree +// * +// * @param problemID +// * @return CalcHead, if the operation was successful, else null +// */ +// public void tryRefine(CalcHead calcHead, CalcHeadCompoundID problemID) +// throws NotInSpecificationPhaseException { +// CalcHead newCalcHead = null; +// try { +// //WN040924 newCalcHead = +// // bridgeRMI.tryRefine(calcHead.getCalcTreeID(), problemID); +// bridgeRMI.tryRefine(calcHead.getCalcTreeID(), problemID); +// if (newCalcHead == null) { +// throw new NotInSpecificationPhaseException(); +// } +// calcHead.fillValuesfrom(newCalcHead); +// } catch (RemoteException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } - /** - * Match a given problem for this CalcTree - * - * @param problemID - * @return CalcHead, if the operation was successful, else null - */ - public void tryMatch(CalcHead calcHead, CalcHeadCompoundID problemID) - throws NotInSpecificationPhaseException { - CalcHead newCalcHead = null; - try { - //WN040924 newCalcHead = - // bridgeRMI.tryMatch(calcHead.getCalcTreeID(), problemID); - bridgeRMI.tryMatch(calcHead.getCalcTreeID(), problemID); - if (newCalcHead == null) { - throw new NotInSpecificationPhaseException(); - } - calcHead.fillValuesfrom(newCalcHead); - } catch (RemoteException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } +//WN050610 transferred toCalcTree +// /** +// * Match a given problem for this CalcTree +// * +// * @param problemID +// * @return CalcHead, if the operation was successful, else null +// */ +// public void tryMatch(CalcHead calcHead, CalcHeadCompoundID problemID) +// throws NotInSpecificationPhaseException { +// CalcHead newCalcHead = null; +// try { +// //WN040924 newCalcHead = +// // bridgeRMI.tryMatch(calcHead.getCalcTreeID(), problemID); +// bridgeRMI.tryMatch(calcHead.getCalcTreeID(), problemID); +// if (newCalcHead == null) { +// throw new NotInSpecificationPhaseException(); +// } +// calcHead.fillValuesfrom(newCalcHead); +// } catch (RemoteException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } // Delegated methods from CalcTree/Iterator int setNextTactic(int id, Tactic tactic) throws RemoteException { diff -r 42e7eb39a0b1 -r 59a60ef2a2c8 src/java/isac/util/formulae/CalcHead.java --- a/src/java/isac/util/formulae/CalcHead.java Wed Jun 08 17:37:21 2005 +0200 +++ b/src/java/isac/util/formulae/CalcHead.java Tue Jun 14 17:22:50 2005 +0200 @@ -96,8 +96,7 @@ /** * Format the object in a way that the bridge can handle it FIXME.WN041008 - * this is Formalization.toSMLString, _NOT_ CalcHead.toSMLString - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * this is Formalization.toSMLString, _NOT_ CalcHead.toSMLString !!! * * @return SML representation */ diff -r 42e7eb39a0b1 -r 59a60ef2a2c8 src/java/isac/util/interfaces/IToCalc.java --- a/src/java/isac/util/interfaces/IToCalc.java Wed Jun 08 17:37:21 2005 +0200 +++ b/src/java/isac/util/interfaces/IToCalc.java Tue Jun 14 17:22:50 2005 +0200 @@ -9,6 +9,7 @@ import isac.bridge.CalcTree; import isac.util.Formalization; +import isac.util.NotInSpecificationPhaseException; import isac.util.formulae.*; import isac.util.tactics.*; @@ -294,4 +295,16 @@ ICalcIterator iterator_to, Integer level, boolean result_includes_tactics) throws RemoteException; + /** + * Match a given problem for this CalcTree + * + * @param problemID + * @param CalcHead FIXXXME.WN050610 drop !!! + * + * @return CalcHead, if the operation was successful, else null + * ... replaced by ref-arg to be used instead + */ + public void tryMatch(CalcHead calcHead, CalcHeadCompoundID problemID) + throws NotInSpecificationPhaseException; + } \ No newline at end of file