01: package method;
02:
03: /**
04: * Description of the Class
05: *
06: *@author Chris Seguin
07: */
08: public class ExtractMethodTestTwo {
09: private double start;
10: private String text;
11:
12: /**
13: * Constructor for the ExtractMethodTestTwo object
14: */
15: public ExtractMethodTestTwo() {
16: start = 5.0;
17: text = "string";
18: }
19:
20: /**
21: * Description of the Method
22: *
23: *@param offset Description of Parameter
24: *@return Description of the Returned Value
25: */
26: public double methodTwo(double offset) {
27: double init = 1.0;
28:
29: for (int ndx = 0; ndx < 10; ndx++) {
30: extractedMethod(init, offset);
31: }
32:
33: if (init > 400) {
34: return init;
35: } else {
36: return 400;
37: }
38: }
39:
40: /**
41: * Description of the Method
42: *
43: *@param input Description of Parameter
44: *@return Description of the Returned Value
45: */
46: public String methodOne(String input) {
47: StringBuffer buf = new StringBuffer();
48: while (buf.length() < 50) {
49: String msg = null;
50: msg = text + " " + buf.length() + input;
51: buf.append(msg);
52: }
53:
54: return buf.toString();
55: }
56:
57: /**
58: * Description of the Method
59: *
60: *@param init Description of Parameter
61: *@param offset Description of Parameter
62: */
63: private void extractedMethod(double init, double offset) {
64: double temp = start;
65: temp = init * init;
66: init += temp + offset;
67: }
68: }
|