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

📄 ex8_37.txt

📁 j2ee core design patterns
💻 TXT
字号:
Example 8.37 	DepartmentImpl Class
// DepartmentImpl.java
package com.corej2eepatterns.business.impl;

import com.corej2eepatterns.business.hr.Department;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * @author  Craig Russell
 */
public class DepartmentImpl implements Department {

	String name;
	Set employees = new HashSet();

	/** Creates a new instance of DepartmentImpl */
	DepartmentImpl(String name) {
		this.name = name;
	}

	public Set getEmployees() {
		return Collections.unmodifiableSet(employees);
	}

	boolean addEmployee(EmployeeImpl employee) {
		return employees.add(employee);
	}

	boolean removeEmployee(EmployeeImpl employee) {
		return employees.remove(employee);
	}

	public String getName() {
		return name;
	}
}

⌨️ 快捷键说明

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