public String getNonHumanResourceNames() {
   XNode node = new XNode("nonHumanResourceNames");
   for (NonHumanResource r : nonHumanMap.values()) {
     node.addChild("name", r.getName());
   }
   return node.toString();
 }
 public Set<NonHumanSubCategory> getNonHumanSubCategories() {
   Set<NonHumanSubCategory> set = new HashSet<NonHumanSubCategory>();
   for (NonHumanCategory c : nonHumanCategoryMap.values()) {
     set.addAll(c.getSubCategories());
   }
   return set;
 }
 public Set<Participant> getOrgGroupMembers(OrgGroup o) {
   Set<Participant> result = new HashSet<Participant>();
   for (Participant p : participantMap.values()) {
     if (p.isOrgGroupMember(o)) result.add(p);
   }
   return result;
 }
 public String getNonHumanCategoryNames() {
   XNode node = new XNode("nonHumanCategoryNames");
   for (NonHumanCategory r : nonHumanCategoryMap.values()) {
     node.addChild("name", r.getName());
   }
   return node.toString();
 }
 public long getLastChangeStamp() {
   long lastChange = 0;
   for (Long stamp : _changeStamp.values()) {
     if (stamp > lastChange) lastChange = stamp;
   }
   return lastChange;
 }
 public Capability getCapabilityByLabel(String label) {
   for (Capability c : capabilityMap.values()) {
     if (c.getCapability().equals(label)) {
       return c;
     }
   }
   return null;
 }
 // @return a csv listing of the full name of each role
 public String getRoleNames() {
   StringBuilder csvList = new StringBuilder();
   for (Role r : roleMap.values()) {
     if (csvList.length() > 0) csvList.append(",");
     csvList.append(r.getName());
   }
   return csvList.toString();
 }
 public Position getPositionByLabel(String label) {
   for (Position p : positionMap.values()) {
     if (p.getTitle().equals(label)) {
       return p;
     }
   }
   return null;
 }
  public String getNonHumanCategoriesAsXML() {
    Set<NonHumanCategory> rList = new TreeSet<NonHumanCategory>(nonHumanCategoryMap.values());

    StringBuilder xml = new StringBuilder("<nonhumancategories>");
    for (NonHumanCategory r : rList) xml.append(r.toXML());
    xml.append("</nonhumancategories>");
    return xml.toString();
  }
  public String getNonHumanResourcesAsXML() {
    Set<NonHumanResource> rList = new TreeSet<NonHumanResource>(nonHumanMap.values());

    StringBuilder xml = new StringBuilder("<nonhumanresources>");
    for (NonHumanResource r : rList) xml.append(r.toXML());
    xml.append("</nonhumanresources>");
    return xml.toString();
  }
 public OrgGroup getOrgGroupByLabel(String label) {
   for (OrgGroup o : orgGroupMap.values()) {
     if (o.getGroupName().equals(label)) {
       return o;
     }
   }
   return null;
 }
  public String getOrgGroupsAsXML() {
    ArrayList<OrgGroup> oList = new ArrayList<OrgGroup>(orgGroupMap.values());
    Collections.sort(oList);

    StringBuilder xml = new StringBuilder("<orggroups>");
    for (OrgGroup o : oList) xml.append(o.toXML());
    xml.append("</orggroups>");
    return xml.toString();
  }
  public String getRolesAsXML() {
    ArrayList<Role> rList = new ArrayList<Role>(roleMap.values());
    Collections.sort(rList);

    StringBuilder xml = new StringBuilder("<roles>");
    for (Role r : rList) xml.append(r.toXML());
    xml.append("</roles>");
    return xml.toString();
  }
  public String getCapabilitiesAsXML() {
    ArrayList<Capability> cList = new ArrayList<Capability>(capabilityMap.values());
    Collections.sort(cList);

    StringBuilder xml = new StringBuilder("<capabilities>");
    for (Capability c : cList) xml.append(c.toXML());
    xml.append("</capabilities>");
    return xml.toString();
  }
  public String getPositionsAsXML() {
    ArrayList<Position> pList = new ArrayList<Position>(positionMap.values());
    Collections.sort(pList);

    StringBuilder xml = new StringBuilder("<positions>");
    for (Position p : pList) xml.append(p.toXML());
    xml.append("</positions>");
    return xml.toString();
  }
 public String getNonHumanCategorySet() {
   XNode node = new XNode("nonHumanCategorySet");
   for (NonHumanCategory category : nonHumanCategoryMap.values()) {
     XNode categoryNode = node.addChild("category");
     categoryNode.addAttribute("name", category.getName());
     for (String subcategory : category.getSubCategoryNames()) {
       categoryNode.addChild("subcategory", subcategory);
     }
   }
   return node.toString();
 }
 public Role getRoleByName(String roleName) {
   for (Role r : roleMap.values()) {
     if (r.getName().equalsIgnoreCase(roleName)) return r;
   }
   return null; // no match
 }
 private List<Participant> sortFullParticipantListByName() {
   ArrayList<Participant> pList = new ArrayList<Participant>(participantMap.values());
   Collections.sort(pList, new ParticipantNameComparator());
   return pList;
 }
 public Set<NonHumanCategory> getNonHumanCategories() {
   return new HashSet<NonHumanCategory>(nonHumanCategoryMap.values());
 }
 public Set<NonHumanResource> getNonHumanResources() {
   return new HashSet<NonHumanResource>(nonHumanMap.values());
 }
 public Set<Capability> getCapabilities() {
   return new HashSet<Capability>(capabilityMap.values());
 }
 public Set<Position> getPositions() {
   return new HashSet<Position>(positionMap.values());
 }
 public NonHumanResource getNonHumanResourceByName(String name) {
   for (NonHumanResource r : nonHumanMap.values()) {
     if (r.getName().equalsIgnoreCase(name)) return r;
   }
   return null; // no match
 }
 public Set<Participant> getParticipants() {
   return new HashSet<Participant>(participantMap.values());
 }
 public Set<OrgGroup> getOrgGroups() {
   return new HashSet<OrgGroup>(orgGroupMap.values());
 }
 public NonHumanCategory getNonHumanCategoryByName(String name) {
   for (NonHumanCategory r : nonHumanCategoryMap.values()) {
     if (r.getName().equalsIgnoreCase(name)) return r;
   }
   return null; // no match
 }
 public Set<Role> getRoles() {
   return new HashSet<Role>(roleMap.values());
 }