KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > test > AReallyObnoxiouslyLongWindedNamedObject


1 /*
2  * Copyright 2002 (C) TJDO.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the TJDO License version 1.0.
6  * See the terms of the TJDO License in the documentation provided with this software.
7  *
8  * $Id: AReallyObnoxiouslyLongWindedNamedObject.java,v 1.3 2002/11/08 05:06:26 jackknifebarber Exp $
9  */

10
11 package com.triactive.jdo.test;
12
13
14
15 /**
16  * A test object using Java identifiers intentionally chosen to overflow
17  * Oracle's identifier limits.
18  *
19  * @author <a HREF="mailto:mmartin5@austin.rr.com">Mike Martin</a>
20  * @version $Revision: 1.3 $
21  */

22
23 class AReallyObnoxiouslyLongWindedNamedObject extends KeywordConflict
24 {
25     private KeywordConflict aReallyObnoxiouslyLongWindedNamedField;
26
27
28     public AReallyObnoxiouslyLongWindedNamedObject()
29     {
30         super();
31     }
32
33
34     /**
35      * Fills all of the object's fields with random data values. Any non-
36      * primitive fields (with the exception of <code>id</code>) will also be
37      * assigned <code>null</code> on a random basis.
38      */

39
40     public void fillRandom()
41     {
42         super.fillRandom();
43
44         aReallyObnoxiouslyLongWindedNamedField = null;
45     }
46
47
48     /**
49      * Indicates whether some other object is "equal to" this one. By comparing
50      * against an original copy of the object, <code>compareTo()</code> can be
51      * used to verify that the object has been written to a database and read
52      * back correctly.
53      *
54      * @param obj the reference object with which to compare
55      *
56      * @return <code>true</code> if this object is equal to the obj argument;
57      * <code>false</code> otherwise.
58      */

59
60     public boolean compareTo(Object JavaDoc obj)
61     {
62         if (obj == this)
63             return true;
64
65         if (!(obj instanceof AReallyObnoxiouslyLongWindedNamedObject) || !super.compareTo(obj))
66             return false;
67
68         AReallyObnoxiouslyLongWindedNamedObject o = (AReallyObnoxiouslyLongWindedNamedObject)obj;
69
70         return aReallyObnoxiouslyLongWindedNamedField == o.aReallyObnoxiouslyLongWindedNamedField;
71     }
72
73
74     /**
75      * Returns a string representation for this object. All of the field
76      * values are included in the string for debugging purposes.
77      *
78      * @return a string representation for this object.
79      */

80
81     public String JavaDoc toString()
82     {
83         StringBuffer JavaDoc s = new StringBuffer JavaDoc(super.toString());
84
85         s.append(" aReallyObnoxiouslyLongWindedNamedField = ").append(aReallyObnoxiouslyLongWindedNamedField);
86         s.append('\n');
87
88         return s.toString();
89     }
90 }
91
Popular Tags