01: package net.sourceforge.squirrel_sql.plugins.userscript.kernel;
02:
03: import java.util.Vector;
04: import java.util.Hashtable;
05:
06: public class ScriptTargetCollection {
07: private Vector<ScriptTarget> m_targets = new Vector<ScriptTarget>();
08: private Hashtable<String, String> m_containedTargetTypes = new Hashtable<String, String>();
09:
10: public void add(ScriptTarget target) {
11: m_targets.add(target);
12: m_containedTargetTypes.put(target.getTargetType(), target
13: .getTargetType());
14: }
15:
16: public ScriptTarget[] getAll() {
17: return m_targets.toArray(new ScriptTarget[m_targets.size()]);
18: }
19:
20: public String[] getContainedTargetTypes() {
21: return m_containedTargetTypes.keySet().toArray(new String[0]);
22: }
23:
24: public int size() {
25: return m_targets.size();
26: }
27: }
|