summaryrefslogtreecommitdiff
path: root/sources/events/VSRegisteredEvents.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/events/VSRegisteredEvents.java')
-rw-r--r--sources/events/VSRegisteredEvents.java92
1 files changed, 92 insertions, 0 deletions
diff --git a/sources/events/VSRegisteredEvents.java b/sources/events/VSRegisteredEvents.java
index 2643d6f..d41ffea 100644
--- a/sources/events/VSRegisteredEvents.java
+++ b/sources/events/VSRegisteredEvents.java
@@ -1,3 +1,7 @@
+/*
+ * VS is (c) 2008 by Paul C. Buetow
+ * vs@dev.buetow.org
+ */
package events;
import java.util.*;
@@ -6,13 +10,32 @@ import prefs.*;
import core.*;
import utils.*;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class VSRegisteredEvents.
+ */
public final class VSRegisteredEvents {
+
+ /** The event classnames. */
private static HashMap<String,String> eventClassnames;
+
+ /** The event shortnames. */
private static HashMap<String,String> eventShortnames;
+
+ /** The event names. */
private static HashMap<String,String> eventNames;
+
+ /** The editable protocols classnames. */
private static ArrayList<String> editableProtocolsClassnames;
+
+ /** The prefs. */
private static VSPrefs prefs;
+ /**
+ * Inits the.
+ *
+ * @param prefs_ the prefs_
+ */
public static void init(VSPrefs prefs_) {
prefs = prefs_;
eventNames = new HashMap<String, String>();
@@ -42,10 +65,20 @@ public final class VSRegisteredEvents {
}
}
+ /**
+ * Gets the editable protocols classnames.
+ *
+ * @return the editable protocols classnames
+ */
public static ArrayList<String> getEditableProtocolsClassnames() {
return editableProtocolsClassnames;
}
+ /**
+ * Gets the protocol names.
+ *
+ * @return the protocol names
+ */
public static Vector<String> getProtocolNames() {
Set<String> set = eventClassnames.keySet();
Vector<String> vector = new Vector<String>();
@@ -59,6 +92,11 @@ public final class VSRegisteredEvents {
return vector;
}
+ /**
+ * Gets the protocol classnames.
+ *
+ * @return the protocol classnames
+ */
public static Vector<String> getProtocolClassnames() {
Set<String> set = eventNames.keySet();
Vector<String> vector = new Vector<String>();
@@ -72,6 +110,11 @@ public final class VSRegisteredEvents {
return vector;
}
+ /**
+ * Gets the non protocol names.
+ *
+ * @return the non protocol names
+ */
public static Vector<String> getNonProtocolNames() {
Set<String> set = eventClassnames.keySet();
Vector<String> vector = new Vector<String>();
@@ -85,6 +128,11 @@ public final class VSRegisteredEvents {
return vector;
}
+ /**
+ * Gets the non protocol classnames.
+ *
+ * @return the non protocol classnames
+ */
public static Vector<String> getNonProtocolClassnames() {
Set<String> set = eventNames.keySet();
Vector<String> vector = new Vector<String>();
@@ -98,18 +146,47 @@ public final class VSRegisteredEvents {
return vector;
}
+ /**
+ * Gets the classname.
+ *
+ * @param eventName the event name
+ *
+ * @return the classname
+ */
public static String getClassname(String eventName) {
return eventClassnames.get(eventName);
}
+ /**
+ * Gets the name.
+ *
+ * @param eventClassname the event classname
+ *
+ * @return the name
+ */
public static String getName(String eventClassname) {
return eventNames.get(eventClassname);
}
+ /**
+ * Gets the shortname.
+ *
+ * @param eventClassname the event classname
+ *
+ * @return the shortname
+ */
public static String getShortname(String eventClassname) {
return eventShortnames.get(eventClassname);
}
+ /**
+ * Creates the event instance by classname.
+ *
+ * @param eventClassname the event classname
+ * @param process the process
+ *
+ * @return the vS event
+ */
public static VSEvent createEventInstanceByClassname(String eventClassname, VSProcess process) {
final Object protocolObj = new VSClassLoader().newInstance(eventClassname);
@@ -122,10 +199,25 @@ public final class VSRegisteredEvents {
return null;
}
+ /**
+ * Creates the event instance by name.
+ *
+ * @param eventName the event name
+ * @param process the process
+ *
+ * @return the vS event
+ */
public static VSEvent createEventInstanceByName(String eventName, VSProcess process) {
return createEventInstanceByClassname(eventClassnames.get(eventName), process);
}
+ /**
+ * Register event.
+ *
+ * @param eventClassname the event classname
+ * @param eventName the event name
+ * @param eventShortname the event shortname
+ */
private static void registerEvent(String eventClassname, String eventName, String eventShortname) {
if (eventShortname == null)
eventShortname = eventName;