Package org.quorum.execution

Examples of org.quorum.execution.RuntimeObject


                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


    public Object[] getChildren(Object parent, int from, int to) throws UnknownTypeException {
        ArrayList<Object> kids = new ArrayList<Object>();
        if(parent instanceof String) {
            String s = (String) parent;
            if(s.compareTo(QUORUM_ROOT)==0) {
                RuntimeObject ro = data.getThisObject();
                if(ro != null) {
                    ThisObject th = new ThisObject();
                    th.myThis = ro;
                    kids.add(th);
                }
               
                Iterator<DataObject> obs = data.getVariablesInActionScope();
                while(obs.hasNext()) {
                    kids.add(obs.next());
                }
            }
        }
        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;
                        kids.add(node);
                    }

                    Iterator<DataObject> obs = object.getLocalVariables();
                    while(obs.hasNext()) {
                        kids.add(obs.next());
                    }
                }
            }
        }
        else if(parent instanceof ArrayChild) {
            ArrayChild child = (ArrayChild) parent;
            RuntimeObject node = child.object;
            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);
View Full Code Here

            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;
                }
            }
        }
        else if(node instanceof ArrayChild) {
View Full Code Here

        }
        else if (node instanceof InheritanceNode){ //an object with parents
            return "inherited";
        }
        else if (node instanceof RuntimeObject){ //a parent of an object
            RuntimeObject ro = (RuntimeObject) node;
            return ro.getClazz().getStaticKey();
        }
        else if (node instanceof ThisObject){ //a parent of an object
            return "me";
        }
        else if (node instanceof ChildNode){ //a parent of an object
View Full Code Here

        }
        else if (node instanceof InheritanceNode){ //an object with parents
            return "";
        }
        else if(node instanceof RuntimeObject) { //a parent
            RuntimeObject ro = (RuntimeObject) node;
            if(columnID.compareTo(TYPE) == 0) {
                return ro.getClazz().getStaticKey();
            }
            if(columnID.compareTo(VALUE) == 0) {
                return "";
            }
        }
        else if(node instanceof ThisObject) { //a parent
            RuntimeObject ro = ((ThisObject) node).myThis;
            if(columnID.compareTo(TYPE) == 0) {
                return ro.getClazz().getStaticKey();
            }
            if(columnID.compareTo(VALUE) == 0) {
                return "#" + ro.getHashKey();
            }
        }
        else if(node instanceof ChildNode) {
            DataObject d = ((ChildNode) node).data;
            if(columnID.compareTo(TYPE) == 0) {
View Full Code Here

TOP

Related Classes of org.quorum.execution.RuntimeObject

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.