KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > sc > Function


1 /* *****************************************************************************
2  * Function.java
3  * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package org.openlaszlo.sc;
11
12 /**
13  *
14  * @author Oliver Steele
15  */

16 public class Function {
17     private final String JavaDoc name;
18     private final String JavaDoc args;
19     private final String JavaDoc body;
20     
21     public Function(String JavaDoc body) {
22         this("", body);
23     }
24     
25     public Function(String JavaDoc args, String JavaDoc body) {
26         this("", args, body);
27     }
28     
29     public Function(String JavaDoc name, String JavaDoc args, String JavaDoc body) {
30         this.name = name;
31         this.args = args;
32         this.body = body;
33     }
34
35     public String JavaDoc toString() {
36         return "function " + name + "\n(" + args + "\n) {" + body + "\n}";
37     }
38 }
39
Popular Tags