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   * The substitution model of the symbol, with the same name, in the Mfd2 cd.
9   *
10  * @author © 1999 DIRAT Laurent
11  * @version 2.0 28/10/1999
12  */
13  public class Mfd2Substitution extends Function {
14      /*** 
15      * Inserts the instance in the formula tree structure.<BR>
16      * @param current the position in the formula tree where the operator is to be insert.
17      * @return the new current position int hte formula tree.
18      */
19      public FormulaTreeStructure insert(FormulaTreeStructure current) {
20          // Surchage le la mÈthode insert(..) car on ne veut pas qu'un template soit insÈrÈ,
21          // mais une instance de SubstitutionElement.
22          // C'est en qques sorte SubstitutionElement qui se charge de l'aspet 2n-aire de la chose.
23          
24          // Donc insertion classique...
25          current = super.insert(current);
26          // ...mais ? la place du template, on met un SubstitutionElement
27          return (new Mfd2SubstitutionElement()).insert(current);
28      }
29      
30      /***
31      * Adds a new SubstitutionElement to the end of the list.
32      * Returns the new element.
33      */
34      public FormulaTreeStructure addElement() {
35          // Pareil que pour insert, on veut un SubstitutionElement ? la place d'un template
36          FormulaTreeStructure current = super.addElement();
37          return (new Mfd2SubstitutionElement()).insert(current);
38      }
39  }