/** * Returns a Collection of the different associations that have this associationtype. */ public Collection getAssociationDetails(String key) { if (key == null || !associations.containsKey(key)) return null; return ((InternalAssociation)associations.get(key)).getAssociationDetails(); }
/** * Returns a hashmap containg the id of the assocrltype, and the name of assocrltype */ public HashMap getAssociationRoleTypes(String key) { if (key == null || !associations.containsKey(key)) return null; return ((InternalAssociation)associations.get(key)).getAssociationRoleTypes(); }
/** * Gets the association roles ordered aplhabetically */ public String[] getAssociationRoleTypesOrdered(String key) { if (key == null || !associations.containsKey(key)) return null; return ((InternalAssociation)associations.get(key)).getAssociationRoleTypesOrdered(); }
/** * Returns the players of of this association ordred by the role types. */ protected String[] getAssociationDetails(AssociationIF association) { String[] result = new String[association.getRoles().size()]; Iterator it = association.getRoles().iterator(); while (it.hasNext()) { AssociationRoleIF role = (AssociationRoleIF)it.next(); String name = getName(role.getType()); roles = getAssociationRoleTypesOrdered(); for (int i = 0; i < roles.length; i++) { // Inserts the correct player name and id in the correct alphabetical order. if (name.equals(roles[i]) && result[i] == null) { result[i] = getName(role.getPlayer()) + "$" + role.getPlayer().getObjectId(); } } } return result; }
private void traverse(Collection assocs) { Iterator it = assocs.iterator(); while (it.hasNext()) { AssociationIF temp = (AssociationIF)it.next(); String key = createKey(temp); InternalAssociation assoc; if (associations.containsKey(key)) { assoc = (InternalAssociation)associations.get(key); assoc.increment(); } else { assoc = new InternalAssociation(temp); associations.put(key, assoc); } assoc.addAssociation(temp); } }
/** * Adds an association to the collection of assocation with the same * types, and roles. */ protected void addAssociation(AssociationIF association) { associations.add(association); addAssociationRoles(association); }
/** * Gets the name of the association. */ public String getAssociationType(String key) { if (key == null || !associations.containsKey(key)) return NULL; return ((InternalAssociation)associations.get(key)).getAssociationType(); }
/** * Gets the id for the association type. */ public String getAssociationTypeId(String key) { if (key == null || !associations.containsKey(key)) return NULL; return ((InternalAssociation)associations.get(key)).getAssociationTypeId(); }
InternalAssociation(AssociationIF association) { this.associationtype = association.getType(); this.association = association; roleTypes = addAssocRoleTypes(association); number_of_assocs = 1; assocRoles = new HashMap(); associations = new ArrayList(); //roles = getAssociationRoleTypesOrdered(); }
/** * Return a hashmap containg the id and the name of all the topictypes for all the * topics that play in this association. */ public HashMap getAssociationRoles(String key) { if (key == null || !associations.containsKey(key)) return null; return ((InternalAssociation)associations.get(key)).getAssociationRoles(); }
public String[] getAssociationDetails(String key, AssociationIF association) { if (key == null || !associations.containsKey(key)) return null; return ((InternalAssociation)associations.get(key)).getAssociationDetails(association); }