From ece7d18cf35374bf4e26d041799cda8f791c89f8 Mon Sep 17 00:00:00 2001 From: gregor Date: Mon, 7 Jul 2003 10:58:37 +0000 Subject: Initial commit git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@2 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../moa/spss/server/config/KeyGroup.java | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroup.java (limited to 'spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroup.java') diff --git a/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroup.java b/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroup.java new file mode 100644 index 000000000..5fd108e1a --- /dev/null +++ b/spss.server/src/at/gv/egovernment/moa/spss/server/config/KeyGroup.java @@ -0,0 +1,69 @@ +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() + ")"; + } + +} -- cgit v1.2.3