Created
July 30, 2012 19:44
-
-
Save jayanath/3209525 to your computer and use it in GitHub Desktop.
Room
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Room { | |
//this annotation helps spring to identify the constructor | |
//argument names when we compile the classes without debug | |
//enabled | |
@ConstructorProperties({"roomType"}) | |
public Room(String roomType) { | |
this.roomType = roomType; | |
} | |
public double calculateRoomCharge() { | |
double total = 0; | |
for (Service service : serviceList) { | |
total = total + service.calculateServiceCharge(); | |
} | |
return total; | |
} | |
public List<String> getUsedServiceNames() { | |
List<String> names = new ArrayList<String>(); | |
for (Service service : serviceList) { | |
names.add(service.printServiceInfo()); | |
} | |
return names; | |
} | |
public void setServiceList(List<Service> serviceList) { | |
this.serviceList = serviceList; | |
} | |
public String getRoomType() { | |
return roomType; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment