001: package org.apache.lucene.swing.models;
002:
003: /**
004: * Copyright 2005 The Apache Software Foundation
005: *
006: * Licensed under the Apache License, Version 2.0 (the "License");
007: * you may not use this file except in compliance with the License.
008: * You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */
018:
019: import java.util.ArrayList;
020: import java.util.Collection;
021: import java.util.Iterator;
022:
023: /**
024: * @author Jonathan Simon - jonathan_s_simon@yahoo.com
025: */
026: public class DataStore {
027:
028: private static final String ITALIAN_CATEGORY = "Italian";
029: private static final String CUBAN_CATEGORY = "Cuban";
030: private static final String STEAK_CATEGORY = "Steak";
031: private static int id = 0;
032:
033: static Collection restaurants = new ArrayList();
034: static RestaurantInfo pinos = new RestaurantInfo();
035: static RestaurantInfo canolis = new RestaurantInfo();
036: static RestaurantInfo picadillo = new RestaurantInfo();
037: static RestaurantInfo versailles = new RestaurantInfo();
038: static RestaurantInfo laCaretta = new RestaurantInfo();
039: static RestaurantInfo laCaretta2 = new RestaurantInfo();
040: static RestaurantInfo laCaretta3 = new RestaurantInfo();
041: static RestaurantInfo ranchaLuna = new RestaurantInfo();
042: static RestaurantInfo leMerais = new RestaurantInfo();
043: static RestaurantInfo chris = new RestaurantInfo();
044: static RestaurantInfo outback = new RestaurantInfo();
045: static RestaurantInfo outback2 = new RestaurantInfo();
046: static RestaurantInfo outback3 = new RestaurantInfo();
047: static RestaurantInfo outback4 = new RestaurantInfo();
048:
049: public static Iterator getRestaurants() {
050: return restaurants.iterator();
051: }
052:
053: static {
054: pinos.setId(getNextId());
055: pinos.setType(ITALIAN_CATEGORY);
056: pinos.setName("Pino's");
057: pinos.setPhone("(305) 111-2222");
058: pinos.setStreet("12115 105th Street ");
059: pinos.setCity("Miami");
060: pinos.setState("FL");
061: pinos.setZip("33176");
062: restaurants.add(pinos);
063:
064: canolis.setId(getNextId());
065: canolis.setType(ITALIAN_CATEGORY);
066: canolis.setName("Canoli's");
067: canolis.setPhone("(305) 234-5543");
068: canolis.setStreet("12123 85th Street ");
069: canolis.setCity("Miami");
070: canolis.setState("FL");
071: canolis.setZip("33176");
072: restaurants.add(canolis);
073:
074: picadillo.setId(getNextId());
075: picadillo.setType(CUBAN_CATEGORY);
076: picadillo.setName("Picadillo");
077: picadillo.setPhone("(305) 746-7865");
078: picadillo.setStreet("109 12th Street ");
079: picadillo.setCity("Miami");
080: picadillo.setState("FL");
081: picadillo.setZip("33176");
082: restaurants.add(picadillo);
083:
084: versailles.setId(getNextId());
085: versailles.setType(CUBAN_CATEGORY);
086: versailles.setName("Cafe Versailles");
087: versailles.setPhone("(305) 201-5438");
088: versailles.setStreet("312 8th Street ");
089: versailles.setCity("Miami");
090: versailles.setState("FL");
091: versailles.setZip("33176");
092: restaurants.add(versailles);
093:
094: laCaretta.setId(getNextId());
095: laCaretta.setType(CUBAN_CATEGORY);
096: laCaretta.setName("La Carretta");
097: laCaretta.setPhone("(305) 342-9876");
098: laCaretta.setStreet("348 8th Street ");
099: laCaretta.setCity("Miami");
100: laCaretta.setState("FL");
101: laCaretta.setZip("33176");
102: restaurants.add(laCaretta);
103:
104: laCaretta2.setId(getNextId());
105: laCaretta2.setType(CUBAN_CATEGORY);
106: laCaretta2.setName("La Carretta");
107: laCaretta2.setPhone("(305) 556-9876");
108: laCaretta2.setStreet("31224 23rd Street ");
109: laCaretta2.setCity("Miami");
110: laCaretta2.setState("FL");
111: laCaretta2.setZip("33176");
112: restaurants.add(laCaretta2);
113:
114: laCaretta3.setId(getNextId());
115: laCaretta3.setType(CUBAN_CATEGORY);
116: laCaretta3.setName("La Carretta");
117: laCaretta3.setPhone("(305) 682-9876");
118: laCaretta3.setStreet("23543 107th Street ");
119: laCaretta3.setCity("Miami");
120: laCaretta3.setState("FL");
121: laCaretta3.setZip("33176");
122: restaurants.add(laCaretta3);
123:
124: ranchaLuna.setId(getNextId());
125: ranchaLuna.setType(CUBAN_CATEGORY);
126: ranchaLuna.setName("Rancha Luna");
127: ranchaLuna.setPhone("(305) 777-4384");
128: ranchaLuna.setStreet("110 23rd Street ");
129: ranchaLuna.setCity("Miami");
130: ranchaLuna.setState("FL");
131: ranchaLuna.setZip("33176");
132: restaurants.add(ranchaLuna);
133:
134: leMerais.setId(getNextId());
135: leMerais.setType(STEAK_CATEGORY);
136: leMerais.setName("Le Merais");
137: leMerais.setPhone("(212) 654-9187");
138: leMerais.setStreet("11 West 46th Street");
139: leMerais.setCity("New York");
140: leMerais.setState("NY");
141: leMerais.setZip("10018");
142: restaurants.add(leMerais);
143:
144: chris.setId(getNextId());
145: chris.setType(STEAK_CATEGORY);
146: chris.setName("Ruth's Chris Seakhouse");
147: chris.setPhone("(305) 354-8885");
148: chris.setStreet("12365 203rd Street ");
149: chris.setCity("Miami");
150: chris.setState("FL");
151: chris.setZip("33176");
152: restaurants.add(chris);
153:
154: outback.setId(getNextId());
155: outback.setType(STEAK_CATEGORY);
156: outback.setName("Outback");
157: outback.setPhone("(305) 244-7623");
158: outback.setStreet("348 136th Street ");
159: outback.setCity("Miami");
160: outback.setState("FL");
161: outback.setZip("33176");
162: restaurants.add(outback);
163:
164: outback2.setId(getNextId());
165: outback2.setType(STEAK_CATEGORY);
166: outback2.setName("Outback");
167: outback2.setPhone("(305) 533-6522");
168: outback2.setStreet("21 207th Street ");
169: outback2.setCity("Miami");
170: outback2.setState("FL");
171: outback2.setZip("33176");
172: restaurants.add(outback2);
173:
174: outback3.setId(getNextId());
175: outback3.setType(STEAK_CATEGORY);
176: outback3.setName("Outback");
177: outback3.setPhone("(305) 244-7623");
178: outback3.setStreet("10117 107th Street ");
179: outback3.setCity("Miami");
180: outback3.setState("FL");
181: outback3.setZip("33176");
182: restaurants.add(outback3);
183:
184: outback4.setId(getNextId());
185: outback4.setType(STEAK_CATEGORY);
186: outback4.setName("Outback");
187: outback4.setPhone("(954) 221-3312");
188: outback4.setStreet("10 11th Street ");
189: outback4.setCity("Aventura");
190: outback4.setState("FL");
191: outback4.setZip("32154");
192: restaurants.add(outback4);
193:
194: }
195:
196: private static int getNextId() {
197: id++;
198: return id;
199: }
200:
201: }
|