|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.berkeley.guir.ptk.abstraction.AbstractionPolicy
Handles the routing of events to Abstractors. An instance of class is initialized by
the PeripheralDisplay class each time makeConnection is
called.
The method doAbstraction loops through the Abstractors that are installed (these correspond to an array of Abstractors or a single Abstractor passed into a makeConnection call). Different instances of this class can have different Abstractors installed. These abstract the event data. Default for the doAbstraction method is to continue looping through all installed Abstractors.
In doAbstraction, this policy determines if it should call an Abstractor's doAbstract method by comparing the metadata of the event (and possibly data IDs) with the metadata (and possibly data IDs) the Abstractor indicates it can abstract.
Developers will rarely need to modify this class or worry about how it works. One case in which developers may want to modify this class is if they want to modify the way in which events are passed to a chain of installed Abstractors.
| Field Summary | |
boolean |
add_to_history
Flag used to indicate whether this policy should add its processed event to its history queue (see history queue above) |
History |
h
All abstraction policies can look at the application's event history. |
EventPriorityQueue |
inQ
This is the queue that houses incoming events to be processed by this policy. |
EventPriorityQueue |
outQ
This is the queue where the policy places processed events. |
| Constructor Summary | |
AbstractionPolicy()
Default constructor which sets all data fields to null. |
|
AbstractionPolicy(Abstractor abs)
|
|
AbstractionPolicy(Abstractor[] abs)
|
|
AbstractionPolicy(java.util.Vector abstractors)
Constructor that takes two parameters. |
|
| Method Summary | |
void |
addAbstractor(Abstractor ab)
Adds the given Abstractor to this policy. |
void |
addAll(Abstractor[] abs)
|
boolean |
doAbstraction(Event e)
This method loops through the abstractors that are installed in this policy. |
Metadata[][] |
getAllMetadata()
Returns an array of Metadata arrays, one for each abstractor installed in abstractors. |
Metadata[] |
getFirstMetadata()
Returns an array of the first Metadata for each abstractor installed in abstractors. |
void |
run()
Processing loop that periodically checks the inQ for new events to be processed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public EventPriorityQueue inQ
public EventPriorityQueue outQ
public History h
public boolean add_to_history
| Constructor Detail |
public AbstractionPolicy()
public AbstractionPolicy(Abstractor abs)
public AbstractionPolicy(Abstractor[] abs)
public AbstractionPolicy(java.util.Vector abstractors)
PeripheralDisplay.
abstractors - Vector of abstractors to be
installed in this policy. The order of
this Vector dictates the order in which
the setters will process a new event.
The setter in the first (0th) position of
Vector will process the event first.| Method Detail |
public boolean doAbstraction(Event e)
e - The event that will be abstracted.
public void addAbstractor(Abstractor ab)
ab - public void addAll(Abstractor[] abs)
public Metadata[][] getAllMetadata()
public Metadata[] getFirstMetadata()
public void run()
run in interface java.lang.RunnableRunnable.run()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||