Changeset 80 for trunk/src/org/expeditee/simple
- Timestamp:
- 05/30/08 10:14:43 (16 years ago)
- Location:
- trunk/src/org/expeditee/simple
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/simple/Pointers.java
r4 r80 4 4 5 5 private static final String[] prefixes = new String[] { 6 SPointer.itemPrefix, SPointer.framePrefix, SPointer.filePrefix }; 6 SPointer.itemPrefix, SPointer.framePrefix, SPointer.filePrefix, 7 SPointer.associationPrefix }; 7 8 8 9 public static boolean isPointer(String varName) { … … 49 50 // if it is an existing variable change the value 50 51 v = getVariable(name); 51 } catch ( Exception e) {52 } catch (VariableNotFoundException e) { 52 53 // If the first variable doesnt exist then add it 53 54 list_.add(new SPointer<T>(name, value)); … … 57 58 v.setValue(value); 58 59 } 60 61 /** 62 * Deletes a variable if it exists. 63 * @param variableName name of the variable to delete 64 */ 65 public void delete(String variableName) { 66 try { 67 list_.remove(getVariable(variableName)); 68 } catch (VariableNotFoundException e) { 69 70 } 71 } 59 72 } -
trunk/src/org/expeditee/simple/Primitives.java
r21 r80 157 157 } 158 158 159 /** 160 * Increments a variable. 161 * @param var the name of the variable to increment 162 * @throws Exception 163 */ 159 164 public void add(String var) throws Exception { 160 165 setValue(var, new SReal(getVariable(var).doubleValue() + 1)); 161 166 } 162 167 168 /** 169 * Decrements a variable. 170 * @param var the name of the variable to decrement 171 * @throws Exception 172 */ 163 173 public void subtract(String var) throws Exception { 164 174 setValue(var, new SReal(getVariable(var).doubleValue() - 1)); -
trunk/src/org/expeditee/simple/SCharacter.java
r21 r80 18 18 @Override 19 19 public void parse(String s) { 20 if (s == "")20 if (s.equals("")) 21 21 value_ = '\0'; 22 22 else -
trunk/src/org/expeditee/simple/SInteger.java
r21 r80 26 26 @Override 27 27 public void parse(String s) throws Exception { 28 if (s == "")28 if (s.equals("")) 29 29 value_ = 0L; 30 30 else -
trunk/src/org/expeditee/simple/SPointer.java
r4 r80 10 10 11 11 public static final String filePrefix = SVariable.prefix + "f" 12 + SVariable.separator; 13 14 public static final String associationPrefix = SVariable.prefix + "ap" 12 15 + SVariable.separator; 13 16 -
trunk/src/org/expeditee/simple/SReal.java
r21 r80 22 22 @Override 23 23 public void parse(String s) throws Exception { 24 if (s == "")24 if (s.equals("")) 25 25 value_ = 0.0; 26 26 else -
trunk/src/org/expeditee/simple/SString.java
r4 r80 28 28 @Override 29 29 public Long integerValue() { 30 if (value_ == "")30 if (value_.equals("")) 31 31 return 0L; 32 32 return (long) Double.parseDouble(value_); … … 35 35 @Override 36 36 public Double doubleValue() { 37 if (value_ == "")37 if (value_.equals("")) 38 38 return 0.0; 39 39 return Double.parseDouble(value_); -
trunk/src/org/expeditee/simple/Variables.java
r4 r80 27 27 } 28 28 29 public T getVariable(String name) throws Exception {29 public T getVariable(String name) throws VariableNotFoundException { 30 30 for (T v : list_) { 31 31 if (v.getName().equalsIgnoreCase(name)) {
Note:
See TracChangeset
for help on using the changeset viewer.