KickJava   Java API By Example, From Geeks To Geeks.

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


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 ArrayTypedPrivate extends RTest
26 {
27     private Boolean JavaDoc[] oBoolean;
28     private Boolean JavaDoc[] nBoolean;
29     private boolean[] sBoolean;
30     
31     /*
32     private Byte[] oByte;
33     private Byte[] nByte;
34     private byte[] sByte;
35     */

36     
37     private Character JavaDoc[] oCharacter;
38     private Character JavaDoc[] nCharacter;
39     private char[] sChar;
40
41     private Double JavaDoc[] oDouble;
42     private Double JavaDoc[] nDouble;
43     private double[] sDouble;
44     
45     private Float JavaDoc[] oFloat;
46     private Float JavaDoc[] nFloat;
47     private float[] sFloat;
48     
49     private Integer JavaDoc[] oInteger;
50     private Integer JavaDoc[] nInteger;
51     private int[] sInteger;
52     
53     private Long JavaDoc[] oLong;
54     private Long JavaDoc[] nLong;
55     private long[] sLong;
56
57     private Short JavaDoc[] oShort;
58     private Short JavaDoc[] nShort;
59     private short[] sShort;
60     
61     private String JavaDoc[] oString;
62     private String JavaDoc[] nString;
63     
64     private Date[] oDate;
65     private Date[] nDate;
66     
67     private ObjectSimplePrivate[] oObject;
68     private ObjectSimplePrivate[] nObject;
69
70     public void set(int ver){
71         if(ver == 1){
72             oBoolean = new Boolean JavaDoc[]{new Boolean JavaDoc(true), new Boolean JavaDoc(false), null };
73             nBoolean = null;
74             sBoolean = new boolean[]{true, true, false};
75     
76             /*
77             oByte = new Byte[]{ new Byte(Byte.MAX_VALUE), new Byte(Byte.MIN_VALUE), new Byte((byte)0), null};
78             nByte = null;
79             sByte = new byte[]{Byte.MAX_VALUE, Byte.MIN_VALUE, 0, 1};
80             */

81         
82             oCharacter = new Character JavaDoc[]{ new Character JavaDoc((char)(Character.MAX_VALUE - 1)), new Character JavaDoc(Character.MIN_VALUE), new Character JavaDoc((char)(0)),null};
83             nCharacter = null;
84             sChar = new char[]{(char)(Character.MAX_VALUE - 1), Character.MIN_VALUE, (char)(0)};
85
86             oDouble = new Double JavaDoc[]{new Double JavaDoc(Double.MAX_VALUE - 1), new Double JavaDoc(Double.MIN_VALUE), new Double JavaDoc(0), null };
87             nDouble = null;
88             sDouble = new double[]{Double.MAX_VALUE - 1, Double.MIN_VALUE, 0 };
89     
90             oFloat = new Float JavaDoc[] {new Float JavaDoc(Float.MAX_VALUE - 1), new Float JavaDoc(Float.MIN_VALUE), new Float JavaDoc(0), null};
91             nFloat = null;
92             sFloat = new float[] {Float.MAX_VALUE - 1, Float.MIN_VALUE, 0};
93     
94             oInteger = new Integer JavaDoc[] {new Integer JavaDoc(Integer.MAX_VALUE - 1), new Integer JavaDoc(Integer.MIN_VALUE), new Integer JavaDoc(0), null};
95             nInteger = null;
96             sInteger = new int[] {Integer.MAX_VALUE - 1, Integer.MIN_VALUE, 0};
97     
98             oLong = new Long JavaDoc[] { new Long JavaDoc(Long.MAX_VALUE - 1), new Long JavaDoc(Long.MIN_VALUE), new Long JavaDoc(0), null};
99             nLong = null;
100             sLong = new long[] { Long.MAX_VALUE - 1, Long.MIN_VALUE, 0};
101
102             oShort = new Short JavaDoc[] { new Short JavaDoc((short)(Short.MAX_VALUE - 1)), new Short JavaDoc(Short.MIN_VALUE), new Short JavaDoc((short)(0)), null };
103             nShort = null;
104             sShort = new short[] { (short)(Short.MAX_VALUE - 1), Short.MIN_VALUE, (short)0};
105     
106             oString = new String JavaDoc[] {"db4o rules", "cool", "supergreat"};
107             nString = null;
108         
109             oDate = new Date[] {new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2001,11,31).getTime(), null};
110             nDate = null;
111         
112             oObject = new ObjectSimplePrivate[]{new ObjectSimplePrivate("so"), null, new ObjectSimplePrivate("far"), new ObjectSimplePrivate("O.K.")};
113             nObject = null;
114         }else{
115             oBoolean = new Boolean JavaDoc[]{new Boolean JavaDoc(false), new Boolean JavaDoc(true), new Boolean JavaDoc(true)};
116             nBoolean = new Boolean JavaDoc[]{null, new Boolean JavaDoc(true), new Boolean JavaDoc(false)};
117             sBoolean = new boolean[]{true, true, true};
118     
119             /*
120             oByte = new Byte[]{ new Byte(Byte.MIN_VALUE), new Byte(Byte.MAX_VALUE), new Byte((byte)1), new Byte((byte)-1)};
121             nByte = new Byte[]{ null, new Byte(Byte.MAX_VALUE), new Byte(Byte.MIN_VALUE), new Byte((byte)0)};
122             sByte = new byte[]{Byte.MIN_VALUE, Byte.MAX_VALUE, 0, -1, 1};
123             */

124         
125             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)};
126             nCharacter = new Character JavaDoc[]{ null, new Character JavaDoc((char)(Character.MAX_VALUE - 1)), new Character JavaDoc(Character.MIN_VALUE), new Character JavaDoc((char)(0))};
127             sChar = new char[]{Character.MIN_VALUE, (char)(0)};
128
129             oDouble = new Double JavaDoc[]{new Double JavaDoc(Double.MIN_VALUE), new Double JavaDoc(0)};
130             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)};
131             sDouble = new double[]{Double.MAX_VALUE - 1, Double.MIN_VALUE, 0, 0.12344, - 123.12344 };
132     
133             oFloat = new Float JavaDoc[] {new Float JavaDoc((float)- 98.765)};
134             nFloat = null;
135             sFloat = new float[] {(float)- 0.55, Float.MAX_VALUE - 1, Float.MIN_VALUE, 0, (float)0.33};
136     
137             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)};
138             nInteger = new Integer JavaDoc[] {null, new Integer JavaDoc(Integer.MAX_VALUE - 1), new Integer JavaDoc(Integer.MIN_VALUE), new Integer JavaDoc(0)};
139             sInteger = new int[] {888, 666, 999, 101010, 111111};
140     
141             oLong = new Long JavaDoc[] { new Long JavaDoc(Long.MAX_VALUE - 1), new Long JavaDoc(Long.MIN_VALUE), new Long JavaDoc(1)};
142             nLong = new Long JavaDoc[] { null, new Long JavaDoc(Long.MAX_VALUE - 1), new Long JavaDoc(Long.MIN_VALUE), new Long JavaDoc(0)};
143             sLong = new long[] { Long.MAX_VALUE - 1, Long.MIN_VALUE};
144
145             oShort = new Short JavaDoc[] { new Short JavaDoc(Short.MIN_VALUE), new Short JavaDoc((short)(Short.MAX_VALUE - 1)), new Short JavaDoc((short)(0))};
146             nShort = new Short JavaDoc[] { new Short JavaDoc((short)(Short.MAX_VALUE - 1)), null, new Short JavaDoc(Short.MIN_VALUE), new Short JavaDoc((short)(0))};
147             sShort = null;
148     
149             oString = new String JavaDoc[] {"db4o rulez", "cool", "supergreat"};
150             nString = new String JavaDoc[] {null, "db4o rules", "cool", "supergreat", null};
151         
152             oDate = new Date[] {new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(1999,0,1).getTime(), new GregorianCalendar(2001,11,31).getTime()};
153             nDate = new Date[] {null, new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2001,11,31).getTime(), null};
154         
155             oObject = new ObjectSimplePrivate[]{new ObjectSimplePrivate("works"), new ObjectSimplePrivate("far"), new ObjectSimplePrivate("excellent")};
156             nObject = new ObjectSimplePrivate[]{};
157         }
158     }
159     
160     public boolean jdk2(){
161         return true;
162     }
163 }
164
Popular Tags