Package com.intersys.globals

Examples of com.intersys.globals.ValueList


            } else if (type == ElementType.TYPE_DOUBLE_WRAPPER) {
                document.put(key,valueList.getNextDouble());
            } else if (type == ElementType.TYPE_LONG_WRAPPER) {
                document.put(key,valueList.getNextLong());
            } else if (type == ElementType.TYPE_EMBEDDED) {
                ValueList tempList = valueList.getNextList();
                Document nestedDoc = new Document();
                read(nestedDoc,tempList,eType.nestedType);
                document.put(key,nestedDoc);
            } else if (type == ElementType.TYPE_EMBEDDED_ARRAY) {
            //} TODO else if (type == DocumentType.TYPE_REFERENCE_ARRAY) {
                ValueList tempList = valueList.getNextList();
                if (tempList == null) {
                    document.put(key,null);
                    continue;
                }
                int listLen = tempList.length();
                Document[] references = new Document[listLen];
                for (int j=0;j<listLen;j++) {
                    references[j] = new Document();
                    ValueList tList = tempList.getNextList();
                    read(references[j],tList,eType.nestedType);
                }
                document.put(key,references);
            } else if (type == ElementType.TYPE_REFERENCE) {
                String address = valueList.getNextString();
View Full Code Here


        }
        valueList.append(writeList);
    }

    private void readDatatypeArray(int type, Document document, String key) {
        ValueList tempList = valueList.getNextList();
        if (tempList == null) {
            document.put(key,null);
            return;
        }
        int len = tempList.length();
        Object[] array =  null;
        if (type == ElementType.TYPE_STRING_ARRAY) {
            array = new String[len];
            for (int i=0;i<len;i++) {
                array[i] = tempList.getNextString();
            }
        } else if (type == ElementType.TYPE_INTEGER_ARRAY) {
            array = new Integer[len];
            for (int i=0;i<len;i++) {
                array[i] = tempList.getNextInt();
            }
        } else if (type == ElementType.TYPE_LONG_ARRAY) {
            array = new Long[len];
            for (int i=0;i<len;i++) {
                array[i] = tempList.getNextLong();
            }
        } else if (type == ElementType.TYPE_DOUBLE_ARRAY) {
            array = new Double[len];
            for (int i=0;i<len;i++) {
                array[i] = tempList.getNextDouble();
            }
        }
        document.put(key,array);
    }
View Full Code Here

        }
        document.put(key,array);
    }

    private void readStringArray(Document document, String key) {
        ValueList tempList = valueList.getNextList();
        if (tempList == null) {
            document.put(key,null);
            return;
        }
        int len = tempList.length();
        String[] array = new String[len];
        for (int i=0;i<len;i++) {
            array[i] = tempList.getNextString();
        }
        document.put(key,array);
    }
View Full Code Here

        }
        document.put(key,array);
    }

    private void readIntArray(Document document, String key) {
        ValueList tempList = valueList.getNextList();
        if (tempList == null) {
            document.put(key,null);
            return;
        }
        int len = tempList.length();
        int[] array = new int[len];
        for (int i=0;i<len;i++) {
            array[i] = tempList.getNextInt();
        }
        document.put(key,array);
    }
View Full Code Here

        }
        document.put(key,array);
    }

    private void readIntegerWrapperArray(Document document, String key) {
        ValueList tempList = valueList.getNextList();
        if (tempList == null) {
            document.put(key,null);
            return;
        }
        int len = tempList.length();
        Integer[] array = new Integer[len];
        for (int i=0;i<len;i++) {
            array[i] = tempList.getNextInt();
        }
        document.put(key,array);
    }
View Full Code Here

        }
    }

    void store(Connection connection, ValueList list) {
        list.append(types.size());
        ValueList nestedList = connection.createList();
        for (String eName : types.keySet()) {
            ElementType type = types.get(eName);
            list.append(eName);
            list.append(type.type);
            DocumentType nested = type.nestedType;
            if (nested != null) {
                nestedList.clear();
                nested.store(connection,nestedList);
                list.append(nestedList);
            }
            String ref = type.reference;
            if (ref != null) {
View Full Code Here

            int eType = list.getNextInt();
            ElementType type = new ElementType(eName,eType);
            if ((eType == ElementType.TYPE_EMBEDDED) ||
               (eType == ElementType.TYPE_EMBEDDED_ARRAY)) {
                DocumentType dt = new DocumentType(null);
                ValueList ml = list.getNextList();
                dt.load(connection,ml);
                type.nestedType = dt;
            } else if ((eType == ElementType.TYPE_REFERENCE) ||
                       (eType == ElementType.TYPE_REFERENCE_ARRAY)) {
                type.reference = list.getNextString();
                type.referenceKey = list.getNextString();
                DocumentType dt = new DocumentType(type.reference);
                NodeReference schemaGlobal = connection.createNodeReference("Schema");

                ValueList ml = schemaGlobal.getList(type.reference);
                dt.load(connection,ml);
                type.nestedType = dt;
            // TODO
            } else if (eType == ElementType.TYPE_BACK_REFERENCE) {
                String refName = list.getNextString();
View Full Code Here

        if (!indexGlobal.exists()) {
            return;
        }
        indices = new ArrayList<String>();
        isUniqueIndex = new HashMap<String,Boolean>();
        ValueList list = indexGlobal.getList();
        for (int i=0;i<list.length()/2;i++) {
            String iName = list.getNextString();
            indices.add(iName);
            if (list.getNextInt() == 1) {
                isUniqueIndex.put(iName,Boolean.TRUE);
            } else {
                isUniqueIndex.put(iName,Boolean.FALSE);
            }
        }
View Full Code Here

TOP

Related Classes of com.intersys.globals.ValueList

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.