KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > test > Manager


1
2 package com.triactive.jdo.test;
3
4 import java.util.Collection JavaDoc;
5 import java.util.HashSet JavaDoc;
6 import java.util.Set JavaDoc;
7
8 public class Manager extends Employee
9 {
10   public Set JavaDoc subordinates;
11   public Set JavaDoc departments;
12 // String department;
13

14   /**
15    * Default constructor required since this is a PersistenceCapable class.
16    */

17   protected Manager() {}
18
19   public Manager(long id, String JavaDoc firstname, String JavaDoc lastname, String JavaDoc email,
20                  float salary, String JavaDoc serial )
21   {
22       super(id, firstname, lastname, email, salary, serial);
23 // this.department = dept;
24
this.departments = new HashSet JavaDoc();
25       this.subordinates = new HashSet JavaDoc();
26   }
27
28   public Set JavaDoc 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 JavaDoc c)
39   {
40     this.subordinates.addAll(c);
41   }
42
43   public Set JavaDoc 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