001: package field;
002:
003: /**
004: * Description of the Class
005: *
006: *@author Chris Seguin
007: */
008: public class RenameFieldTest {
009: /**
010: * Description of the Field
011: */
012: public double height;
013: private String simple;
014: private int code;
015: private UsesFieldTest myChild;
016: /**
017: * Description of the Field
018: */
019: public static final int CODE_ON = 0;
020: /**
021: * Description of the Field
022: */
023: public static final int CODE_OFF = 1;
024:
025: /**
026: * Constructor for the RenameFieldTest object
027: */
028: public RenameFieldTest() {
029: simple = "ample";
030: code = 52;
031: height = 321.12;
032: }
033:
034: /**
035: * Constructor for the RenameFieldTest object
036: *
037: *@param code Description of Parameter
038: */
039: public RenameFieldTest(int code) {
040: simple = "ample";
041: this .code = code;
042: height = 321.12;
043: }
044:
045: /**
046: * Sets the Code attribute of the RenameFieldTest object
047: *
048: *@param code The new Code value
049: */
050: public void setCode(int code) {
051: this .code = code;
052: }
053:
054: /**
055: * Sets the CodeAlt attribute of the RenameFieldTest object
056: *
057: *@param changed The new CodeAlt value
058: */
059: public void setCodeAlt(int changed) {
060: code = changed;
061: }
062:
063: /**
064: * Gets the Simple attribute of the RenameFieldTest object
065: *
066: *@return The Simple value
067: */
068: public String getSimple() {
069: return simple;
070: }
071:
072: /**
073: * Gets the Code attribute of the RenameFieldTest object
074: *
075: *@return The Code value
076: */
077: public int getCode() {
078: return this .code;
079: }
080:
081: /**
082: * Gets the Volume attribute of the RenameFieldTest object
083: *
084: *@return The Volume value
085: */
086: public double getVolume() {
087: return height * this .height * height;
088: }
089:
090: /**
091: * Description of the Method
092: */
093: public void debugPrint() {
094: System.out.println("String: " + simple.toString() + " "
095: + simple());
096: }
097:
098: /**
099: * Compares this to the parameter.
100: *
101: *@param other the reference object with which to compare.
102: *@return <tt>true</tt> if this object is the same as the obj
103: * argument; <tt>false</tt> otherwise.
104: */
105: public boolean equals(Object other) {
106: if (other instanceof RenameFieldTest) {
107: RenameFieldTest rft = (RenameFieldTest) other;
108: return rft.code == this .code;
109: }
110:
111: return false;
112: }
113:
114: /**
115: * Description of the Method
116: *
117: *@param anObject Description of Parameter
118: */
119: void usesField(UsesFieldTest anObject) {
120: anObject.simple = "";
121: }
122:
123: /**
124: * Description of the Method
125: *
126: *@param objectToDownCast Description of Parameter
127: */
128: void upCasts(RenameFieldTest objectToDownCast) {
129: ((InheritFieldTest) objectToDownCast).anOtherMember = "";
130: ((InheritFieldTest) objectToDownCast).simple = "";
131: }
132:
133: /**
134: * Description of the Method
135: *
136: *@param objectToDownCast Description of Parameter
137: */
138: void downCasts(InheritFieldTest objectToDownCast) {
139: ((RenameFieldTest) objectToDownCast).simple = "";
140: }
141:
142: /**
143: * Description of the Method
144: *
145: *@param linkedObject Description of Parameter
146: */
147: void linkedField(RenameFieldTest linkedObject) {
148: linkedObject.myChild.simple = "";
149: }
150:
151: }
|