日期:2014-05-20 浏览次数:20703 次
public class Restaurant{ private String name; private Map<String, Table> tables; private Map<String, WaitingList> waitingLists; private List<Server> servers; setter....//the set method of class's vars getter....//the get method of class's vars } public class Party{ private String uniqueName; private int numberOfCustomer; setter... getter... /**determine if equals between two Party at same time**/ public boolean equals(){ } public String toString(){ } } public class Table{ private static int count = 0; private int number = count++; private int size; private boolean isFree = true; setter of size... public String toString(){ } } public class Servers{ private List<Server> servers; /**generate a server and add to the list**/ public Server genServer(){ } /**assign server to the party**/ public void assignServer(){ } } public class Server{ private static int count = 0; private int id = count++; } public class Utility{ public void tableToParty(){ } public void serverToParty(){ } }
------解决方案--------------------
我先把他的内容给你翻译一下吧:
1:设计Time这个类,要求:能反映一天的一个具体的时间,比如,下午12:30或者上午9:47
在文档里那,你必须给出鲜明的声明来作为描述。这个类包括以下的方法:
Method1:
Time(hour,minute,PM),要求:传递参数hour和minute然后来判断一下它是上午那还是下午,上午AM返回false,下午PM返回ture
Method2:
fromString(str),要求:这是一个静态的(static)方法,它接收一个字符串,例如12:03
.
.
.
.
您截图截得的不全,请提供完整的图片