Package bm.vm

Examples of bm.vm.VirtualMachineException


                            break;
                    }
                }
                catch( Exception e )
                {
                    throw new VirtualMachineException( 0, e.getMessage() );
                }
            }
        }
        return null;
    }
View Full Code Here


                            );
                    }
                }
                catch( Exception e )
                {
                    throw new VirtualMachineException( 0, e.getMessage() );
                }
            }
        }
        return null;
    }
View Full Code Here

        {
            instance = vm.newInstance( "boolean" );
        }
        else
        {
            throw new VirtualMachineException(
                    0,
                    "Type not supported: " + o.getClass()
            );
        }
        instance.set( "value", o );
View Full Code Here

    {
        if( val1 instanceof FixedPoint )
        {
            if( val2.equals( FixedPoint.ZERO ) )
            {
                throw new VirtualMachineException( 0, "Division by zero" );
            }
            else
            {
                final Instance instance =
                        getVirtualMachine().newInstance( "double" );
                instance.set(
                        "value",
                        ((FixedPoint) val1).div( (FixedPoint) val2 )
                );
                return instance;
            }
        }
        else if( val1 instanceof Long )
        {
            if( ((Long) val2).longValue() == 0 )
            {
                throw new VirtualMachineException( 0, "Division by zero" );
            }
            else
            {
                final Instance instance =
                        getVirtualMachine().newInstance( "long" );
                instance.set(
                        "value",
                        new Long(
                                ((Long) val1).longValue() /
                                ( (Long) val2 ).longValue()
                        )
                );
                return instance;
            }
        }
        else if( val1 instanceof Integer )
        {
            if( ((Integer) val2).intValue() == 0 )
            {
                throw new VirtualMachineException( 0, "Division by zero" );
            }
            else
            {
                final Instance instance =
                        getVirtualMachine().newInstance( "int" );
                instance.set(
                        "value",
                        new Integer(
                                ((Integer) val1).intValue() /
                                ( (Integer) val2 ).intValue()
                        )
                );
                return instance;
            }
        }
        else if( val1 instanceof Short )
        {
            if( ((Short) val2).shortValue() == 0 )
            {
                throw new VirtualMachineException( 0, "Division by zero" );
            }
            else
            {
                final Instance instance =
                        getVirtualMachine().newInstance( "short" );
                instance.set(
                        "value",
                        new Short( (short)
                                (((Short) val1).shortValue() /
                                 ( (Short) val2 ).shortValue() )
                        )
                );
                return instance;
            }
        }
        else
        {
            if( ((Byte) val2).byteValue() == 0 )
            {
                throw new VirtualMachineException( 0, "Division by zero" );
            }
            else
            {
                final Instance instance =
                        getVirtualMachine().newInstance( "byte" );
View Full Code Here

            instance.set( name, value );
            return null;
        }
        else
        {
            throw new VirtualMachineException(
                    0,
                    "Variable or property does not exists: " + name
            );
        }
    }
View Full Code Here

TOP

Related Classes of bm.vm.VirtualMachineException

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.