001: /***
002: * Julia: France Telecom's implementation of the Fractal API
003: * Copyright (C) 2001-2004 France Telecom R&D
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *
019: * Contact: sebastien.chassandebarrioz@rd.francetelecom.com
020: *
021: * Author: S.Chassande-Barrioz
022: */package org.objectweb.speedo.pobjects.collection;
023:
024: import java.util.Collection;
025: import java.util.Iterator;
026: import java.util.ArrayList;
027:
028: public class Employee {
029:
030: public String name;
031:
032: public Employee boss;
033:
034: public Collection ints;
035:
036: public Collection friends;
037:
038: public Employee() {
039: }
040:
041: public Employee(String name) {
042: this .name = name;
043: this .ints = new ArrayList();
044: this .friends = new ArrayList();
045: }
046:
047: public Employee(String name, Employee boss) {
048: this .name = name;
049: this .boss = boss;
050: this .ints = new ArrayList();
051: this .friends = new ArrayList();
052: }
053:
054: public Employee getBoss() {
055: return boss;
056: }
057:
058: public void setBoss(Employee boss) {
059: this .boss = boss;
060: }
061:
062: public String getName() {
063: return name;
064: }
065:
066: public void setName(String name) {
067: this .name = name;
068: }
069:
070: public Iterator getInts() {
071: return ints.iterator();
072: }
073:
074: public Collection getIntsCol() {
075: return ints;
076: }
077:
078: public void addInt(int i) {
079: ints.add(new Integer(i));
080: }
081:
082: public void setInts(Collection ints) {
083: this .ints = ints;
084: }
085:
086: public void removeInt(int i) {
087: ints.remove(new Integer(i));
088: }
089:
090: public Iterator getFriends() {
091: return friends.iterator();
092: }
093:
094: public Collection getFriendsCol() {
095: return friends;
096: }
097:
098: public void setFriends(Collection friends) {
099: this .friends = friends;
100: }
101:
102: public void addFriend(Employee friend) {
103: friends.add(friend);
104: }
105:
106: public void removeFriend(Employee friend) {
107: friends.remove(friend);
108: }
109:
110: public String toString() {
111: return name;
112: }
113: }
|