001/** 002 * TravelDescription.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 * 10/01/2007 008 */ 009package es.ucm.fdi.gaia.jcolibri.test.test4; 010 011import es.ucm.fdi.gaia.jcolibri.cbrcore.Attribute; 012 013 014/** 015 * Bean that stores the description of the case. 016 * This version includes a compound attribute to store the region. 017 * @author Juan A. Recio-Garcia 018 * @version 1.0 019 * @see es.ucm.fdi.gaia.jcolibri.test.test4.Region 020 */ 021public class TravelDescription implements es.ucm.fdi.gaia.jcolibri.cbrcore.CaseComponent { 022 023 public enum AccommodationTypes { OneStar, TwoStars, ThreeStars, HolidayFlat, FourStars, FiveStars}; 024 025 String caseId; 026 String HolidayType; 027 Integer NumberOfPersons; 028 Region Region; 029 String Transportation; 030 Integer Duration; 031 String Season; 032 AccommodationTypes Accommodation; 033 034 035 public String toString() 036 { 037 return "("+caseId+";"+HolidayType+";"+NumberOfPersons+";"+Region+";"+Transportation+";"+Duration+";"+Season+";"+Accommodation+")"; 038 } 039 040 /** 041 * @return the accomodation 042 */ 043 public AccommodationTypes getAccommodation() { 044 return Accommodation; 045 } 046 /** 047 * @param accomodation the accomodation to set 048 */ 049 public void setAccommodation(AccommodationTypes accomodation) { 050 Accommodation = accomodation; 051 } 052 /** 053 * @return the caseId 054 */ 055 public String getCaseId() { 056 return caseId; 057 } 058 /** 059 * @param caseId the caseId to set 060 */ 061 public void setCaseId(String caseId) { 062 this.caseId = caseId; 063 } 064 /** 065 * @return the duration 066 */ 067 public Integer getDuration() { 068 return Duration; 069 } 070 /** 071 * @param duration the duration to set 072 */ 073 public void setDuration(Integer duration) { 074 Duration = duration; 075 } 076 /** 077 * @return the holidayType 078 */ 079 public String getHolidayType() { 080 return HolidayType; 081 } 082 /** 083 * @param holidayType the holidayType to set 084 */ 085 public void setHolidayType(String holidayType) { 086 HolidayType = holidayType; 087 } 088 /** 089 * @return the numberOfPersons 090 */ 091 public Integer getNumberOfPersons() { 092 return NumberOfPersons; 093 } 094 /** 095 * @param numberOfPersons the numberOfPersons to set 096 */ 097 public void setNumberOfPersons(Integer numberOfPersons) { 098 NumberOfPersons = numberOfPersons; 099 } 100 101 /** 102 * @return the region 103 */ 104 public Region getRegion() { 105 return Region; 106 } 107 /** 108 * @param region the region to set 109 */ 110 public void setRegion(Region region) { 111 Region = region; 112 } 113 /** 114 * @return the season 115 */ 116 public String getSeason() { 117 return Season; 118 } 119 /** 120 * @param season the season to set 121 */ 122 public void setSeason(String season) { 123 Season = season; 124 } 125 /** 126 * @return the transportation 127 */ 128 public String getTransportation() { 129 return Transportation; 130 } 131 /** 132 * @param transportation the transportation to set 133 */ 134 public void setTransportation(String transportation) { 135 Transportation = transportation; 136 } 137 138 public static void main(String[] args) { 139 TravelDescription t = new TravelDescription(); 140 t.setAccommodation(AccommodationTypes.ThreeStars); 141 Attribute at = new Attribute("Accommodation", TravelDescription.class); 142 try { 143 System.out.println(at.getValue(t)); 144 } catch (Exception e) { 145 e.printStackTrace(); 146 } 147 } 148 149 public Attribute getIdAttribute() { 150 return new Attribute("caseId", this.getClass()); 151 } 152}