|
GridSim v4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objecteduni.simjava.Sim_predicate
gridsim.datagrid.filter.FilterDataResult
Look for a specific incoming event that matches a given event tag name and a
logical file name (lfn). Incoming events with a matching tag name
must contain a data object of type
Object[], where Object[0] stores the lfn.
This class is used by Sim_system
to select or filter an event already present in the entity's deferred queue
(incoming buffer), or used to selectively wait for a future event.
An example on how to use this class:
Imagine we have a scenario where Entity_A sends one or more events
to Entity_B with different tag names and data objects.
Entity_B wants to get an event with a HIGH_PRIORITY tag
and a lfn of Data01 in this example.
Therefore, inside the Entity_B code:
... // other code
String lfn = "Data01";
int tag = HIGH_PRIORITY;
Sim_event ev = new Sim_event();
FilterDataResult filter = new FilterDataResult(lfn, tag);
// get an incoming event that matches a given filter
super.sim_get_next(filter, ev);
// get the matching event data
Object[] result = (Object[]) ev.get_data();
NOTE:
Sim_entity
class.
Sim_entity.sim_get_next(Sim_predicate, Sim_event)
method will wait indefinitely.
Constructor Summary | |
FilterDataResult(String lfn,
int tag)
Creates a new filter to select an incoming event based on the logical file name (lfn) and tag name |
Method Summary | |
boolean |
match(Sim_event ev)
Checks whether an event matches the required constraints or not. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FilterDataResult(String lfn, int tag)
lfn
- the logical file nametag
- a matching event tag nameMethod Detail |
public boolean match(Sim_event ev)
Sim_system
.
match
in class Sim_predicate
ev
- an incoming event to compare with
|
GridSim v4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |