KickJava   Java API By Example, From Geeks To Geeks.

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


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