KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gui > updatecenterwizard > settings > CatalogDataValues


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package gui.updatecenterwizard.settings;
21
22 import java.util.StringTokenizer JavaDoc;
23 import java.util.Vector JavaDoc;
24
25 /**
26  *
27  * @author Jaromir.Uhrik@Sun.Com
28  */

29
30 public class CatalogDataValues {
31
32     private String JavaDoc ucName;
33     private String JavaDoc ucFile;
34     private String JavaDoc proxyHost;
35     private String JavaDoc proxyPort;
36     private Vector JavaDoc modules;
37
38     /** Creates a new instance of DataValues */
39     public CatalogDataValues() {
40         this("", "", "", "", "");
41     }
42
43
44     public CatalogDataValues(String JavaDoc ucName, String JavaDoc ucFile, String JavaDoc proxyHost, String JavaDoc proxyPort, String JavaDoc modules) {
45         this(ucName, ucFile, proxyHost, proxyPort, modules2Vector(modules));
46     }
47     
48     public CatalogDataValues(String JavaDoc ucName, String JavaDoc ucFile, String JavaDoc proxyHost, String JavaDoc proxyPort, Vector JavaDoc modules) {
49         setUcName(ucName);
50         setUcFile(ucFile);
51         setProxyHost(proxyHost);
52         setProxyPort(proxyPort);
53         setModules(modules);
54     }
55     
56     public String JavaDoc getUcName() {
57         return ucName;
58     }
59     
60     public void setUcName(String JavaDoc ucName) {
61         this.ucName = ucName;
62     }
63     
64     public String JavaDoc getUcFile() {
65         return ucFile;
66     }
67     
68     public void setUcFile(String JavaDoc ucFile) {
69         this.ucFile = ucFile;
70     }
71     
72     public String JavaDoc getProxyHost() {
73         return proxyHost;
74     }
75     
76     public void setProxyHost(String JavaDoc proxyHost) {
77         this.proxyHost = proxyHost;
78     }
79     
80     public String JavaDoc getProxyPort() {
81         return proxyPort;
82     }
83     
84     public void setProxyPort(String JavaDoc proxyPort) {
85         this.proxyPort = proxyPort;
86     }
87     
88     public Vector JavaDoc getModules() {
89         return modules;
90     }
91     
92     public void setModules(String JavaDoc modules) {
93        setModules(modules2Vector(modules));
94     }
95     public void setModules(Vector JavaDoc modules) {
96         this.modules = modules;
97     }
98     
99     public static Vector JavaDoc modules2Vector(String JavaDoc modules){
100         Vector JavaDoc v = new Vector JavaDoc();
101         StringTokenizer JavaDoc tokenizer = new StringTokenizer JavaDoc(modules, "|");
102         while(tokenizer.hasMoreTokens()){
103             v.addElement(tokenizer.nextToken());
104         }
105         return v;
106     }
107     public void printValues(){
108         System.out.println(ucName);
109         System.out.println(ucFile);
110         System.out.println(proxyHost);
111         System.out.println(proxyPort);
112         System.out.println(modules);
113         
114     }
115 }
116
Popular Tags