1 21 package com.db4o.test.types; 22 23 import java.util.*; 24 25 public class ArrayTypedPublic extends RTest 26 { 27 public Boolean [] oBoolean; 28 public Boolean [] nBoolean; 29 public boolean[] sBoolean; 30 31 public Byte [] oByte; 32 public Byte [] nByte; 33 public byte[] sByte; 34 35 public Character [] oCharacter; 36 public Character [] nCharacter; 37 public char[] sChar; 38 39 public Double [] oDouble; 40 public Double [] nDouble; 41 public double[] sDouble; 42 43 public Float [] oFloat; 44 public Float [] nFloat; 45 public float[] sFloat; 46 47 public Integer [] oInteger; 48 public Integer [] nInteger; 49 public int[] sInteger; 50 51 public Long [] oLong; 52 public Long [] nLong; 53 public long[] sLong; 54 55 public Short [] oShort; 56 public Short [] nShort; 57 public short[] sShort; 58 59 public String [] oString; 60 public String [] nString; 61 62 public Date[] oDate; 63 public Date[] nDate; 64 65 public ObjectSimplePublic[] oObject; 66 public ObjectSimplePublic[] nObject; 67 68 public void set(int ver){ 69 if(ver == 1){ 70 oBoolean = new Boolean []{new Boolean (true), new Boolean (false), null }; 71 nBoolean = null; 72 sBoolean = new boolean[]{true, true, false}; 73 74 oByte = new Byte []{ new Byte (Byte.MAX_VALUE), new Byte (Byte.MIN_VALUE), new Byte ((byte)0), null}; 75 nByte = null; 76 sByte = new byte[]{Byte.MAX_VALUE, Byte.MIN_VALUE, 0, 1}; 77 78 oCharacter = new Character []{ new Character ((char)(Character.MAX_VALUE - 1)), new Character (Character.MIN_VALUE), new Character ((char)(0)),null}; 79 nCharacter = null; 80 sChar = new char[]{(char)(Character.MAX_VALUE - 1), Character.MIN_VALUE, (char)(0)}; 81 82 oDouble = new Double []{new Double (Double.MAX_VALUE - 1), new Double (Double.MIN_VALUE), new Double (0), null }; 83 nDouble = null; 84 sDouble = new double[]{Double.MAX_VALUE - 1, Double.MIN_VALUE, 0 }; 85 86 oFloat = new Float [] {new Float (Float.MAX_VALUE - 1), new Float (Float.MIN_VALUE), new Float (0), null}; 87 nFloat = null; 88 sFloat = new float[] {Float.MAX_VALUE - 1, Float.MIN_VALUE, 0}; 89 90 oInteger = new Integer [] {new Integer (Integer.MAX_VALUE - 1), new Integer (Integer.MIN_VALUE), new Integer (0), null}; 91 nInteger = null; 92 sInteger = new int[] {Integer.MAX_VALUE - 1, Integer.MIN_VALUE, 0}; 93 94 oLong = new Long [] { new Long (Long.MAX_VALUE - 1), new Long (Long.MIN_VALUE), new Long (0), null}; 95 nLong = null; 96 sLong = new long[] { Long.MAX_VALUE - 1, Long.MIN_VALUE, 0}; 97 98 oShort = new Short [] { new Short ((short)(Short.MAX_VALUE - 1)), new Short (Short.MIN_VALUE), new Short ((short)(0)), null }; 99 nShort = null; 100 sShort = new short[] { (short)(Short.MAX_VALUE - 1), Short.MIN_VALUE, (short)0}; 101 102 oString = new String [] {"db4o rules", "cool", "supergreat"}; 103 nString = null; 104 105 oDate = new Date[] {new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2001,11,31).getTime(), null}; 106 nDate = null; 107 108 oObject = new ObjectSimplePublic[]{new ObjectSimplePublic("so"), null, new ObjectSimplePublic("far"), new ObjectSimplePublic("O.K.")}; 109 nObject = null; 110 }else{ 111 oBoolean = new Boolean []{new Boolean (false), new Boolean (true), new Boolean (true)}; 112 nBoolean = new Boolean []{null, new Boolean (true), new Boolean (false)}; 113 sBoolean = new boolean[]{true, true, true}; 114 115 oByte = new Byte []{ new Byte (Byte.MIN_VALUE), new Byte (Byte.MAX_VALUE), new Byte ((byte)1), new Byte ((byte)-1)}; 116 nByte = new Byte []{ null, new Byte (Byte.MAX_VALUE), new Byte (Byte.MIN_VALUE), new Byte ((byte)0)}; 117 sByte = new byte[]{Byte.MIN_VALUE, Byte.MAX_VALUE, 0, -1, 1}; 118 119 oCharacter = new Character []{ new Character (Character.MIN_VALUE), new Character ((char)(Character.MAX_VALUE - 1)), new Character ((char)(0)),new Character ((char)(Character.MAX_VALUE - 1)),new Character ((char)1)}; 120 nCharacter = new Character []{ null, new Character ((char)(Character.MAX_VALUE - 1)), new Character (Character.MIN_VALUE), new Character ((char)(0))}; 121 sChar = new char[]{Character.MIN_VALUE, (char)(0)}; 122 123 oDouble = new Double []{new Double (Double.MIN_VALUE), new Double (0)}; 124 nDouble = new Double []{null, new Double (Double.MAX_VALUE - 1), new Double (Double.MIN_VALUE), new Double (- 123.12344), new Double ( - 12345.123445566)}; 125 sDouble = new double[]{Double.MAX_VALUE - 1, Double.MIN_VALUE, 0, 0.12344, - 123.12344 }; 126 127 oFloat = new Float [] {new Float ((float)- 98.765)}; 128 nFloat = null; 129 sFloat = new float[] {(float)- 0.55, Float.MAX_VALUE - 1, Float.MIN_VALUE, 0, (float)0.33}; 130 131 oInteger = new Integer [] {new Integer (Integer.MAX_VALUE - 1), new Integer (Integer.MIN_VALUE), new Integer (111), new Integer (-333)}; 132 nInteger = new Integer [] {null, new Integer (Integer.MAX_VALUE - 1), new Integer (Integer.MIN_VALUE), new Integer (0)}; 133 sInteger = new int[] {888, 666, 999, 101010, 111111}; 134 135 oLong = new Long [] { new Long (Long.MAX_VALUE - 1), new Long (Long.MIN_VALUE), new Long (1)}; 136 nLong = new Long [] { null, new Long (Long.MAX_VALUE - 1), new Long (Long.MIN_VALUE), new Long (0)}; 137 sLong = new long[] { Long.MAX_VALUE - 1, Long.MIN_VALUE}; 138 139 oShort = new Short [] { new Short (Short.MIN_VALUE), new Short ((short)(Short.MAX_VALUE - 1)), new Short ((short)(0))}; 140 nShort = new Short [] { new Short ((short)(Short.MAX_VALUE - 1)), null, new Short (Short.MIN_VALUE), new Short ((short)(0))}; 141 sShort = null; 142 143 oString = new String [] {"db4o rulez", "cool", "supergreat"}; 144 nString = new String [] {null, "db4o rules", "cool", "supergreat", null}; 145 146 oDate = new Date[] {new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(1999,0,1).getTime(), new GregorianCalendar(2001,11,31).getTime()}; 147 nDate = new Date[] {null, new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2000,0,1).getTime(), new GregorianCalendar(2001,11,31).getTime(), null}; 148 149 oObject = new ObjectSimplePublic[]{new ObjectSimplePublic("works"), new ObjectSimplePublic("far"), new ObjectSimplePublic("excellent")}; 150 nObject = new ObjectSimplePublic[]{}; 151 } 152 } 153 } 154 | Popular Tags |