1 21 22 package org.apache.derbyTesting.functionTests.util; 23 24 import java.sql.Date ; 25 import java.sql.Time ; 26 import java.sql.Timestamp ; 27 28 import java.math.BigDecimal ; 29 30 import java.io.Serializable ; 31 32 36 37 public class ManyMethods implements Serializable 38 { 39 40 int value; 41 protected int protectedValue; 42 private int privateValue; 43 public int publicValue; 44 public short publicshort; 45 public Short publicShort; 46 public byte publicbyte; 47 public Byte publicByte; 48 public int publicint; 49 public Integer publicInteger; 50 public long publiclong; 51 public Long publicLong; 52 public boolean publicboolean; 53 public Boolean publicBoolean; 54 public float publicfloat; 55 public Float publicFloat; 56 public double publicdouble; 57 public Double publicDouble; 58 public String publicString; 59 public Date publicDate; 60 public Time publicTime; 61 public Timestamp publicTimestamp; 62 public ManyMethods myself; 63 64 public static int NONOVERLOADED_INTSTATIC = 1; 65 public static int OVERLOADED_INTSTATIC = 1; 66 public static int OVEROVERLOADED_INTSTATIC = 1; 67 68 public ManyMethods(int value) 69 { 70 this.value = value; 71 this.myself = this; 72 protectedValue = value; 73 privateValue = value; 74 publicValue = value; 75 publicint = value; 76 publicInteger = new Integer (value); 77 publicshort = (short) value; 78 publicShort = new Short ((short) value); 79 publicbyte = (byte) value; 80 publicByte = new Byte ((byte) value); 81 publiclong = (long) value; 82 publicLong = new Long ((long) value); 83 publicboolean = booleanMethod(); 84 publicBoolean = BooleanMethod(); 85 publicfloat = floatMethod(); 86 publicFloat = FloatMethod(); 87 publicdouble = doubleMethod(); 88 publicDouble = DoubleMethod(); 89 publicString = StringMethod(); 90 publicDate = DateMethod(); 91 publicTime = TimeMethod(); 92 publicTimestamp = TimestampMethod(); 93 } 94 95 102 103 public String parmType(byte value) 104 { 105 return "byte parameter"; 106 } 107 108 public String parmType(byte[][][] value) 109 { 110 return "byte[][][] parameter"; 111 } 112 113 public String parmType(Byte value) 114 { 115 return "java.lang.Byte parameter"; 116 } 117 118 public String parmType(char value) 119 { 120 return "char parameter"; 121 } 122 123 public String parmType(Character value) 124 { 125 return "java.lang.Character parameter"; 126 } 127 128 public String parmType(double value) 129 { 130 return "double parameter"; 131 } 132 133 public String parmType(Double value) 134 { 135 return "java.lang.Double parameter"; 136 } 137 138 public String parmType(BigDecimal value) 139 { 140 return "java.math.BigDecimal parameter"; 141 } 142 143 public String parmType(float value) 144 { 145 return "float parameter"; 146 } 147 148 public String parmType(Float value) 149 { 150 return "java.lang.Float parameter"; 151 } 152 153 public String parmType(int value) 154 { 155 return "int parameter"; 156 } 157 158 public String parmType(Integer value) 159 { 160 return "java.lang.Integer parameter"; 161 } 162 163 public String parmType(long value) 164 { 165 return "long parameter"; 166 } 167 168 public String parmType(Long value) 169 { 170 return "java.lang.Long parameter"; 171 } 172 173 public String parmType(short value) 174 { 175 return "short parameter"; 176 } 177 178 public String parmType(Short value) 179 { 180 return "java.lang.Short parameter"; 181 } 182 183 public String parmType(boolean value) 184 { 185 return "boolean parameter"; 186 } 187 188 public String parmType(Boolean value) 189 { 190 return "java.lang.Boolean parameter"; 191 } 192 193 public String parmType(String value) 194 { 195 return "java.lang.String parameter"; 196 } 197 198 public String parmType(Date value) 199 { 200 return "java.sql.Date parameter"; 201 } 202 203 public String parmType(Time value) 204 { 205 return "java.sql.Time parameter"; 206 } 207 208 public String parmType(Timestamp value) 209 { 210 return "java.sql.Timestamp parameter"; 211 } 212 213 218 public byte byteMethod() 219 { 220 return 1; 221 } 222 223 public byte[][][] byteArrayArrayArrayMethod() 224 { 225 return new byte[3][][]; 226 } 227 228 public Byte ByteMethod() 229 { 230 return new Byte ((byte) 1); 231 } 232 233 public char charMethod() 234 { 235 return 'a'; 236 } 237 238 public Character CharacterMethod() 239 { 240 return new Character ('a'); 241 } 242 243 public double doubleMethod() 244 { 245 return 1.5; 246 } 247 248 public Double DoubleMethod() 249 { 250 return new Double (1.5); 251 } 252 253 public BigDecimal BigDecimalMethod() 254 { 255 return new BigDecimal (1.4d); 256 } 257 258 public float floatMethod() 259 { 260 return 2.5F; 261 } 262 263 public Float FloatMethod() 264 { 265 return new Float (2.5F); 266 } 267 268 public int intMethod() 269 { 270 return 2; 271 } 272 273 public Integer IntegerMethod() 274 { 275 return new Integer (2); 276 } 277 278 public long longMethod() 279 { 280 return 3L; 281 } 282 283 public Long LongMethod() 284 { 285 return new Long (3L); 286 } 287 288 public short shortMethod() 289 { 290 return (short) 4; 291 } 292 293 public Short ShortMethod() 294 { 295 return new Short ((short) 4); 296 } 297 298 public boolean booleanMethod() 299 { 300 return true; 301 } 302 303 public Boolean BooleanMethod() 304 { 305 return new Boolean (true); 306 } 307 308 public String StringMethod() 309 { 310 return "A String"; 311 } 312 313 public Date DateMethod() 314 { 315 316 return new Date (870505200000L); 319 } 320 321 public Time TimeMethod() 322 { 323 324 return new Time (68313000L); 327 } 328 329 public Timestamp TimestampMethod() 330 { 331 332 return new Timestamp (870544755000L); 335 } 336 337 public ManyMethods ManyMethodsMethod() 338 { 339 return this; 340 } 341 342 347 public String isNull(Boolean value) 348 { 349 if (value == null) 350 return "Boolean is null"; 351 else 352 return "Boolean is not null"; 353 } 354 355 public String isNull(String value) 356 { 357 if (value == null) 358 return "String is null"; 359 else 360 return "String is not null"; 361 } 362 363 public String isNull(Double value) 364 { 365 if (value == null) 366 return "Double is null"; 367 else 368 return "Double is not null"; 369 } 370 371 public String isNull(BigDecimal value) 372 { 373 if (value == null) 374 return "BigDecimal is null"; 375 else 376 return "BigDecimal is not null"; 377 } 378 379 public String isNull(Integer value) 380 { 381 if (value == null) 382 return "Integer is null"; 383 else 384 return "Integer is not null"; 385 } 386 387 public String isNull(Float value) 388 { 389 if (value == null) 390 return "Float is null"; 391 else 392 return "Float is not null"; 393 } 394 395 public String isNull(Short value) 396 { 397 if (value == null) 398 return "Short is null"; 399 else 400 return "Short is not null"; 401 } 402 403 public String isNull(Date value) 404 { 405 if (value == null) 406 return "Date is null"; 407 else 408 return "Date is not null"; 409 } 410 411 public String isNull(Time value) 412 { 413 if (value == null) 414 return "Time is null"; 415 else 416 return "Time is not null"; 417 } 418 419 public String isNull(Timestamp value) 420 { 421 if (value == null) 422 return "Timestamp is null"; 423 else 424 return "Timestamp is not null"; 425 } 426 427 428 public String integerFloatDouble(Integer parm1, Float parm2, Double parm3) 429 { 430 return "integerFloatDouble method"; 431 } 432 433 public String stringDateTimeTimestamp(String parm1, Date parm2, Time parm3, 434 Timestamp parm4) 435 { 436 return "stringDateTimeTimestamp method"; 437 } 438 439 440 public static int staticMethod() 441 { 442 return 1; 443 } 444 445 public static int overloadedStaticMethod() 446 { 447 return 1; 448 } 449 450 public static int overOverloadedStaticMethod() 451 { 452 return 1; 453 } 454 455 public static Byte staticByteMethod() 456 { 457 return new Byte ((byte) 1); 458 } 459 460 public static Character staticCharacterMethod() 461 { 462 return new Character ('a'); 463 } 464 465 public static Double staticDoubleMethod() 466 { 467 return new Double (1.5); 468 } 469 470 public static BigDecimal staticBigDecimalMethod() 471 { 472 return new BigDecimal (1.1d); 473 } 474 475 public static Float staticFloatMethod() 476 { 477 return new Float (2.5F); 478 } 479 480 public static Long staticLongMethod() 481 { 482 return new Long (3L); 483 } 484 485 public static Short staticShortMethod() 486 { 487 return new Short ((short) 4); 488 } 489 490 public static Integer staticIntegerMethod() 491 { 492 return new Integer (2); 493 } 494 495 public static Boolean staticBooleanMethod() 496 { 497 return new Boolean (true); 498 } 499 500 public static String staticStringMethod() 501 { 502 return "A String"; 503 } 504 505 public static Date staticDateMethod() 506 { 507 508 return new Date (97, 7, 2); 509 } 510 511 public static Time staticTimeMethod() 512 { 513 514 return new Time (10, 58, 33); 515 } 516 517 public static Timestamp staticTimestampMethod() 518 { 519 520 return new Timestamp (97, 7, 2, 10, 59, 15, 0); 521 } 522 523 public static ManyMethods staticManyMethods(Integer value) 524 { 525 return new ManyMethods(value.intValue()); 526 } 527 528 529 public SubClass subClass() 530 { 531 if (this instanceof SubClass) 532 { 533 return (SubClass) this; 534 } 535 else 536 { 537 return null; 538 } 539 } 540 541 public int[] getIntArray() { 542 return new int[0]; 543 } 544 545 public Object [] getObjectArray() { 546 return new String [0]; 547 } 548 549 550 protected int protectedMethod() 551 { 552 return 1; 553 } 554 555 private int privateMethod() 556 { 557 return 1; 558 } 559 560 int packageMethod() 561 { 562 return 1; 563 } 564 565 public int exceptionMethod() throws Throwable 566 { 567 throw new Throwable ("This exception should be caught by the runtime system."); 568 } 569 570 573 574 public static NoMethodInterface getNoMethodInterface() { 575 return new SubInterfaceClass(67); 576 } 577 public static Runnable getRunnable() { 578 return new SubInterfaceClass(89); 579 } 580 public static ExtendingInterface getExtendingInterface() { 581 return new SubInterfaceClass(235); 582 } 583 } 584 | Popular Tags |