package at.gv.egovernment.moa.spss.server.config; import java.util.Iterator; import java.util.Set; /** * A collection of KeyGroupEntrys with its own ID. * * @author Sven Aigner * @author Patrick Peck * @version $Id$ */ public class KeyGroup { /** The keys belonging to this key group. */ private Set keyGroupEntries; /** The key group ID. */ private String id; /** * Create a KeyGroup. * * @param id The ID of this KeyGroup. * @param keyGroupEntries The keys belonging to this KeyGroup. */ public KeyGroup(String id, Set keyGroupEntries) { this.id = id; this.keyGroupEntries = keyGroupEntries; } /** * Return the KeyEntrys contained in this KeyGroup. * * @return The KeyEntrys contained in this KeyGroup. */ public Set getKeyGroupEntries() { return keyGroupEntries; } /** * Return the ID of this KeyGroup. * * @return The KeyGroup ID. */ public String getId() { return id; } /** * Return a String representation of this KeyGroup. * * @return The String representation. * @see java.lang.Object#toString() */ public String toString() { StringBuffer sb = new StringBuffer(); Iterator i; if (getKeyGroupEntries() != null) { i = getKeyGroupEntries().iterator(); while (i.hasNext()) { sb.append(" " + i.next()); } } return "(KeyGroup - ID:" + id + " " + sb.toString() + ")"; } }