|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.berkeley.guir.ptk.PTK
edu.berkeley.guir.ptk.notification.NotificationSetter
Notification setters must implement this abstract class. The method set
determines which notification level the event should get and sets it. The
data_id data
field can be set to specify what data to check for in new events. For
example, if set to PTKConstants.Volume_ID, then this notification setter
will check the data field in the input event representing volume to
determine the notification level. If the data_id field is not set, then the
Notification Setter will check all of the event's data items when setting
the notification level.
| Field Summary | |
java.lang.String[] |
data_id
ID(s) of data to check for in the Event passed in. |
Translate |
translate
Specifies how to translate any given data item - notification setter defaults only care about translating to a number. |
| Fields inherited from class edu.berkeley.guir.ptk.PTK |
debug, MAX_DEBUG, MED_DEBUG, MIN_DEBUG, NO_DEBUG |
| Constructor Summary | |
NotificationSetter()
Default constructor. |
|
| Method Summary | |
void |
addMetadataIWant(Metadata mds)
Performs a deep copy of the MetadataItems in the array passed in to the metadata_I_want data field. |
boolean |
canISetNotification(Event e)
Compares the given event's metadata items to this Setter's metadata. |
Metadata[] |
getAllMetadata()
Returns all Metadata objects that indicate all input events the notification setter can handle (used for connections to multiple inputs). |
Data[] |
getEventData(Event e)
Returns the data from the event that the notification setter uses to determine how to set the notification. |
double[] |
getEventDataAsDouble(Event e)
Returns the data from the event (converted to a double) that the notification setter uses to determine how to set the notification. |
Metadata |
getFirstMetadata()
Returns only the first Metadata object; for notifiction setter that connect to only a single input, the first will be the ONLY Metadata object. |
abstract int |
set(Event e,
History h)
Sets the notification level of the given event. |
| Methods inherited from class edu.berkeley.guir.ptk.PTK |
getMAX, getMED, getMIN, getNO, printDebug, printDebug, printError |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public java.lang.String[] data_id
public Translate translate
| Constructor Detail |
public NotificationSetter()
| Method Detail |
public abstract int set(Event e,
History h)
e - The event that may have its notification set.h - The history of events that have been passed to this
application.
public double[] getEventDataAsDouble(Event e)
NotificationSetter.data_id field, the this method
translates the corresponding Data object in the Event e to a
double. Otherwise, this method gets all the Data objects in
Event e and translates them all, and returns an array of doubles.
To perform the translation to a double, this method calls
translate.toNumber(). To customize the way in which
Data is converted to doubles, pass a custom Translate object into
the NotificationSetter.
This method is used by the default threshold and degree change notification setters, because they must be able to quantify and order the data to determine if it is within a threshold or by how much it has changed.
e - The event containing the data for which notification
will be set.public Data[] getEventData(Event e)
e - The event containing the data for which notification
will be set.public void addMetadataIWant(Metadata mds)
public Metadata getFirstMetadata()
public Metadata[] getAllMetadata()
public boolean canISetNotification(Event e)
e - Event
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||