00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 package org.openmobileis.database.fastobjectdb.db.test;
00030
00031 import java.io.Serializable;
00032
00041 public class TestDataWithArray implements Serializable {
00042 private String id;
00043 private long idLong;
00044 private String[] stringList;
00045 private int indexStringList;
00046 private int[] intList;
00047 private int indexIntList;
00048 private long[] longList;
00049 private int indexLongList;
00053 public TestDataWithArray(String id,long idLong) {
00054 this.id=id;
00055 this.idLong=idLong;
00056 stringList=new String[10];
00057 intList=new int [2];
00058 longList=new long[4];
00059 indexStringList=0;
00060 indexIntList=0;
00061 indexLongList=0;
00062 }
00063
00064 public void addElement(String element){
00065 if(indexStringList<10){
00066 stringList[indexStringList]=element;
00067 indexStringList++;
00068 }
00069 }
00070
00071 public void addElement(int element){
00072 if(indexIntList<2){
00073 intList[indexIntList]=element;
00074 indexIntList++;
00075 }
00076 }
00077
00078 public void addElement(long element){
00079 if(indexLongList<4){
00080 longList[indexLongList]=element;
00081 indexLongList++;
00082 }
00083 }
00084
00085 public String[] getStringList(){
00086 return stringList;
00087 }
00088
00089 public int [] getIntList(){
00090 return intList;
00091 }
00092
00093 public long[] getLongList(){
00094 return longList;
00095 }
00096
00097 public String getId(){
00098 return id;
00099 }
00100
00101 public long getIdLong(){
00102 return idLong;
00103 }
00104
00105 public String toString(){
00106 String str="id:"+id+"\nStrings{";
00107 for(int i=0;i<indexStringList;i++)
00108 str+=" "+stringList[i];
00109 str+=" }\n";
00110 str+="int{";
00111 for(int i=0;i<indexIntList;i++)
00112 str+=" "+intList[i];
00113 str+=" }\n";
00114 str+="long{";
00115 for(int i=0;i<indexLongList;i++)
00116 str+=" "+longList[i];
00117 str+=" }";return str;
00118 }
00119
00120 }