001    /**
002     * RestaurantDescription.java
003     * jCOLIBRI2 framework. 
004     * @author Juan A. Recio-García.
005     * GAIA - Group for Artificial Intelligence Applications
006     * http://gaia.fdi.ucm.es
007     * 23/06/2007
008     */
009    package jcolibri.test.recommenders.rec7;
010    
011    import jcolibri.cbrcore.Attribute;
012    import jcolibri.cbrcore.CaseComponent;
013    import jcolibri.datatypes.Text;
014    import jcolibri.extensions.textual.IE.opennlp.IETextOpenNLP;
015    
016    /**
017     * Stores the description of a restaurant. <br>
018     * Some attributes are loaded by the connector (name, address, location, phone and description). 
019     * But the other ones are obtained (filled) by the Textual CBR methods applied to the description attribute.
020     * 
021     * @author Juan A. Recio-Garcia
022     * @author Developed at University College Cork (Ireland) in collaboration with Derek Bridge.
023     * @version 1.0
024     * @see jcolibri.extensions.textual.IE.opennlp.IETextOpenNLP
025     */
026    public class RestaurantDescription implements CaseComponent
027    {
028        String name;
029        String address;
030        String location;
031        String phone;
032        IETextOpenNLP description;
033        
034        // Extracted values from the description
035        String price;
036        String foodType;
037        String breakfastDays;
038        String lunchDays;
039        String dinnerDays;
040        String food;
041        Boolean alcohol;
042        Boolean takeout;
043        Boolean delivery;
044        Boolean parking;
045        Boolean catering;
046        
047        /* (non-Javadoc)
048         * @see jcolibri.cbrcore.CaseComponent#getIdAttribute()
049         */
050        public Attribute getIdAttribute()
051        {
052            return new Attribute("name",this.getClass());
053        }
054    
055        /**
056         * @return Returns the address.
057         */
058        public String getAddress()
059        {
060            return address;
061        }
062    
063        /**
064         * @param address The address to set.
065         */
066        public void setAddress(String address)
067        {
068            this.address = address;
069        }
070    
071        /**
072         * @return Returns the alcohol.
073         */
074        public Boolean getAlcohol()
075        {
076            return alcohol;
077        }
078    
079        /**
080         * @param alcohol The alcohol to set.
081         */
082        public void setAlcohol(Boolean alcohol)
083        {
084            this.alcohol = alcohol;
085        }
086    
087        /**
088         * @return Returns the breakfastDays.
089         */
090        public String getBreakfastDays()
091        {
092            return breakfastDays;
093        }
094    
095        /**
096         * @param breakfastDays The breakfastDays to set.
097         */
098        public void setBreakfastDays(String breakfastDays)
099        {
100            this.breakfastDays = breakfastDays;
101        }
102    
103        /**
104         * @return Returns the catering.
105         */
106        public Boolean getCatering()
107        {
108            return catering;
109        }
110    
111        /**
112         * @param catering The catering to set.
113         */
114        public void setCatering(Boolean catering)
115        {
116            this.catering = catering;
117        }
118    
119        /**
120         * @return Returns the delivery.
121         */
122        public Boolean getDelivery()
123        {
124            return delivery;
125        }
126    
127        /**
128         * @param delivery The delivery to set.
129         */
130        public void setDelivery(Boolean delivery)
131        {
132            this.delivery = delivery;
133        }
134    
135        /**
136         * @return Returns the description.
137         */
138        public Text getDescription()
139        {
140            return description;
141        }
142    
143        /**
144         * @param description The description to set.
145         */
146        public void setDescription(Text description)
147        {
148            if(description == null)
149                this.description = null;
150            else
151                this.description = new IETextOpenNLP(description.toString());
152        }
153        
154    
155    
156        /**
157         * @return Returns the dinnerDays.
158         */
159        public String getDinnerDays()
160        {
161            return dinnerDays;
162        }
163    
164        /**
165         * @param dinnerDays The dinnerDays to set.
166         */
167        public void setDinnerDays(String dinnerDays)
168        {
169            this.dinnerDays = dinnerDays;
170        }
171    
172        /**
173         * @return Returns the food.
174         */
175        public String getFood()
176        {
177            return food;
178        }
179    
180        /**
181         * @param food The food to set.
182         */
183        public void setFood(String food)
184        {
185            this.food = food;
186        }
187    
188        /**
189         * @return Returns the foodType.
190         */
191        public String getFoodType()
192        {
193            return foodType;
194        }
195    
196        /**
197         * @param foodType The foodType to set.
198         */
199        public void setFoodType(String foodType)
200        {
201            this.foodType = foodType;
202        }
203    
204        /**
205         * @return Returns the location.
206         */
207        public String getLocation()
208        {
209            return location;
210        }
211    
212        /**
213         * @param location The location to set.
214         */
215        public void setLocation(String location)
216        {
217            this.location = location;
218        }
219    
220        /**
221         * @return Returns the lunchDays.
222         */
223        public String getLunchDays()
224        {
225            return lunchDays;
226        }
227    
228        /**
229         * @param lunchDays The lunchDays to set.
230         */
231        public void setLunchDays(String lunchDays)
232        {
233            this.lunchDays = lunchDays;
234        }
235    
236        /**
237         * @return Returns the name.
238         */
239        public String getName()
240        {
241            return name;
242        }
243    
244        /**
245         * @param name The name to set.
246         */
247        public void setName(String name)
248        {
249            this.name = name;
250        }
251    
252        /**
253         * @return Returns the parking.
254         */
255        public Boolean getParking()
256        {
257            return parking;
258        }
259    
260        /**
261         * @param parking The parking to set.
262         */
263        public void setParking(Boolean parking)
264        {
265            this.parking = parking;
266        }
267    
268        /**
269         * @return Returns the phone.
270         */
271        public String getPhone()
272        {
273            return phone;
274        }
275    
276        /**
277         * @param phone The phone to set.
278         */
279        public void setPhone(String phone)
280        {
281            this.phone = phone;
282        }
283    
284        /**
285         * @return Returns the price.
286         */
287        public String getPrice()
288        {
289            return price;
290        }
291    
292        /**
293         * @param price The price to set.
294         */
295        public void setPrice(String price)
296        {
297            this.price = price;
298        }
299    
300        /**
301         * @return Returns the takeout.
302         */
303        public Boolean getTakeout()
304        {
305            return takeout;
306        }
307    
308        /**
309         * @param takeout The takeout to set.
310         */
311        public void setTakeout(Boolean takeout)
312        {
313            this.takeout = takeout;
314        }
315    
316        public String toString()
317        {
318            StringBuffer sb = new StringBuffer();
319            sb.append(this.name);
320            sb.append(", ");
321            sb.append(this.address);
322            sb.append(", ");
323            sb.append(this.location);
324            sb.append(", ");
325            sb.append(this.phone);
326            sb.append(",");
327            sb.append(this.description);
328            
329            return sb.toString();
330        }
331        
332    }