Changeset 21 for trunk/src/org/expeditee/simple
- Timestamp:
- 05/08/08 14:30:09 (16 years ago)
- Location:
- trunk/src/org/expeditee/simple
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/simple/Context.java
r7 r21 225 225 226 226 public void createFrameset(String framesetNameVar, String successVar) 227 throws Exception { 228 // Get the values to be set 229 String framesetName = primitives_.getStringValue(framesetNameVar); 230 Frame firstFrame = FrameIO.CreateNewFrameset(framesetName); 231 232 if (successVar != null) { 233 Boolean success = firstFrame != null; 227 throws IncorrectTypeException { 228 boolean success = true; 229 try { 230 // Get the values to be set 231 String framesetName = primitives_.getStringValue(framesetNameVar); 232 Frame firstFrame = FrameIO.CreateNewFrameset(framesetName); 233 success = firstFrame != null; 234 } catch (Exception e) { 235 success = false; 236 } 237 if (successVar != null) { 234 238 primitives_.setValue(successVar, new SBoolean(success)); 235 239 } -
trunk/src/org/expeditee/simple/IncorrectTypeException.java
r4 r21 3 3 public class IncorrectTypeException extends RuntimeException { 4 4 static final long serialVersionUID = -7034897190745766939L; 5 5 6 6 public IncorrectTypeException(String type, int no) { 7 7 super("Expected param " + no + " to be " + type); -
trunk/src/org/expeditee/simple/Primitives.java
r4 r21 24 24 25 25 public void setValue(String variableName, SPrimitive newValue) 26 throws Exception {26 throws IncorrectTypeException { 27 27 try { 28 28 // if it is an existing variable change the value … … 49 49 * if the variable name is invalid 50 50 */ 51 public void add(String name, SPrimitive value) throws Exception {51 public void add(String name, SPrimitive value) throws IncorrectTypeException { 52 52 // figure out the type and add it... 53 53 SPrimitive newVar; -
trunk/src/org/expeditee/simple/SBoolean.java
r4 r21 12 12 } 13 13 14 public SBoolean(Boolean value) throws Exception {14 public SBoolean(Boolean value) throws IncorrectTypeException { 15 15 super(value); 16 16 } … … 44 44 45 45 @Override 46 public void setValue(SPrimitive v) throws Exception {46 public void setValue(SPrimitive v) throws IncorrectTypeException { 47 47 value_ = v.booleanValue(); 48 48 } -
trunk/src/org/expeditee/simple/SCharacter.java
r4 r21 50 50 51 51 @Override 52 public void setValue(SPrimitive v) throws Exception {52 public void setValue(SPrimitive v) throws IncorrectTypeException { 53 53 value_ = v.characterValue(); 54 54 } -
trunk/src/org/expeditee/simple/SInteger.java
r4 r21 53 53 54 54 @Override 55 public void setValue(SPrimitive v) throws Exception {55 public void setValue(SPrimitive v) throws IncorrectTypeException { 56 56 value_ = v.integerValue(); 57 57 } -
trunk/src/org/expeditee/simple/SPrimitive.java
r4 r21 15 15 } 16 16 17 public Long integerValue() throws Exception { 18 throw new Exception("Can not convert " + this.getClass().getName() 19 + " to Integer"); 17 public Long integerValue() throws IncorrectTypeException { 18 throw new IncorrectTypeException("integer",this.getClass().getName()); 20 19 } 21 20 22 public Boolean booleanValue() throws Exception { 23 throw new Exception("Can not convert " + this.getClass().getName() 24 + " to Boolean"); 21 public Boolean booleanValue() throws IncorrectTypeException { 22 throw new IncorrectTypeException("boolean", this.getClass().getName()); 25 23 } 26 24 27 public Double doubleValue() throws Exception { 28 throw new Exception("Can not convert " + this.getClass().getName() 29 + " to Real"); 25 public Double doubleValue() throws IncorrectTypeException { 26 throw new IncorrectTypeException("real", this.getClass().getName()); 30 27 } 31 28 32 public Character characterValue() throws Exception { 33 throw new Exception("Can not convert " + this.getClass().getName() 34 + " to Character"); 29 public Character characterValue() throws IncorrectTypeException { 30 throw new IncorrectTypeException("character", this.getClass().getName()); 35 31 } 36 32 37 public abstract void setValue(SPrimitive v) throws Exception;33 public abstract void setValue(SPrimitive v) throws IncorrectTypeException; 38 34 39 35 @Override 40 public void setValue(SVariable<T> v) throws Exception {36 public void setValue(SVariable<T> v) throws IncorrectTypeException { 41 37 if (v instanceof SPrimitive) { 42 38 setValue((SPrimitive<?>) v); 43 39 return; 44 40 } 45 throw new Exception("Can not set primitive variable withpointer");41 throw new IncorrectTypeException("primitive", "pointer"); 46 42 } 47 43 -
trunk/src/org/expeditee/simple/SReal.java
r4 r21 49 49 50 50 @Override 51 public void setValue(SPrimitive v) throws Exception {51 public void setValue(SPrimitive v) throws IncorrectTypeException { 52 52 value_ = v.doubleValue(); 53 53 }
Note:
See TracChangeset
for help on using the changeset viewer.