|
|||||||||||
| 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.Event
Contains the data that an input source sends to applications and the metadata identifying this data. Includes several other pieces of information useful to identifying, classifying, or describing an event: the notification level, a timestamp indicating when the event was created, a display step number indicating the order in which events are displayed if a set is displayed together, a boolean indicating whether or not the event is meant to wait for some user action (e.g., in the case of a demand action notifiation level), and a DisplayInfo object that includes application-specific information on how to display the event (the default DisplayInfo object is only instantiated if the event is passed to a Transition object and it includes color, location, and animation fields; you can install a custom DisplayInfo object by passing it to a Transition, which would be passed into your Output's constructor).
| Field Summary | |
protected java.util.Hashtable |
data
Hashtable of data items. |
DisplayInfo |
display_info
Includes application-specific information on how to display the event (the default DisplayInfo object is only instantiated if the event is passed to a Transition object and it includes only a color field; you can install a custom DisplayInfo object when you initialize your Transition). |
protected int |
display_step_num
In the case that a number of events are displayed together, indicates the order in which the events should be displayed. |
protected boolean |
grab_action_event
This boolean member data just stores whether or not this event should trigger a call to the checkTheAction() method in output. |
protected static int |
HASH_SIZE
The number of data items possible (until re-hash). |
protected java.util.Hashtable |
metadata
Hashtable of metadata item. |
int |
notification
Notification level for this vent. |
protected java.util.Date |
timestamp
Time the event was created. |
| Fields inherited from class edu.berkeley.guir.ptk.PTK |
debug, MAX_DEBUG, MED_DEBUG, MIN_DEBUG, NO_DEBUG |
| Constructor Summary | |
Event()
|
|
| Method Summary | |
void |
addData(Data d)
Adds a Data to the Event. |
void |
addData(Event from)
Adds copies of the data items from one event (from) to this event. |
void |
addMetadata(Event from)
Add copies of the metadata items from the given event (from) to this event while leaving this event's metadata in tact. |
void |
addMetadata(Metadata m)
Adds all MetadataItem objects in Metadata to the Event. |
void |
addMetadata(MetadataItem md)
Adds a MetadataItem to the Event. |
boolean |
areAnyMetadataIncluded(Metadata[] md)
Takes an array of Metadata objects and returns true if any of the Metadata objects is included in this event's metadata. |
boolean |
areMetadataIDsIncluded(java.lang.String[] ids)
Checks if a series of ids are metadata ids for this Event's metadata. |
Event |
copy()
Returns a copy of this Event in new memory. |
int |
dataSize()
Rreturns the number of Data in the Event. |
DisplayInfo |
displayInfoCopy()
Returns a copy of the DisplayInfo installed in this Event if the Event has been passed through a Transition. |
boolean |
doesDataMatch(Data[] d)
Check if this Event's data exactly match the given Data (id, value pairs). |
boolean |
doesMetadataMatch(Metadata md)
Check if this Event's metadata exactly match the given Metadata (id, value pairs). |
boolean |
doesMetadataMatch(MetadataItem[] md)
Check if this Event's metadata exactly match the given MetadataItems (id, value pairs). |
boolean |
doMetadataIDsMatch(java.lang.String[] ids)
Checks if a series of ids are the same ids as this the ids in this Event's metadata. |
(package private) boolean |
equals(Event e)
Returns true if the given Event has the same metadata, data, notification level, and timestamp. |
Data[] |
getAllData()
Returns an array of all the Data in the Event. |
Metadata |
getAllMetadata()
Returns a Metadata object, which contains all the MetadataItems in the Event. |
MetadataItem[] |
getAllMetadataAsArray()
Returns an array of all the MetadataItems in the Event. |
int |
getAnimation()
Returns the animation of this Event if it has a DisplayInfo installed. |
int |
getColor()
Returns the color of this Event if it has a DisplayInfo installed. |
Data |
getData(java.lang.String id)
Takes an id and returns the Data object associated with the id. |
int |
getDisplayStepNum()
In the case that a number of events are displayed together, returns a number that indicates the order in which the events should be displayed. |
java.awt.Point |
getLocation()
Returns the location of this Event if it has a DisplayInfo installed. |
MetadataItem |
getMetadata(java.lang.String id)
Takes an id and returns the MetadataItem object associated with the id. |
java.lang.String |
getMetadataValue(java.lang.String id)
Takes an id and returns the value of the MetadataItem object associated with the id. |
int |
getNotificationLevel()
Returns the notification level of this Event. |
java.util.Date |
getTimeCreated()
Returns the time this Event was created as a Date. |
boolean |
isDataIncluded(java.lang.String id)
Check if this Event's data includes data for the given id. |
boolean |
isDataIncluded(java.lang.String[] ids)
Data Check if this Event's data includes data the given ids. |
boolean |
isGrabAction()
Returns true if this Event is meant to cause a user to do some action; used with "demand action" notification levels only. |
boolean |
isIgnoreEvent()
|
boolean |
isMetadataIncluded(Metadata md)
Check if this Event's metadata includes the given Metadata (id, value pairs). |
boolean |
isMetadataIncluded(MetadataItem md)
Check if this Event's metadata includes the given MetadataItem (id, value pair). |
boolean |
isMetadataIncluded(MetadataItem[] md)
Check if this Event's metadata includes the given MetadataItems (id, value pairs). |
int |
metadataSize()
The number of MetadataItems in the Event. |
void |
removeAllData()
Removes all the data items from this event. |
void |
removeAllMetadata()
Removes all the metadata items from this event. |
void |
removeData(java.lang.String id)
Removes the Data from the Event with the given id. |
void |
removeMetadata(java.lang.String id)
Removes the MetadataItem from the Event with the given id. |
void |
replaceData(Event from)
Removes this event's data and then copies the data items from the given event (from) to this event. |
void |
replaceMetadata(Event from)
Removes this event's metadata and then copies the metadata items from the given event (from) to this event. |
void |
setAnimation(int a)
Sets the animation of this Event if it has a DisplayInfo installed. |
void |
setColor(int c)
Sets the color of this Event if it has a DisplayInfo installed. |
void |
setDisplayStepNum(int n)
This method should only be called if multiple events are displayed together (e.g., in a Transition). |
void |
setGrabAction(boolean g)
Sets a boolean indicating whether or not this Event is meant to cause a user to do some action; used with "demand action" notification levels only. |
void |
setLocation(java.awt.Point p)
Sets the location of this Event if it has a DisplayInfo installed. |
void |
setNotificationLevel(int n)
Sets the notification level of this Event. |
void |
setTimeCreated(java.util.Date d)
Sets the time this Event was created as a Calendar. |
void |
updateData(java.lang.String id,
Data d)
Updates an existing Data with the given value. |
void |
updateMetadataValue(java.lang.String id,
java.lang.String value)
Updates an existing MetadataItem with the given value. |
| 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 int notification
protected java.util.Date timestamp
protected int display_step_num
public DisplayInfo display_info
protected boolean grab_action_event
protected static final int HASH_SIZE
protected java.util.Hashtable metadata
protected java.util.Hashtable data
| Constructor Detail |
public Event()
| Method Detail |
public java.util.Date getTimeCreated()
public void setTimeCreated(java.util.Date d)
public int getDisplayStepNum()
public void setDisplayStepNum(int n)
n - public int getColor()
public void setColor(int c)
c - the integer value of a color.public java.awt.Point getLocation()
public void setLocation(java.awt.Point p)
public int getAnimation()
public void setAnimation(int a)
a - the integer value of animation.public boolean isGrabAction()
public void setGrabAction(boolean g)
public int getNotificationLevel()
public void setNotificationLevel(int n)
n - the notification level.public boolean isIgnoreEvent()
boolean equals(Event e)
e -
public Event copy()
public DisplayInfo displayInfoCopy()
public void removeAllData()
public void removeAllMetadata()
public void addMetadata(Event from)
from - the Event to copy metadata from.public void replaceMetadata(Event from)
from - the Event to copy metadata from.public void addData(Event from)
from - public void replaceData(Event from)
from - public void addData(Data d)
d - The Data to add.
public void updateData(java.lang.String id,
Data d)
id - The id of the Data to update.public void removeData(java.lang.String id)
id - Indicates which Data to remove.public Data[] getAllData()
public Data getData(java.lang.String id)
id - The id of the Data to get.
public boolean doesDataMatch(Data[] d)
d -
public boolean isDataIncluded(java.lang.String[] ids)
ids - Array of data ids Strings.public boolean isDataIncluded(java.lang.String id)
id - Data id String.public int dataSize()
public void addMetadata(MetadataItem md)
md - The MetadataItem to add.public void addMetadata(Metadata m)
public void updateMetadataValue(java.lang.String id,
java.lang.String value)
id - The id of the MetadataItem to update.value - The new value of the MetadataItem.public void removeMetadata(java.lang.String id)
id - Indicates which MetadataItem to remove.public Metadata getAllMetadata()
public MetadataItem[] getAllMetadataAsArray()
public MetadataItem getMetadata(java.lang.String id)
id -
public java.lang.String getMetadataValue(java.lang.String id)
id -
public boolean doesMetadataMatch(MetadataItem[] md)
md -
public boolean doesMetadataMatch(Metadata md)
md -
public boolean isMetadataIncluded(MetadataItem[] md)
md -
public boolean isMetadataIncluded(Metadata md)
md -
public boolean areAnyMetadataIncluded(Metadata[] md)
md -
public boolean isMetadataIncluded(MetadataItem md)
md -
public boolean doMetadataIDsMatch(java.lang.String[] ids)
ids -
public boolean areMetadataIDsIncluded(java.lang.String[] ids)
ids -
public int metadataSize()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||