/** * Gets the set of Participants the ultimately report to the Position passed * * @param manager the 'manager' Position * @return the set of Particpants 'managed' by this Position */ public Set<Participant> getParticipantsReportingToPosition(Position manager) { Set<Participant> result = new HashSet<Participant>(); Set<Position> posSet = getPositions(); for (Position pos : posSet) { if (pos.ultimatelyReportsTo(manager)) { result.addAll(castToParticipantSet(pos.getResources())); } } return result; }
/** * Gets the immediate supervisor of a participant. If the participant holds multiple positions, * and therefore has multiple supervisors, one is returned as a random selection. * * @param p the participant to get the supervisor of * @return the Participant who is the supervisor of the pid passed, or null if there is no * supervisor. */ public Participant getImmediateSupervisor(Participant p) { if (p != null) { for (Position position : p.getPositions()) { Position superPosition = position.getReportsTo(); if (superPosition != null) { Set<AbstractResource> resources = superPosition.getResources(); if (!resources.isEmpty()) { return (Participant) resources.iterator().next(); } } } } return null; }
public Set<Participant> getPositionParticipants(String pid) { Position p = positionMap.get(pid); return (p != null) ? castToParticipantSet(p.getResources()) : null; }