1 package fr.ove.openmath.jome.model;
2
3 import java.util.*;
4 import fr.ove.openmath.jome.model.FormulaTreeStructure;
5 import fr.ove.openmath.jome.model.events.ModelEvent;
6
7 /***
8 * The operator "+", which is the unary plus.<BR>
9 *
10 * <CODE>UnaryPlus</CODE> represents a node in the formula tree.<BR>
11 * Its children are the operands of the operation.
12 *
13 * @author © 2000 DIRAT Laurent
14 * @version 2.1 10/01/2000
15 */
16 public class UnaryPlus extends UnaryOperator {
17 /***
18 * The Constructor.
19 */
20 public UnaryPlus() {
21 setResourceIdentifier("UNARYPLUS");
22 setValue("+");
23 setAsOperatorPriority(resourcesManager.getAsOperatorPriority("unaryPlusPriorities"));
24 setAsOperandPriority(resourcesManager.getAsOperandPriority("unaryPlusPriorities"));
25 }
26
27 /***
28 * Inserts the operator instance in the formula tree, from the current insertion position.
29 * (checks the priorities and goes up in the tree if necessary).
30 *
31 * @param ope the current insertion position.
32 * @return the new insertion position.
33 */
34 public FormulaTreeStructure insert(FormulaTreeStructure current) {
35
36
37
38
39 current.addChild(this);
40
41
42 VariableOrNumber template = new VariableOrNumber();
43 addChild(template);
44
45
46 return template;
47 }
48 }
49