View Javadoc

1   package fr.ove.openmath.jome.model;
2   
3   import java.util.*;
4   import fr.ove.openmath.jome.model.*;
5   import fr.ove.openmath.jome.model.events.ModelEvent;
6   
7   /***
8   *
9   * @author © 1999 DIRAT Laurent
10  * @version 2.0 28/06/1999
11  */
12  public class Rational extends KaryOperator {
13      /*** 
14      * Inserts the instance in the formula tree structure.<BR>
15      * @param current the position in the formula tree where the operator is to be insert.
16      * @return the new current position int hte formula tree.
17      */
18      public FormulaTreeStructure insert(FormulaTreeStructure current) {
19          current = super.insert(current);
20          super.addElement();
21          return current;
22      }
23      
24      /***
25      * Adds a new element (template) to the end of the list.
26      * Returns the new element.
27      */
28      public FormulaTreeStructure addElement() {
29          FormulaTreeStructure denominator = (FormulaTreeStructure) getChild(1).getChild(0);
30          
31          if (denominator.isTemplate())
32              return denominator;
33          else
34              return this;
35      }
36  }