Package com.intersys.globals

Examples of com.intersys.globals.ValueList


        }
    }

    private void writeDocument(NoSchemaDocument doc, ValueList valueList, ValueList scratch, boolean isReference) {
        if (isReference) {
            ValueList tList = connection.createList();
            tList.append(doc.getName());
            tList.append(doc.getDBID());
            valueList.append(tList);
            return;
        }
        scratch.clear();
        write(doc,scratch);
View Full Code Here


            Class type = blueprint.get(key).getClass();
            if (Util.isDatatype(type)) {
                document.put(key,valueList.getNextObject());
            } else if (type.isArray()) {
                // DocumentType.TYPE_EMBEDDED_ARRAY
                ValueList tempList = valueList.getNextList();
                if ((tempList == null) || (tempList.length() == 0)) {
                    document.put(key,null);
                    continue;
                }
                NoSchemaDocument[] references = new NoSchemaDocument[tempList.length()];
                for (int j=0;j<tempList.length();j++) {
                    references[j] = new NoSchemaDocument();
                    ValueList tList = tempList.getNextList();
                    read(references[j],tList,((NoSchemaDocument[])blueprint.get(key))[0]);
                }
                document.put(key,references);
            //} TODO else if (type == DocumentType.TYPE_REFERENCE_ARRAY) {
            // embedded or reference
            } else {
                Object nestedDoc = blueprint.get(key);
                // embedded
                if (nestedDoc instanceof NoSchemaDocument) {
                    ValueList vList = valueList.getNextList();
                    NoSchemaDocument nDocument = new NoSchemaDocument();
                    for (int j=0;j<vList.length()/2;j++) {
                        String nKey = vList.getNextString();
                        // TODO more nesting?
                        String nValue = vList.getNextString();

                        NodeReference tempGlobal = connection.createNodeReference(nKey);
                        if (tempGlobal.exists(nValue)) {
                            // this is a reference
                            read(nDocument,tempGlobal.getList(nValue),(NoSchemaDocument)blueprint.get(key));
View Full Code Here

            }
            // multiple index values
            if (uniqueIndex) { //(indexGlobal.hasSubnodes(candidate)) {
                candidates.add(indexGlobal.getString(candidate));
            } else {
                ValueList indexList = indexGlobal.getList(candidate);
                for (int i=0;i<indexList.length();i++) {
                    candidates.add(indexList.getNextString());
                }
            }
        }
        candidateIt = candidates.iterator();
    }
View Full Code Here

        }
        document.put(key,array);
    }

    private void readDoubleArray(Document document, String key) {
        ValueList tempList = valueList.getNextList();
        if (tempList == null) {
            document.put(key,null);
            return;
        }
        int len = tempList.length();
        double[] 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 readDoubleWrapperArray(Document document, String key) {
        ValueList tempList = valueList.getNextList();
        if (tempList == null) {
            document.put(key,null);
            return;
        }
        int len = tempList.length();
        Double[] 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 readLongArray(Document document, String key) {
        ValueList tempList = valueList.getNextList();
        if (tempList == null) {
            document.put(key,null);
            return;
        }
        int len = tempList.length();
        long[] array = new long[len];
        for (int i=0;i<len;i++) {
            array[i] = tempList.getNextLong();
        }
        document.put(key,array);
    }
View Full Code Here

        }
        document.put(key,array);
    }

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

            }

            if (uniqueIndex) {
                candidates.add(indexGlobal.getString(candidate));
            } else {
                ValueList indexList = indexGlobal.getList(candidate);
                for (int i=0;i<indexList.length();i++) {
                    candidates.add(indexList.getNextString());
                }
            }
        }
    }
View Full Code Here

            if (val instanceof NoSchemaDocument) {
                NoSchemaDocument doc = (NoSchemaDocument) val;
                writeDocument(doc,valueList,scratchList,(doc.getDBID() != null));
            } else if (val instanceof NoSchemaDocument[]) {
                scratchList.clear();
                ValueList tempList = connection.createList();
                for (int j=0;j<((NoSchemaDocument[])val).length;j++) {
                    NoSchemaDocument doc = ((NoSchemaDocument[])val)[j];
                    writeDocument(doc,scratchList,tempList,(document.getDBID() != null));
                }
                valueList.append(scratchList);
View Full Code Here

    * @param documentType DocumentType to be saved
    *
    */
    public void saveDocumentType(DocumentType documentType) {
        NodeReference global = createNodeReference("Schema");
        ValueList list = createList();
        documentType.store(this,list);
        global.set(list,documentType.name);

        list.clear();
        global = createNodeReference("Indices");
        global.appendSubscript(documentType.name);
        documentType.storeIndices(global,list);
    }
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.