1 23 24 package org.objectweb.speedo.pobjects.collection; 25 26 import java.util.Collection ; 27 import java.util.Iterator ; 28 import java.util.ArrayList ; 29 30 public class Employee { 31 32 public String name; 33 34 public Employee boss; 35 36 public Collection ints; 37 38 public Collection friends; 39 40 public Employee () { 41 } 42 43 public Employee (String name) { 44 this.name = name; 45 this.ints = new ArrayList (); 46 this.friends = new ArrayList (); 47 } 48 49 public Employee (String name, Employee boss) { 50 this.name = name; 51 this.boss = boss; 52 this.ints = new ArrayList (); 53 this.friends = new ArrayList (); 54 } 55 56 57 public Employee getBoss() { 58 return boss; 59 } 60 public void setBoss(Employee boss) { 61 this.boss = boss; 62 } 63 public String getName() { 64 return name; 65 } 66 public void setName(String name) { 67 this.name = name; 68 } 69 public Iterator getInts () { 70 return ints.iterator(); 71 } 72 public Collection getIntsCol() { 73 return ints; 74 } 75 76 public void addInt (int i) { 77 ints.add(new Integer (i)); 78 } 79 80 public void setInts(Collection ints) { 81 this.ints = ints; 82 } 83 84 public void removeInt (int i) { 85 ints.remove(new Integer (i)); 86 } 87 88 public Iterator getFriends () { 89 return friends.iterator(); 90 } 91 92 public Collection getFriendsCol() { 93 return friends; 94 } 95 96 public void setFriends (Collection friends) { 97 this.friends = friends; 98 } 99 100 public void addFriend (Employee friend) { 101 friends.add(friend); 102 } 103 104 public void removeFriend (Employee friend) { 105 friends.remove(friend); 106 } 107 108 public String toString() { 109 return name; 110 } 111 } 112 | Popular Tags |