KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4o > test > types > ArrayInObjectPrivate


1 /* Copyright (C) 2004 - 2006 db4objects Inc. http://www.db4o.com
2
3 This file is part of the db4o open source object database.
4
5 db4o is free software; you can redistribute it and/or modify it under
6 the terms of version 2 of the GNU General Public License as published
7 by the Free Software Foundation and as clarified by db4objects' GPL
8 interpretation policy, available at
9 http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10 Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11 Suite 350, San Mateo, CA 94403, USA.
12
13 db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

21 package com.db4o.test.types;
22
23 import java.util.*;
24
25 public class ArrayInObjectPrivate extends RTest
26 {
27     private Object JavaDoc oBoolean;
28     private Object JavaDoc nBoolean;
29     
30     private Object JavaDoc oByte;
31     private Object JavaDoc nByte;
32     
33     private Object JavaDoc oCharacter;
34     private Object JavaDoc nCharacter;
35
36     private Object JavaDoc oDouble;
37     private Object JavaDoc nDouble;
38     
39     private Object JavaDoc oFloat;
40     private Object JavaDoc nFloat;
41     
42     private Object JavaDoc oInteger;
43     private Object JavaDoc nInteger;
44     
45     private Object JavaDoc oLong;
46     private Object JavaDoc nLong;
47
48     private Object JavaDoc oShort;
49     private Object JavaDoc nShort;
50     
51     private Object JavaDoc oString;
52     private Object JavaDoc nString;
53     
54     private Object JavaDoc oDate;
55     private Object JavaDoc nDate;
56     
57     public void set(int ver){
58         if(ver == 1){
59             oBoolean = new Boolean JavaDoc[]{new Boolean JavaDoc(true), new Boolean JavaDoc(false), null };
60             nBoolean = null;
61         
62             oByte = new Byte JavaDoc[]{ new Byte JavaDoc(Byte.MAX_VALUE), new Byte JavaDoc(Byte.MIN_VALUE), new Byte JavaDoc((byte)0), null};
63             nByte = null;
64         
65             oCharacter = new Character JavaDoc[]{ new Character JavaDoc((char)(Character.MAX_VALUE - 1)), new Character JavaDoc((Character.MIN_VALUE)), new Character JavaDoc((char)(0)),null};
66             nCharacter = null;
67         
68             oDouble = new Double JavaDoc[]{new Double JavaDoc(Double.MAX_VALUE - 1), new Double JavaDoc(Double.MIN_VALUE), new Double JavaDoc(0), null };
69             nDouble = null;
70     
71             oFloat = new Float JavaDoc[] {new Float JavaDoc(Float.MAX_VALUE - 1), new Float JavaDoc(Float.MIN_VALUE), new Float JavaDoc(0), null};
72             nFloat = null;
73     
74             oInteger = new Integer JavaDoc[] {new Integer JavaDoc(Integer.MAX_VALUE - 1), new Integer JavaDoc(Integer.MIN_VALUE), new Integer JavaDoc(0), null};
75             nInteger = null;
76     
77             oLong = new Long JavaDoc[] { new Long JavaDoc(Long.MAX_VALUE - 1), new Long JavaDoc(Long.MIN_VALUE), new Long JavaDoc(0), null};
78             nLong = null;
79
80             oShort = new Short JavaDoc[] { new Short JavaDoc((short)(Short.MAX_VALUE - 1)), new Short JavaDoc((Short.MIN_VALUE)), new Short JavaDoc((short)(0)), null };
81             nShort = null;
82     
83             oString = new String JavaDoc[] {"db4o rules", "cool", "supergreat"};
84             nString = null;
85         
86             oDate = new Date[] {new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2001,11,31).getTime(), null};
87             nDate = null;
88         }else{
89             oBoolean = new Boolean JavaDoc[]{new Boolean JavaDoc(false), new Boolean JavaDoc(true), new Boolean JavaDoc(true)};
90             nBoolean = new Boolean JavaDoc[]{null, new Boolean JavaDoc(true), new Boolean JavaDoc(false)};
91     
92             oByte = new Byte JavaDoc[]{ new Byte JavaDoc(Byte.MIN_VALUE), new Byte JavaDoc(Byte.MAX_VALUE), new Byte JavaDoc((byte)1), new Byte JavaDoc((byte)-1)};
93             nByte = new Byte JavaDoc[]{ null, new Byte JavaDoc(Byte.MAX_VALUE), new Byte JavaDoc(Byte.MIN_VALUE), new Byte JavaDoc((byte)0)};
94         
95             oCharacter = new Character JavaDoc[]{ new Character JavaDoc(Character.MIN_VALUE), new Character JavaDoc((char)(Character.MAX_VALUE - 1)), new Character JavaDoc((char)(0)),new Character JavaDoc((char)(Character.MAX_VALUE - 1)),new Character JavaDoc((char)1)};
96             nCharacter = new Character JavaDoc[]{ null, new Character JavaDoc((char)(Character.MAX_VALUE - 1)), new Character JavaDoc((Character.MIN_VALUE)), new Character JavaDoc((char)(0))};
97
98             oDouble = new Double JavaDoc[]{new Double JavaDoc(Double.MIN_VALUE), new Double JavaDoc(0)};
99             nDouble = new Double JavaDoc[]{null, new Double JavaDoc(Double.MAX_VALUE - 1), new Double JavaDoc(Double.MIN_VALUE), new Double JavaDoc( - 123.12344), new Double JavaDoc( - 12345.123445566)};
100     
101             oFloat = new Float JavaDoc[] {new Float JavaDoc((float)- 98.765)};
102             nFloat = null;
103     
104             oInteger = new Integer JavaDoc[] {new Integer JavaDoc(Integer.MAX_VALUE - 1), new Integer JavaDoc(Integer.MIN_VALUE), new Integer JavaDoc(111), new Integer JavaDoc(-333)};
105             nInteger = new Integer JavaDoc[] {null, new Integer JavaDoc(Integer.MAX_VALUE - 1), new Integer JavaDoc(Integer.MIN_VALUE), new Integer JavaDoc(0)};
106     
107             oLong = new Long JavaDoc[] { new Long JavaDoc(Long.MAX_VALUE - 1), new Long JavaDoc(Long.MIN_VALUE), new Long JavaDoc(1)};
108             nLong = new Long JavaDoc[] { null, new Long JavaDoc(Long.MAX_VALUE - 1), new Long JavaDoc(Long.MIN_VALUE), new Long JavaDoc(0)};
109
110             oShort = new Short JavaDoc[] { new Short JavaDoc((Short.MIN_VALUE)), new Short JavaDoc((short)(Short.MAX_VALUE - 1)), new Short JavaDoc((short)(0))};
111             nShort = new Short JavaDoc[] { new Short JavaDoc((short)(Short.MAX_VALUE - 1)), null, new Short JavaDoc((Short.MIN_VALUE)), new Short JavaDoc((short)(0))};
112     
113             oString = new String JavaDoc[] {"db4o rulez", "cool", "supergreat"};
114             nString = new String JavaDoc[] {null, "db4o rules", "cool", "supergreat", null};
115         
116             oDate = new Date[] {new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(1999,0,1).getTime(), new GregorianCalendar(2001,11,31).getTime()};
117             nDate = new Date[] {null, new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2001,11,31).getTime(), null};
118         }
119     }
120     
121     public boolean jdk2(){
122         return true;
123     }
124 }
125
Popular Tags