package tripvisModel { public class CostsPerDayItem { private var _day: Date; private var _landmarkCost: MoneyAmount; private var _restaurantCost: MoneyAmount; private var _hotelCost: MoneyAmount; public function CostsPerDayItem(day: Date) { _day = day; _landmarkCost = new MoneyAmount(); _restaurantCost = new MoneyAmount(); _hotelCost = new MoneyAmount(); } public function hasAsDay(anotherDay: Date): Boolean { if ( this.day.date != anotherDay.date ) return false; if ( this.day.month != anotherDay.month ) return false; if ( this.day.fullYear != anotherDay.fullYear ) return false; return true; } public function equals(item: CostsPerDayItem): Boolean { if ( !this.hasAsDay(item.day) ) return false; if ( !this.landmarkCost.equals(item.landmarkCost) ) return false; if ( !this.restaurantCost.equals(item.restaurantCost) ) return false; if ( !this.hotelCost.equals(item.hotelCost) ) return false; return true; } // Getters: public function get day(): Date { return _day; } public function get landmarkCost(): MoneyAmount { return _landmarkCost; } public function get restaurantCost(): MoneyAmount { return _restaurantCost; } public function get hotelCost(): MoneyAmount { return _hotelCost; } // Setters public function set landmarkCost(value: MoneyAmount): void { _landmarkCost = value; } public function set restaurantCost(value: MoneyAmount): void { _restaurantCost = value; } public function set hotelCost(value: MoneyAmount): void { _hotelCost = value; } } }