edu.berkeley.guir.ptk.notification
Class IncludeMatchNotificationSetter

java.lang.Object
  extended byedu.berkeley.guir.ptk.PTK
      extended byedu.berkeley.guir.ptk.notification.NotificationSetter
          extended byedu.berkeley.guir.ptk.notification.ExactMatchNotificationSetter
              extended byedu.berkeley.guir.ptk.notification.IncludeMatchNotificationSetter

public class IncludeMatchNotificationSetter
extends ExactMatchNotificationSetter

Takes only String values and determines if a given event's DataString includes the String value specified by any of the notification level Data parameters. Sets the notification level accordingly.

Takes either five or six parameters (parameter (1) is optional):

  1. a String data ID (or an array of Strings for multiple data IDs), which should match the data ID(s) of the event Data the notification setter should examine (if this parameter is excluded, the setter will examine every Data in events;
  2. a Data object corresponding to the ignore notification level (i.e., any event that includes a this String in the DataStrings checked will be set to ignore level);
  3. a Data object corresponding to the change blind notification level;
  4. a Data object corresponding to the make aware notification level;
  5. a Data object corresponding to the interrupt notification level;
  6. a Data object corresponding to the demand action notification level.

Author:
tmatthew Created: Mar 2, 2003

Field Summary
 
Fields inherited from class edu.berkeley.guir.ptk.notification.ExactMatchNotificationSetter
value_changeblind, value_demandaction, value_ignore, value_interrupt, value_makeaware
 
Fields inherited from class edu.berkeley.guir.ptk.notification.NotificationSetter
data_id, translate
 
Fields inherited from class edu.berkeley.guir.ptk.PTK
debug, MAX_DEBUG, MED_DEBUG, MIN_DEBUG, NO_DEBUG
 
Constructor Summary
IncludeMatchNotificationSetter(java.lang.String[] data_ids_to_check, java.lang.String ignore, java.lang.String changeblind, java.lang.String makeaware, java.lang.String interrupt, java.lang.String demandaction)
           
IncludeMatchNotificationSetter(java.lang.String ignore, java.lang.String changeblind, java.lang.String makeaware, java.lang.String interrupt, java.lang.String demandaction)
          Same as the previous two, except no data IDs.
IncludeMatchNotificationSetter(java.lang.String data_id_to_check, java.lang.String ignore, java.lang.String changeblind, java.lang.String makeaware, java.lang.String interrupt, java.lang.String demandaction)
           
 
Method Summary
 int set(Event e, History h)
          Determines if the event DataString includes one of the Strings specified in the data fields of this Notification Setter.
 
Methods inherited from class edu.berkeley.guir.ptk.notification.NotificationSetter
addMetadataIWant, canISetNotification, getAllMetadata, getEventData, getEventDataAsDouble, getFirstMetadata
 
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
 

Constructor Detail

IncludeMatchNotificationSetter

public IncludeMatchNotificationSetter(java.lang.String[] data_ids_to_check,
                                      java.lang.String ignore,
                                      java.lang.String changeblind,
                                      java.lang.String makeaware,
                                      java.lang.String interrupt,
                                      java.lang.String demandaction)

IncludeMatchNotificationSetter

public IncludeMatchNotificationSetter(java.lang.String data_id_to_check,
                                      java.lang.String ignore,
                                      java.lang.String changeblind,
                                      java.lang.String makeaware,
                                      java.lang.String interrupt,
                                      java.lang.String demandaction)

IncludeMatchNotificationSetter

public IncludeMatchNotificationSetter(java.lang.String ignore,
                                      java.lang.String changeblind,
                                      java.lang.String makeaware,
                                      java.lang.String interrupt,
                                      java.lang.String demandaction)
Same as the previous two, except no data IDs. This means that the notification setters will look at ALL Data objects in events that arrive when setting the notification level.

Method Detail

set

public int set(Event e,
               History h)
Determines if the event DataString includes one of the Strings specified in the data fields of this Notification Setter. The notification level is set according to which (if any) of these data fields is included in the new event's DataString value(s). For multiple data IDs, this method will check until it finds one Data that matches, then it returns the notification level.

Overrides:
set in class ExactMatchNotificationSetter
Parameters:
e - The event that may have its notification set.
h - The history of events that have been passed to this application.
Returns:
The notification level to which it set the event.