1 package fr.ove.openmath.jome.model;
2
3 import java.util.*;
4 import fr.ove.openmath.jome.model.*;
5
6 /***
7 * This class represents the kind of child K-ary will have.
8 *
9 * @author © 1999 DIRAT Laurent
10 * @version 1.0 24/02/1999
11 */
12 public final class Slot extends FormulaTreeStructure {
13
14
15 FormulaTreeStructure nextSlot;
16
17 /***
18 * The Constructor.
19 *
20 */
21 public Slot() {
22 setResourceIdentifier("SLOT");
23 setAsOperatorPriority(resourcesManager.getAsOperatorPriority("slotPriorities"));
24 setAsOperandPriority(resourcesManager.getAsOperandPriority("slotPriorities"));
25 }
26
27 public FormulaTreeStructure getNextSlot() {
28 return nextSlot;
29 }
30
31 public void setNextSlot(FormulaTreeStructure nextSlot) {
32 this.nextSlot = nextSlot;
33 }
34
35
36
37
38
39
40
41
42
43
44
45
46
47 public FormulaTreeStructure goTo(int priority) {
48 return this;
49 }
50
51
52 /***
53 * Inserts the icon (node) in the formula tree structure.<BR>
54 * @param current the position in the formula tree where the operator is to be insert.
55 * @return the new current position int hte formula tree.
56 */
57 public FormulaTreeStructure insert(FormulaTreeStructure current) {
58
59 return null;
60 }
61
62 /***
63 * The Creation of the corresponding linear expression of the formula.
64 */
65 public String createLinear(String linear) {
66 return ((FormulaTreeStructure) getChild(0)).createLinear("");
67 }
68
69 /***
70 * Evaluates the instance.
71 */
72 public String evaluate() {
73 return ((FormulaTreeStructure) getChild(0)).evaluate();
74 }
75
76 /***
77 * To check is the instance is an operator.
78 * @return <CODE>true</CODE> if it is an operator. <CODE>false</CODE> otherwise.
79 */
80 public boolean isOperator() {
81 return false;
82 }
83
84
85
86
87 /***
88 * Returns the name of the icon associated to the instance.
89 *
90 * @returns The name of the icon, or <CODE>null</CODE> if there is no name
91 * associated.
92 */
93 public String getIconName() {
94 return ((FormulaTreeStructure) getChild(0)).getIconName();
95 }
96
97
98
99
100
101
102
103 /***
104 * Sets the value.
105 */
106 public void setValue(String value) {
107 }
108
109 /***
110 * Returns the value.
111 */
112 public String getValue() {
113 return null;
114 }
115
116
117
118 }