KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ca > mcgill > sable > soot > util > SootCmdFormat


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2003 Jennifer Lhotak
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */

19
20
21 package ca.mcgill.sable.soot.util;
22
23
24 public class SootCmdFormat {
25
26     public static final String JavaDoc SPACE = " ";
27     public static final String JavaDoc COLON = ":";
28     private String JavaDoc separator;
29     private Object JavaDoc val;
30     
31     
32     /**
33      * Constructor for SootCmdFormat.
34      */

35     public SootCmdFormat(String JavaDoc separator, Object JavaDoc val) {
36         setSeparator(separator);
37         setVal(val);
38     }
39
40     /**
41      * Returns the separator.
42      * @return String
43      */

44     public String JavaDoc getSeparator() {
45         return separator;
46     }
47
48     /**
49      * Returns the val.
50      * @return String
51      */

52     public Object JavaDoc getVal() {
53         return val;
54     }
55
56     /**
57      * Sets the separator.
58      * @param separator The separator to set
59      */

60     public void setSeparator(String JavaDoc separator) {
61         this.separator = separator;
62     }
63
64     /**
65      * Sets the val.
66      * @param val The val to set
67      */

68     public void setVal(Object JavaDoc val) {
69         this.val = val;
70     }
71     
72     public String JavaDoc toString() {
73         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
74         sb.append(getSeparator());
75         sb.append(getVal());
76         return sb.toString();
77     }
78
79 }
80
Popular Tags