edu.berkeley.guir.ptk.notification
Class ExactMatchNotificationSetter

java.lang.Object
  extended byedu.berkeley.guir.ptk.PTK
      extended byedu.berkeley.guir.ptk.notification.NotificationSetter
          extended byedu.berkeley.guir.ptk.notification.ExactMatchNotificationSetter
Direct Known Subclasses:
IncludeMatchNotificationSetter

public class ExactMatchNotificationSetter
extends NotificationSetter

Determines if a given event is exactly the same Data value as the values specified by any of the notification level Data parameters and sets the level accordingly.

Only the value of the Data has to be the same - not the ids or metadata items. For example, if you set the makeaware parameter to a DataRange, the input must be a DataRange with the same data value, min, max, and step for there to be an exact match. The ids of the DataRange or the metadata do not have to match for there to be an "exact match."

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 whose data is equal to this object 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
 Data value_changeblind
           
 Data value_demandaction
           
 Data value_ignore
          These data fields indicate the value to check for equality for each notification level.
 Data value_interrupt
           
 Data 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
ExactMatchNotificationSetter()
          Default constructor.
ExactMatchNotificationSetter(Data ignore, Data changeblind, Data makeaware, Data interrupt, Data demandaction)
          Same as the previous two, except no data IDs.
ExactMatchNotificationSetter(java.lang.String[] data_ids_to_check, Data ignore, Data changeblind, Data makeaware, Data interrupt, Data demandaction)
          Same as previous constructor, except the first parameter is an array.
ExactMatchNotificationSetter(java.lang.String data_id_to_check, Data ignore, Data changeblind, Data makeaware, Data interrupt, Data demandaction)
          Constructor.
 
Method Summary
 int set(Event e, History h)
          Determines if the event data is equal to one of 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
 

Field Detail

value_ignore

public Data value_ignore
These data fields indicate the value to check for equality for each notification level. The data types of these values must be the same type as the data you expect in the input event. For example, setting value_interrupt to a DataString with value "mariners" would mean that if the new event includes a DataString with value "mariners" than the notification level should be set to interrupt.

The setter will simply not set the notification level to any level for which a change value is not specified.


value_changeblind

public Data value_changeblind

value_makeaware

public Data value_makeaware

value_interrupt

public Data value_interrupt

value_demandaction

public Data value_demandaction
Constructor Detail

ExactMatchNotificationSetter

public ExactMatchNotificationSetter()
Default constructor. Sets all data fields to null except translate, which is set to a new Translate object.


ExactMatchNotificationSetter

public ExactMatchNotificationSetter(java.lang.String data_id_to_check,
                                    Data ignore,
                                    Data changeblind,
                                    Data makeaware,
                                    Data interrupt,
                                    Data demandaction)
Constructor.

Parameters:
data_id_to_check - The data ID in the input event that this notification setter will check when setting the notification level. For example, if the setter is sets the notification level depending on the volume of an audio input, then this would be set to PTKConstants.VOLUME_ID.
ignore - This is a Data object that will be compared to the input event. If the two have equal data values, then the notification level will be set to ignore.
changeblind - This is a Data object that will be compared to the input event. If the two have equal data values, then the notification level will be set to changeblind.
makeaware - This is a Data object that will be compared to the input event. If the two have equal data values, then the notification level will be set to makeaware.
interrupt - This is a Data object that will be compared to the input event. If the two have equal data values, then the notification level will be set to interrupt.
demandaction - This is a Data object that will be compared to the input event. If the two have equal data values, then the notification level will be set to demandaction.

ExactMatchNotificationSetter

public ExactMatchNotificationSetter(java.lang.String[] data_ids_to_check,
                                    Data ignore,
                                    Data changeblind,
                                    Data makeaware,
                                    Data interrupt,
                                    Data demandaction)
Same as previous constructor, except the first parameter is an array.

Parameters:
data_ids_to_check - an array of data IDs that the setter will check in the input event. The notification level will be set based upon the same parameters for each data item. Each data item specified in the event has to match. For example, each data item in data_id has to exactly match the makeaware Data in order for the notification level to be set to MAKEAWARE.
ignore -
changeblind -
makeaware -
interrupt -
demandaction -

ExactMatchNotificationSetter

public ExactMatchNotificationSetter(Data ignore,
                                    Data changeblind,
                                    Data makeaware,
                                    Data interrupt,
                                    Data 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 data is equal to one of the data fields of this Notification Setter. The notification level is set according to which (if any) of these data fields is equal to the new event's Data value(s).

Specified by:
set in class NotificationSetter
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.