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