register.java
来自「某本RUP经典书籍的示例工程的部分代码实现,内含有一个Junit测试用例」· Java 代码 · 共 28 行
JAVA
28 行
package com.foo.nextgen.domain;
public class Register {
private ProductCatalog catalog;
private Sale currentSale;
public Register(ProductCatalog catalog)
{
this.catalog = catalog;
}
public void endSale()
{
currentSale.becomeComplete();
}
public void enterItem(ItemID id,int quantity)
{
ProductDescription desc = catalog.getProductDescription(id);
currentSale.makeLineItem(desc,quantity);
}
public void makeNewSale()
{
currentSale = new Sale();
}
public void makePayment(Money cashTendered)
{
currentSale.makePayment(cashTendered);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?