KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > betwixt > MapBean


1 /*
2  * Copyright 2001-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  
17 package org.apache.commons.betwixt;
18
19 import java.util.Map JavaDoc;
20 import java.util.TreeMap JavaDoc;
21
22 /** <p><code>MapBean</code> is a sample bean used for testing maps.</p>
23   *
24   * @author <a HREF="mailto:rdonkin@apache.org">Robert Burrell Donkin</a>
25   * @version $Revision: 1.5 $
26   */

27 public class MapBean {
28     
29     private String JavaDoc title = "**UNSET**";
30     
31     private Map JavaDoc addresses = new TreeMap JavaDoc();
32     
33     public MapBean() {}
34     
35     public MapBean(String JavaDoc title) {
36         setTitle(title);
37     }
38     
39     public String JavaDoc getTitle() {
40         return title;
41     }
42     
43     public void setTitle(String JavaDoc title) {
44         this.title = title;
45     }
46     
47     public Map JavaDoc getAddresses() {
48         return addresses;
49     }
50     
51     public void addAddress(String JavaDoc name, AddressBean address) {
52         addresses.put(name, address);
53     }
54 }
55
Popular Tags