Package ca.teamdave.caruso

Examples of ca.teamdave.caruso.CarusoException


            metaFile.close();
            // erase the current data file
            PrintWriter dataFile = new PrintWriter(new FileWriter(fileName + ".dat"));
            dataFile.close();
        } catch (IOException ex) {
            throw new CarusoException("Error, could not initialize the specified files: " + this.fileName + ".dat, .lgdfs");
        }

    }
View Full Code Here


            dataFile.println();


            dataFile.close();
        } catch (IOException ex) {
            throw new CarusoException("Error, could not append file: " + this.fileName + ".dat");
        }

        frameNum++;
    }
View Full Code Here

    private Actuator source;

    public DoubleActuator(Actuator source) throws CarusoException {
        this.source = source;
        if (this.source.getValueType() != Double.class) {
            throw new CarusoException("Attempting to create a DoubleActuator from a non-double actuator");
        }
    }
View Full Code Here

     * @throws CarusoException
     */
    public final Object getValue() throws CarusoException {
        Object val = this.retriveValue();
        if (!this.type.isAssignableFrom(val.getClass())) {
            throw new CarusoException("Actuator Attempted to return type "
                    + val.getClass().toString()
                    + " instead of " + this.type.toString());
        }
        return val;
    }
View Full Code Here

     * @param val The value to assign and typecheck for the actuator
     * @throws CarusoException
     */
    public final void setValue(Object val) throws CarusoException {
        if (!this.type.isAssignableFrom(val.getClass())) {
            throw new CarusoException("Attempted to set actuator to type "
                    + val.getClass().toString()
                    + " instead of " + this.type.toString());
        }
        this.lastValue = val;
        this.assignValue(val);
View Full Code Here

    private Actuator source;

    public BooleanActuator(Actuator source) throws CarusoException {
        this.source = source;
        if (this.source.getValueType() != Boolean.class) {
            throw new CarusoException("Attempting to create a BooleanActuator from a non-boolean actuator");
        }
    }
View Full Code Here

    }

    public double getDouble(String name) throws CarusoException {
        ConfigItem item = (ConfigItem) this.config.get(name);
        if (!Double.class.isAssignableFrom(item.getType())) {
            throw new CarusoException("Attmepting to read non-double config value as a double");
        }
        return ((Double)item.getValue()).doubleValue();
    }
View Full Code Here

    }

    public int getInt(String name) throws CarusoException {
        ConfigItem item = (ConfigItem) this.config.get(name);
        if (!Integer.class.isAssignableFrom(item.getType())) {
            throw new CarusoException("Attmepting to read non-int config value as a int");
        }
        return ((Integer)item.getValue()).intValue();
    }
View Full Code Here

    public ConfigItem(Class type, Object value) throws CarusoException {
        this.type = type;
        this.value = value;
        if (!this.type.isAssignableFrom(this.value.getClass())) {
            throw new CarusoException("Attempting to create config value of type '" + this.type + "' to type '" + value.getClass());
        }
    }
View Full Code Here

        return this.value;
    }

    public void setValue(Object value) throws CarusoException {
        if (!this.type.isAssignableFrom(value.getClass())) {
            throw new CarusoException("Attempting to give set config type '" + this.type + "' to type '" + value.getClass());
        }
        this.value = value;
    }
View Full Code Here

TOP

Related Classes of ca.teamdave.caruso.CarusoException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.