main/java/com/example/rot/uitotem/StoreAPI.java
private void saveClassStruct(String className,ClassStruct classStruct){
        Log.d("Hello", "saveClassStruct: ");
        /*className--selectClassName--tupleNum--children--Attr */
        int n;
        ArrayList<String> data = new ArrayList<>();

        data.add(className);
        if(classStruct.selectClassName==null)classStruct.selectClassName="";
        data.add(classStruct.selectClassName);
        data.add(Integer.toString(classStruct.tupleNum));

        if(classStruct.children!=null){
            n = classStruct.children.size();
        }else{
            n = 0;
        }
        data.add(Integer.toString(n));
        for(int i=0;i<n;i++){
            data.add(classStruct.children.get(i));
        }

        if(classStruct.attrList != null){
            n = classStruct.attrList.size();
        }else{
            n = 0;
        }
        data.add(Integer.toString(n));
        for(int i=0;i<n;i++){
            data.add(classStruct.attrList.get(i).attrName);
            data.add(Integer.toString(classStruct.attrList.get(i).attrType));
            data.add(Integer.toString(classStruct.attrList.get(i).attrSize));
            data.add(classStruct.attrList.get(i).defaultVal);
        }
        data.add(classStruct.condition);
        n = 0;
        if(classStruct.virtualAttr!=null)n=classStruct.virtualAttr.size();
        data.add(Integer.toString(n));
        for(int i=0;i<n;i++){
            data.add(classStruct.virtualAttr.get(i).attrName);
            data.add(classStruct.virtualAttr.get(i).attrRename);
        }
        String code = encode(data);
        /*coding over*/
        //save code
        classStructEditor.putString(className,code);
        classStructEditor.commit();
    }
/*--------------------Create & Drop & Parse Class-----------------------*/
Create & Drop & Parse Class
Create & Drop & Parse Class
private void saveClassStruct(String className,ClassStruct classStruct){
        Log.d("Hello", "saveClassStruct: ");
        /*className--selectClassName--tupleNum--children--Attr */
        int n;
        ArrayList<String> data = new ArrayList<>();
        data.add(className);
        if(classStruct.selectClassName==null)classStruct.selectClassName="";
        data.add(classStruct.selectClassName);
        data.add(Integer.toString(classStruct.tupleNum));
        if(classStruct.children!=null){
            n = classStruct.children.size();
        }else{
            n = 0;
        }
        data.add(Integer.toString(n));
        for(int i=0;i<n;i++){
            data.add(classStruct.children.get(i));
        }
        if(classStruct.attrList != null){
            n = classStruct.attrList.size();
        }else{
            n = 0;
        }
        data.add(Integer.toString(n));
        for(int i=0;i<n;i++){
            data.add(classStruct.attrList.get(i).attrName);
            data.add(Integer.toString(classStruct.attrList.get(i).attrType));
            data.add(Integer.toString(classStruct.attrList.get(i).attrSize));
            data.add(classStruct.attrList.get(i).defaultVal);
        }
        data.add(classStruct.condition);
        n = 0;
        if(classStruct.virtualAttr!=null)n=classStruct.virtualAttr.size();
        data.add(Integer.toString(n));
        for(int i=0;i<n;i++){
            data.add(classStruct.virtualAttr.get(i).attrName);
            data.add(classStruct.virtualAttr.get(i).attrRename);
        }
        String code = encode(data);
        /*coding over*/
        classStructEditor.putString(className,code);
        classStructEditor.commit();
    }
private void saveClassStruct ( String className , ClassStruct classStruct ) { Log . d ( "Hello" , "saveClassStruct: " ) ; /*className--selectClassName--tupleNum--children--Attr */ int n ; ArrayList < String > data = new ArrayList < > ( ) ; data . add ( className ) ; if ( classStruct . selectClassName == null ) classStruct . selectClassName = "" ; data . add ( classStruct . selectClassName ) ; data . add ( Integer . toString ( classStruct . tupleNum ) ) ; if ( classStruct . children != null ) { n = classStruct . children . size ( ) ; } else { n = 0 ; } data . add ( Integer . toString ( n ) ) ; for ( int i = 0 ; i < n ; i ++ ) { data . add ( classStruct . children . get ( i ) ) ; } if ( classStruct . attrList != null ) { n = classStruct . attrList . size ( ) ; } else { n = 0 ; } data . add ( Integer . toString ( n ) ) ; for ( int i = 0 ; i < n ; i ++ ) { data . add ( classStruct . attrList . get ( i ) . attrName ) ; data . add ( Integer . toString ( classStruct . attrList . get ( i ) . attrType ) ) ; data . add ( Integer . toString ( classStruct . attrList . get ( i ) . attrSize ) ) ; data . add ( classStruct . attrList . get ( i ) . defaultVal ) ; } data . add ( classStruct . condition ) ; n = 0 ; if ( classStruct . virtualAttr != null ) n = classStruct . virtualAttr . size ( ) ; data . add ( Integer . toString ( n ) ) ; for ( int i = 0 ; i < n ; i ++ ) { data . add ( classStruct . virtualAttr . get ( i ) . attrName ) ; data . add ( classStruct . virtualAttr . get ( i ) . attrRename ) ; } String code = encode ( data ) ; /*coding over*/ classStructEditor . putString ( className , code ) ; classStructEditor . commit ( ) ; }
Create & Drop & Parse Class
Create & Drop & Parse Class
//save code