Package Hack.Gates

Examples of Hack.Gates.GateException


    }

    // checks the given index. If illegal throws GateException.
    private void checkIndex(int index) throws GateException {
        if (index != 0) {
            throw new GateException("Register has no index. Use Register[]");
        }
    }
View Full Code Here


    }

    // checks the given index. If illegal throws GateException.
    private void checkIndex(int index) throws GateException {
        if (index < 0 || index >= values.length) {
            throw new GateException("Illegal index");
        }
    }
View Full Code Here

        }
    }

    @Override
    public short getValueAt(int index) throws GateException {
        throw new GateException("ALU cannot be used as a variable");
    }
View Full Code Here

        throw new GateException("ALU cannot be used as a variable");
    }

    @Override
    public void setValueAt(int index, short value) throws GateException {
        throw new GateException("ALU cannot be used as a variable");
    }
View Full Code Here

    }

    // checks the given index. If illegal throws GateException.
    private void checkIndex(int index) throws GateException {
        if (index < 0 || index >= values.length) {
            throw new GateException("Illegal index");
        }
    }
View Full Code Here

     */
    @Override
    public void doCommand(String[] command) throws GateException {
        if (command[0].toUpperCase().equalsIgnoreCase("LOAD")) {
            if (command.length != 2) {
                throw new GateException("Illegal number of arguments");
            }

            if (gui != null) {
                gui.showMessage("Loading...");
            }

            String fileName = GatesManager.getInstance().getWorkingDir() + "/" + command[1];

            try {
                loadProgram(fileName);
            } catch (AssemblerException pe) {
                if (gui != null) {
                    gui.hideMessage();
                }
                throw new GateException(pe.getMessage());
            }

            if (gui != null) {
                gui.hideMessage();
            }
        } else {
            throw new GateException("This chip doesn't support this command");
        }
    }
View Full Code Here

    }

    // checks the given index. If illegal throws GateException.
    private void checkIndex(int index) throws GateException {
        if (index < 0 || index >= values.length) {
            throw new GateException("Illegal index");
        }
    }
View Full Code Here

    }

    // checks the given index. If illegal throws GateException.
    private void checkIndex(int index) throws GateException {
        if (index != 0) {
            throw new GateException("Keyboard has no index. Use ARegister[]");
        }
    }
View Full Code Here

        }
    }

    @Override
    public void setValueAt(int index, short value) throws GateException {
        throw new GateException("Keyboard is read only");
    }
View Full Code Here

    }

    // checks the given index. If illegal throws GateException.
    private void checkIndex(int index) throws GateException {
        if (index != 0) {
            throw new GateException("PC has no index. Use PC[]");
        }
    }
View Full Code Here

TOP

Related Classes of Hack.Gates.GateException

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.