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

📄 ex8_33.txt

📁 j2ee core design patterns
💻 TXT
字号:
Example 8.33 	ProjectImpl Class
// ProjectImpl.java

package com.corej2eepatterns.business.impl;

import com.corej2eepatterns.business.hr.Project;

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

public class ProjectImpl implements Project {
	String name;
	Set employees = new HashSet();

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

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

	public String getName() {
		return name;
	}

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

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

⌨️ 快捷键说明

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