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 static final long serialVersionUID = 5521257935120563452L;
00043 private String id;
00044 private long idLong;
00045 private String[] stringList;
00046 private int indexStringList;
00047 private int[] intList;
00048 private int indexIntList;
00049 private long[] longList;
00050 private int indexLongList;
00054 public TestDataWithArray(String id,long idLong) {
00055 this.id=id;
00056 this.idLong=idLong;
00057 stringList=new String[10];
00058 intList=new int [2];
00059 longList=new long[4];
00060 indexStringList=0;
00061 indexIntList=0;
00062 indexLongList=0;
00063 }
00064
00065 public void addElement(String element){
00066 if(indexStringList<10){
00067 stringList[indexStringList]=element;
00068 indexStringList++;
00069 }
00070 }
00071
00072 public void addElement(int element){
00073 if(indexIntList<2){
00074 intList[indexIntList]=element;
00075 indexIntList++;
00076 }
00077 }
00078
00079 public void addElement(long element){
00080 if(indexLongList<4){
00081 longList[indexLongList]=element;
00082 indexLongList++;
00083 }
00084 }
00085
00086 public String[] getStringList(){
00087 return stringList;
00088 }
00089
00090 public int [] getIntList(){
00091 return intList;
00092 }
00093
00094 public long[] getLongList(){
00095 return longList;
00096 }
00097
00098 public String getId(){
00099 return id;
00100 }
00101
00102 public long getIdLong(){
00103 return idLong;
00104 }
00105
00106 public String toString(){
00107 String str="id:"+id+"\nStrings{";
00108 for(int i=0;i<indexStringList;i++)
00109 str+=" "+stringList[i];
00110 str+=" }\n";
00111 str+="int{";
00112 for(int i=0;i<indexIntList;i++)
00113 str+=" "+intList[i];
00114 str+=" }\n";
00115 str+="long{";
00116 for(int i=0;i<indexLongList;i++)
00117 str+=" "+longList[i];
00118 str+=" }";return str;
00119 }
00120
00121 }