java: getElementsFromTo CalcTree --> CalcIterator
authorwneuper
Sun, 26 Jun 2005 13:02:29 +0200
changeset 2525a98929991bb8
parent 2524 98f97936d5da
child 2526 f37df79389c0
java: getElementsFromTo CalcTree --> CalcIterator
src/java/isac/bridge/CalcIterator.java
src/java/isac/bridge/CalcTree.java
src/java/isac/bridge/IBridgeRMI.java
     1.1 --- a/src/java/isac/bridge/CalcIterator.java	Sun Jun 26 13:02:29 2005 +0200
     1.2 +++ b/src/java/isac/bridge/CalcIterator.java	Sun Jun 26 13:02:29 2005 +0200
     1.3 @@ -3,11 +3,11 @@
     1.4   */
     1.5  package isac.bridge;
     1.6  
     1.7 -import isac.util.NotInSpecificationPhaseException;
     1.8  import isac.util.formulae.Assumptions;
     1.9  import isac.util.formulae.KEStoreID;
    1.10  import isac.util.formulae.Match;
    1.11  import isac.util.formulae.Position;
    1.12 +import isac.util.formulae.ProblemID;
    1.13  import isac.util.interfaces.ICalcElement;
    1.14  import isac.util.interfaces.ICalcIterator;
    1.15  import isac.util.tactics.Tactic;
    1.16 @@ -370,6 +370,24 @@
    1.17      }
    1.18  
    1.19      /**
    1.20 +     * @see isac.util.interfaces.IToCalc#getElementsFromTo(isac.util.interfaces.ICalcIterator,
    1.21 +     *      isac.util.interfaces.ICalcIterator, java.lang.Integer, boolean)
    1.22 +     */
    1.23 +    public Vector getElementsFromTo(ICalcIterator iterator_to, Integer level,
    1.24 +            boolean result_includes_tactics) throws RemoteException {
    1.25 +        logger_.fatal("  DG->BR: getElementsFromTo("
    1.26 +                + this.toSMLString() + ", "
    1.27 +                + iterator_to.toSMLString() + level + ")");
    1.28 +        try {
    1.29 +            return calc_tree_.getMathEngine().getElementsFromTo(calc_tree_id_,
    1.30 +                    this, iterator_to, level, result_includes_tactics);
    1.31 +        } catch (RemoteException e) {
    1.32 +            e.printStackTrace();
    1.33 +        }
    1.34 +        return null;
    1.35 +    }
    1.36 +
    1.37 +    /**
    1.38       * Set the position of this iterator to the position of another, given
    1.39       * iterator
    1.40       * 
    1.41 @@ -565,30 +583,46 @@
    1.42      /**
    1.43       * @see isac.util.interfaces.ICalcIterator#tryMatch()
    1.44       */
    1.45 -    public Match tryMatchProblem(KEStoreID problemID) throws RemoteException {
    1.46 +    public Match tryMatchProblem(ProblemID problemID) throws RemoteException {
    1.47          Match m = null;
    1.48 -        return null;
    1.49 +        try {
    1.50 +            m = calc_tree_.getMathEngine().tryMatchProblem(calc_tree_id_,
    1.51 +                    problemID);
    1.52 +        } catch (RemoteException e) {
    1.53 +            e.printStackTrace();
    1.54 +        }
    1.55 +        logger_.fatal("  DG<-BR: tryMatchProblem() <- " + m.toString());
    1.56 +        return m;
    1.57      }
    1.58  
    1.59      /**
    1.60       * @see isac.util.interfaces.ICalcIterator#tryRefine()
    1.61       */
    1.62 -    public Match tryRefineProblem(KEStoreID problemID) throws RemoteException {
    1.63 -        return null;
    1.64 +    public Match tryRefineProblem(ProblemID problemID) throws RemoteException {
    1.65 +        Match m = null;
    1.66 +        try {
    1.67 +            m = calc_tree_.getMathEngine().tryRefineProblem(calc_tree_id_,
    1.68 +                    problemID);
    1.69 +        } catch (RemoteException e) {
    1.70 +            e.printStackTrace();
    1.71 +        }
    1.72 +        logger_.fatal("  DG<-BR: tryRefineProblem() <- " + m.toString());
    1.73 +        return m;
    1.74      }
    1.75  
    1.76      /**
    1.77       * @see isac.util.interfaces.ICalcIterator#tryMatchMethod(KEStoreID)
    1.78       */
    1.79 -    public Match tryMatchMethod(KEStoreID problemID) throws RemoteException {
    1.80 -        return null;
    1.81 -    }
    1.82 -
    1.83 -    /**
    1.84 -     * @see isac.util.interfaces.ICalcIterator#tryRefineMethod(KEStoreID)
    1.85 -     */
    1.86 -    public Match tryRefineMethod(KEStoreID problemID) throws RemoteException {
    1.87 -        return null;
    1.88 +    public Match tryMatchMethod(KEStoreID methodID) throws RemoteException {
    1.89 +        Match m = null;
    1.90 +        try {
    1.91 +            m = calc_tree_.getMathEngine().tryMatchMethod(calc_tree_id_,
    1.92 +                    methodID);
    1.93 +        } catch (RemoteException e) {
    1.94 +            e.printStackTrace();
    1.95 +        }
    1.96 +        logger_.fatal("  DG<-BR: tryMatchMethod() <- " + m.toString());
    1.97 +        return m;
    1.98      }
    1.99  
   1.100      public String toSMLString() {
     2.1 --- a/src/java/isac/bridge/CalcTree.java	Sun Jun 26 13:02:29 2005 +0200
     2.2 +++ b/src/java/isac/bridge/CalcTree.java	Sun Jun 26 13:02:29 2005 +0200
     2.3 @@ -459,27 +459,6 @@
     2.4          return (int) (Math.random() * 0xFFFF);
     2.5      }
     2.6  
     2.7 -    /*
     2.8 -     * (non-Javadoc)
     2.9 -     * 
    2.10 -     * @see isac.util.interfaces.IToCalc#getElementsFromTo(isac.util.interfaces.ICalcIterator,
    2.11 -     *      isac.util.interfaces.ICalcIterator, java.lang.Integer, boolean)
    2.12 -     */
    2.13 -    public Vector getElementsFromTo(ICalcIterator iterator_from,
    2.14 -            ICalcIterator iterator_to, Integer level,
    2.15 -            boolean result_includes_tactics) throws RemoteException {
    2.16 -        logger_.fatal("  DG->BR: getElementsFromTo("
    2.17 -                + iterator_from.toSMLString() + ", "
    2.18 -                + iterator_to.toSMLString() + level + ")");
    2.19 -        try {
    2.20 -            return math_engine_.getElementsFromTo(this.id_, iterator_from,
    2.21 -                    iterator_to, level, result_includes_tactics);
    2.22 -        } catch (RemoteException e) {
    2.23 -            e.printStackTrace();
    2.24 -        }
    2.25 -        return null;
    2.26 -    }
    2.27 -
    2.28  //    /**
    2.29  //     * @see isac.util.interfaces.IToCalc#try_match_(CalcHead, CalcHeadCompoundID)
    2.30  //     *      FIXXXME.WN050610 change to: try_match_( CalcHeadCompoundID)
     3.1 --- a/src/java/isac/bridge/IBridgeRMI.java	Sun Jun 26 13:02:29 2005 +0200
     3.2 +++ b/src/java/isac/bridge/IBridgeRMI.java	Sun Jun 26 13:02:29 2005 +0200
     3.3 @@ -11,6 +11,7 @@
     3.4  import isac.util.formulae.CalcFormula;
     3.5  import isac.util.formulae.Match;
     3.6  import isac.util.formulae.Position;
     3.7 +import isac.util.formulae.ProblemID;
     3.8  import isac.util.interfaces.ICalcElement;
     3.9  import isac.util.interfaces.ICalcIterator;
    3.10  import isac.util.tactics.Tactic;
    3.11 @@ -112,10 +113,10 @@
    3.12      public Assumptions getAccumulatedAssumptions(int calcTreeID, Position pos)
    3.13              throws RemoteException;
    3.14  
    3.15 -    public Match tryMatchProblem(int calcTreeID, KEStoreID problemID)
    3.16 +    public Match tryMatchProblem(int calcTreeID, ProblemID problemID)
    3.17              throws RemoteException;
    3.18  
    3.19 -    public Match tryRefineProblem(int calcTreeID, KEStoreID problemID)
    3.20 +    public Match tryRefineProblem(int calcTreeID, ProblemID problemID)
    3.21              throws RemoteException;
    3.22  
    3.23      public Match tryMatchMethod(int calcTreeID, KEStoreID problemID)