01: /*
02: * $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegrapheditor/sourcecontrol/MethodWithBody.java,v 1.1 2005/04/20 22:21:20 paulby Exp $
03: *
04: * Sun Public License Notice
05: *
06: * The contents of this file are subject to the Sun Public License Version
07: * 1.0 (the "License"). You may not use this file except in compliance with
08: * the License. A copy of the License is available at http://www.sun.com/
09: *
10: * The Original Code is the Java 3D(tm) Scene Graph Editor.
11: * The Initial Developer of the Original Code is Jan Becicka.
12: * Portions created by Jan Becicka are Copyright (C) 2002.
13: * All Rights Reserved.
14: *
15: * Contributor(s): Jan Becicka.
16: *
17: **/
18: package org.jdesktop.j3dedit.scenegrapheditor.sourcecontrol;
19:
20: import java.util.List;
21: import java.util.Iterator;
22:
23: /**
24: *
25: * @author Jan Becicka
26: * @version
27: */
28: public class MethodWithBody {
29:
30: List constr;
31: List cust;
32: String name;
33: String methodName;
34:
35: /** Creates new MethodWithBody */
36: public MethodWithBody(String name, List constr, List cust) {
37: this .name = name;
38: methodName = NamePool.firstUpper(name);
39: this .cust = cust;
40: this .constr = constr;
41: }
42:
43: public String toString() {
44: return "private BranchGroup " + methodName + "(){\n"
45: + getConstr() + getCust() + "return " + name + ";\n}\n";
46: }
47:
48: private String getConstr() {
49: Iterator c = constr.iterator();
50: StringBuffer b = new StringBuffer();
51: while (c.hasNext()) {
52: b.append(c.next());
53: }
54: return b.toString();
55: }
56:
57: private String getCust() {
58: Iterator c = cust.iterator();
59: StringBuffer b = new StringBuffer();
60: while (c.hasNext()) {
61: b.append(c.next());
62: }
63: return b.toString();
64: }
65:
66: /** Getter for property name.
67: * @return Value of property name.
68: */
69: public String getName() {
70: return name;
71: }
72:
73: /** Getter for property methodName.
74: * @return Value of property methodName.
75: */
76: public String getMethodName() {
77: return methodName;
78: }
79:
80: }
|