1 2 package com.triactive.jdo.test; 3 4 import java.util.Collection ; 5 import java.util.HashSet ; 6 import java.util.Set ; 7 8 public class Manager extends Employee 9 { 10 public Set subordinates; 11 public Set departments; 12 14 17 protected Manager() {} 18 19 public Manager(long id, String firstname, String lastname, String email, 20 float salary, String serial ) 21 { 22 super(id, firstname, lastname, email, salary, serial); 23 this.departments = new HashSet (); 25 this.subordinates = new HashSet (); 26 } 27 28 public Set getSubordinates() 29 { 30 return this.subordinates; 31 } 32 33 public void addSubordinate(Employee e) 34 { 35 this.subordinates.add(e); 36 } 37 38 public void addSubordinates(Collection c) 39 { 40 this.subordinates.addAll(c); 41 } 42 43 public Set getDepartments() 44 { 45 return this.departments; 46 } 47 48 public void addDepartment(Department d) 49 { 50 this.departments.add(d); 51 } 52 53 public void removeDepartment(Department d) 54 { 55 this.departments.remove(d); 56 } 57 58 } 59 | Popular Tags |