KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > examples > listexample > SimpleCountry


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.examples.listexample;
17
18 import java.io.Serializable JavaDoc;
19 import java.math.BigDecimal JavaDoc;
20 import java.util.List JavaDoc;
21 import java.util.Arrays JavaDoc;
22 import java.util.Collections JavaDoc;
23
24 /**
25  * DOCUMENT ME!
26  * @author Thomas Spiegl (latest modification by $Author: matzew $)
27  * @version $Revision: 1.1 $ $Date: 2005/03/24 16:47:10 $
28  */

29 public class SimpleCountry
30         implements Serializable JavaDoc
31 {
32     private long _id;
33     private String JavaDoc _name;
34     private String JavaDoc _isoCode;
35     private BigDecimal JavaDoc _size;
36     private boolean _remove = false;
37     private List JavaDoc _cities;
38
39     public SimpleCountry(long id, String JavaDoc name, String JavaDoc isoCode, BigDecimal JavaDoc size, String JavaDoc[] cities)
40     {
41         _id = id;
42         _name = name;
43         _isoCode = isoCode;
44         _size = size;
45
46         if(cities!=null)
47             _cities = Arrays.asList(cities);
48         else
49             _cities = Collections.EMPTY_LIST;
50     }
51
52     public long getId()
53     {
54         return _id;
55     }
56
57     public String JavaDoc getName()
58     {
59         return _name;
60     }
61
62     public String JavaDoc getIsoCode()
63     {
64         return _isoCode;
65     }
66
67     public BigDecimal JavaDoc getSize()
68     {
69         return _size;
70     }
71
72     public List JavaDoc getCities()
73     {
74         return _cities;
75     }
76
77     public void setId(long id)
78     {
79         _id = id;
80     }
81
82     public void setIsoCode(String JavaDoc isoCode)
83     {
84         _isoCode = isoCode;
85     }
86
87     public void setName(String JavaDoc name)
88     {
89         _name = name;
90     }
91
92     public void setSize(BigDecimal JavaDoc size)
93     {
94         _size = size;
95     }
96
97     public boolean isRemove()
98     {
99         return _remove;
100     }
101
102     public void setRemove(boolean remove)
103     {
104         _remove = remove;
105     }
106 }
107
Popular Tags