Package org.quorum.execution

Examples of org.quorum.execution.ExpressionValue


        if(array != null) { //something is very wrong, since the object clearly exists
            for(int i = 0; i < array.getSize(); i++) {
                ArrayChild child = new ArrayChild();
                child.index = i;
                ExpressionValue value = array.get(i);
                if(value != null && !value.isNull()) {
                    int hash = value.getObjectHash();
                    RuntimeObject arrayChild = data.getObject(hash);
                    child.object = arrayChild;
                }
                kids.add(child);
            }
View Full Code Here


        }
        else if(parent instanceof DataObject) {
            DataObject d = (DataObject) parent;
            String name = d.getName();

            ExpressionValue value = d.getCurrentValue();
            if(value == null){
                value = data.getLocalScope().getVariable(name);
            }
            if(value != null && value.getType() != null && !value.getType().isPrimitiveType()) {
                if(!value.isNull()) { //it's a legal object
                    //request the object of that hash number from the
                    //data environment
                    int hash = value.getObjectHash();
                    RuntimeObject object = data.getObject(hash);

                    if(object != null && object.hasParents()) {
                        InheritanceNode node = new InheritanceNode();
                        node.child = object;
                        kids.add(node);
                    }

                    if(object != null) {
                        Iterator<DataObject> obs = object.getLocalVariables();
                        while(obs.hasNext()) {
                            kids.add(obs.next());
                        }

                        addArrayChildren(kids, object);
                    }
                }
            }


        }
        else if (parent instanceof InheritanceNode){ //an object with parents
            InheritanceNode node = (InheritanceNode) parent;
            RuntimeObject child = node.child;
            Iterator<RuntimeObject> ros = child.getParents();
            while(ros.hasNext()) {
                kids.add(ros.next());
            }
        }
        else if (parent instanceof RuntimeObject){ //a parent of an object
            RuntimeObject node = (RuntimeObject) parent;
            if(node.hasLocalVariables()) {//if it has variables, display them
                Iterator<DataObject> vars = node.getLocalVariables();
                while(vars.hasNext()) {
                    ChildNode cn = new ChildNode();
                    cn.scope = node;
                    cn.data = vars.next();
                    kids.add(cn);
                }
            }
        }
        else if (parent instanceof ThisObject){ //a parent of an object
            ThisObject th = (ThisObject)parent;
            RuntimeObject node = th.myThis;
            if(node.hasLocalVariables()) {//if it has variables, display them
                Iterator<DataObject> vars = node.getLocalVariables();
                while(vars.hasNext()) {
                    ChildNode cn = new ChildNode();
                    cn.scope = node;
                    cn.data = vars.next();
                    kids.add(cn);
                }
            }
        }
        else if (parent instanceof ChildNode){ //a parent of an object
            ChildNode n = (ChildNode) parent;
            DataObject d = n.data;
            String name = d.getName();

            ExpressionValue value = n.scope.getVariable(name);
            if(value != null && value.getType() != null && !value.getType().isPrimitiveType()) {
                if(!value.isNull()) { //it's a legal object
                    //request the object of that hash number from the
                    //data environment
                    int hash = value.getObjectHash();
                    RuntimeObject object = data.getObject(hash);

                    if(object.hasParents()) {
                        InheritanceNode node = new InheritanceNode();
                        node.child = object;
View Full Code Here

        }
        else if(node instanceof DataObject) {
            DataObject d = (DataObject) node;
            String name = d.getName();

            ExpressionValue value = data.getLocalScope().getVariable(name);
            if(value != null && value.getType() != null && !value.getType().isPrimitiveType()) {
                if(!value.isNull()) { //it's a legal object
                    //request the object of that hash number from the
                    //data environment
                    int hash = value.getObjectHash();
                    RuntimeObject object = data.getObject(hash);
                    int vars = object.getNumberLocalVariables() + object.getNumberParents();
                    return vars;
                }
            }
        }
        else if (node instanceof InheritanceNode){ //an object with parents
            InheritanceNode n = (InheritanceNode) node;
            return n.child.getNumberParents();
        }
        else if (node instanceof RuntimeObject){ //a parent of an object
            return ((RuntimeObject)node).getNumberLocalVariables(); //don't add parents, as they are flattened in the child, not stored here
        }
        else if (node instanceof ThisObject){ //a parent of an object
            return ((ThisObject)node).myThis.getNumberLocalVariables(); //don't add parents, as they are flattened in the child, not stored here
        }
        else if (node instanceof ChildNode){ //a parent of an object
            ChildNode n = (ChildNode) node;
            DataObject d = n.data;
            String name = d.getName();

            ExpressionValue value = n.scope.getVariable(name);
            if(value != null && value.getType() != null && !value.getType().isPrimitiveType()) {
                if(!value.isNull()) { //it's a legal object
                    //request the object of that hash number from the
                    //data environment
                    int hash = value.getObjectHash();
                    RuntimeObject object = data.getObject(hash);
                    int vars = object.getNumberLocalVariables() + object.getNumberParents();
                    return vars;
                }
            }
View Full Code Here

TOP

Related Classes of org.quorum.execution.ExpressionValue

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.