KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > xml > querying > impl > xtas > City


1 package org.exoplatform.services.xml.querying.impl.xtas;
2
3 import java.util.ArrayList JavaDoc;
4
5
6 public class City
7 {
8   private String JavaDoc name;
9   private String JavaDoc country;
10   private String JavaDoc zip;
11   private ArrayList JavaDoc streets;
12
13   public City()
14   {
15     streets = new ArrayList JavaDoc();
16   }
17
18   public City(String JavaDoc country, String JavaDoc name, String JavaDoc zip)
19   {
20      this();
21      this.name = name;
22      this.country = country;
23      this.zip = zip;
24      this.streets.add(new Street("One", new Integer JavaDoc(100)));
25      this.streets.add(new Street("Two", new Integer JavaDoc(200)));
26      this.streets.add(new Street("Three", new Integer JavaDoc(300)));
27   }
28
29   public ArrayList JavaDoc getStreets(){
30
31        return streets;
32   }
33
34   public String JavaDoc getName() {
35     return name;}
36
37   /**
38    * @return void
39 * Sets the value of the city property.
40 *
41 * @param aCity the new value of the city property
42    */

43   public void setName(String JavaDoc aName) {
44     name = aName;}
45
46   /**
47 * Access method for the country property.
48 *
49 * @return the current value of the country property
50    */

51   public String JavaDoc getCountry() {
52     return country;}
53
54   /**
55    * @return void
56 * Sets the value of the country property.
57 *
58 * @param aCountry the new value of the country property
59    */

60   public void setCountry(String JavaDoc aCountry) {
61     country = aCountry;}
62
63   public String JavaDoc getZip() {
64     return zip;}
65
66   public void setZip(String JavaDoc aZip) {
67     zip = aZip;}
68
69
70     public String JavaDoc toString()
71     {
72       return name+","+country+","+zip;
73     }
74
75 }
76
Popular Tags