Examples of MirroredObjectInstance


Examples of org.tod.meta.variables.MirroredObjectInstance

        VariablesWatcher vars = TODSessionFactory.getDefault().getVarialesWatcher();

        if(parent instanceof String) {
            String s = (String) parent;
            if(s.compareTo(this.TOD_ROOT)==0) {
                MirroredObjectInstance moi = vars.getThis();
                if (moi != null) {
                    return moi.getNumberOfFields() + 1;
                }
            }
        } else if (parent instanceof ThisObject) {
            ThisObject t = (ThisObject)parent;
            MirroredObjectInstance me = t.myThis;
            return me.getNumberOfFields();
        } else if (parent instanceof ChildNode) {
            ChildNode n = (ChildNode)parent;
            if (n.data.getValue() instanceof MirroredObjectInstance) {
                MirroredObjectInstance moi = (MirroredObjectInstance)n.data.getValue();
                return moi.getNumberOfFields();
            }
        } else if (parent instanceof ArrayElementNode) {
            ArrayElementNode array = (ArrayElementNode)parent;
            MirroredValue value = array.data;
            if (value instanceof MirroredObjectInstance) {
                MirroredObjectInstance moi = (MirroredObjectInstance)value;
                return moi.getNumberOfFields();
            }
        }
       
        return 0;
    }
View Full Code Here

Examples of org.tod.meta.variables.MirroredObjectInstance

        VariablesWatcher vars = TODSessionFactory.getDefault().getVarialesWatcher();

        if(o instanceof String) {
            String s = (String) o;
            if(s.compareTo(this.TOD_ROOT)==0) {
                MirroredObjectInstance moi = vars.getThis();
                if (moi != null) {
                    return TODDataStorage.FIELD_IMAGE;
                }
            }
        } else if (o instanceof ThisObject) {
            ThisObject t = (ThisObject)o;
            MirroredObjectInstance me = t.myThis;
            return TODDataStorage.FIELD_IMAGE;
        } else if (o instanceof ChildNode) {
            ChildNode n = (ChildNode)o;
            if (n.data.getValue() instanceof MirroredObjectInstance) {
                MirroredObjectInstance moi = (MirroredObjectInstance)n.data.getValue();
                return TODDataStorage.FIELD_IMAGE;
            }
        }
       
        return TODDataStorage.LOCAL_VARIABLE_IMAGE;
View Full Code Here

Examples of org.tod.meta.variables.MirroredObjectInstance

            return "";
        }
       
        if(node instanceof ThisObject) { //a parent
            ThisObject t = (ThisObject)node;
            MirroredObjectInstance me = t.myThis;
           
            if(columnID.compareTo(TYPE) == 0) {
                return TODCompilerUtils.friendlyTypeSignature(me.getTypeSignature());
            }
            if(columnID.compareTo(VALUE) == 0) {
                return me.toString();
            }
        }
        else if(node instanceof ChildNode) {
            ChildNode n = (ChildNode)node;
            Variable data = n.data;
View Full Code Here

Examples of org.tod.meta.variables.MirroredObjectInstance

        try {
            Class<? extends MirroredObjectInstance> inst = session.getTypeLookupManager().lookup(typeSig);
            if (inst != null) {
                Constructor<? extends MirroredObjectInstance> constructor = inst.getDeclaredConstructor(TODSession.class, ObjectId.class, String.class, long.class);
                if (constructor != null) {
                    MirroredObjectInstance newInstance =
                            constructor.newInstance(session, objectId, typeSig, validTimestamp);
                    if (newInstance != null) {
                        return newInstance;
                    }
                }
View Full Code Here

Examples of org.tod.meta.variables.MirroredObjectInstance

        VariablesWatcher vars = TODSessionFactory.getDefault().getVarialesWatcher();
        ArrayList<Object> kids = new ArrayList<Object>();
        if(parent instanceof String) {
            String s = (String) parent;
            if(s.compareTo(this.TOD_ROOT)==0) {
                MirroredObjectInstance moi = vars.getThis();
                if(moi != null) {
                    TODDataStorage.ThisObject th = new TODDataStorage.ThisObject();
                    th.myThis = moi;
                    kids.add(th);
                }
               
                // Add variables in scope.
                Iterator<Variable> locals = vars.getVariablesInScope();
                while (locals.hasNext()) {
                    Variable var = locals.next();
                    ChildNode n = new ChildNode();
                    n.data = var;
                    n.parent = moi;
                    kids.add(n);
                }
            }
        } else if (parent instanceof ThisObject) {
            ThisObject t = (ThisObject)parent;
            MirroredObjectInstance me = t.myThis;
            Iterator<FieldVariable> fields = me.getFields();
            while (fields.hasNext()) {
                ChildNode n = new ChildNode();
                n.data = fields.next();
                n.parent = me;
                kids.add(n);
            }
        } else if (parent instanceof ChildNode) {
            ChildNode t = (ChildNode)parent;
            if (t.data.getValue() instanceof MirroredObjectInstance) {
                MirroredObjectInstance o = (MirroredObjectInstance)t.data.getValue();
                if (o instanceof MirroredQuorumArray) {
                    MirroredQuorumArray array = (MirroredQuorumArray)o;
                    MirroredValue[] values = array.getArray();
                    for (int x = 0; x < values.length; x++) {
                        ArrayElementNode n = new ArrayElementNode();
                        n.index = x;
                        n.parent = array;
                        n.data = values[x];
                        kids.add(n);
                    }
                } else {
                    Iterator<FieldVariable> fields = o.getFields();
                    while (fields.hasNext()) {
                        ChildNode n = new ChildNode();
                        n.data = fields.next();
                        n.parent = o;
                        kids.add(n);
                    }
                }
            }
        } else if (parent instanceof ArrayElementNode) {
            ArrayElementNode t = (ArrayElementNode)parent;
            if (t.data instanceof MirroredObjectInstance) {
                MirroredObjectInstance o = (MirroredObjectInstance)t.data;
                if (o instanceof MirroredQuorumArray) {
                    MirroredQuorumArray array = (MirroredQuorumArray)o;
                    MirroredValue[] values = array.getArray();
                    for (int x = 0; x < values.length; x++) {
                        ArrayElementNode n = new ArrayElementNode();
                        n.index = x;
                        n.parent = array;
                        n.data = values[x];
                        kids.add(n);
                    }
                } else {
                    Iterator<FieldVariable> fields = o.getFields();
                    while (fields.hasNext()) {
                        ChildNode n = new ChildNode();
                        n.data = fields.next();
                        n.parent = o;
                        kids.add(n);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.