⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 productcatalog.java

📁 某本RUP经典书籍的示例工程的部分代码实现,内含有一个Junit测试用例
💻 JAVA
字号:
package com.foo.nextgen.domain;
import java.util.HashMap;
import java.util.Map;
public class ProductCatalog {
	private Map<ItemID,ProductDescription>
	        descriptions = new HashMap<ItemID,ProductDescription>();
	public ProductCatalog()
	{
		ItemID id1=new ItemID(100);
		ItemID id2=new ItemID(200);
		Money price=new Money(3);
		 
		ProductDescription desc;
		desc = new ProductDescription(id1,price,"product 1");
		descriptions.put(id1,desc);
		desc = new ProductDescription(id2,price,"product 2");
		descriptions.put(id2,desc);		
	}
	public ProductDescription getProductDescription(ItemID id)
	{
		return descriptions.get(id);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -