Usage of the Bags.contains function.
More...
|
static void | main (String[] args) |
|
Usage of the Bags.contains function.
This chain of processors can be represented graphically as follows:
- Author
- Sylvain Hallé Easy
Definition at line 39 of file BagsContains.java.
◆ main()
static void util.BagsContains.main |
( |
String [] |
args | ) |
|
|
static |
We create a QueueSource; note that this time, each event in
Definition at line 41 of file BagsContains.java.
45 QueueSource src1 =
new QueueSource();
46 src1.addEvent(UtilityMethods.createList(1f, 3f, 5f));
47 src1.addEvent(UtilityMethods.createList(4f, 2f));
48 src1.addEvent(UtilityMethods.createList(4f, 4f, 8f));
49 src1.addEvent(UtilityMethods.createList(6f, 4f));
51 QueueSource src2 =
new QueueSource();
56 ApplyFunction contains =
new ApplyFunction(Bags.contains);
57 Connector.connect(src1, 0, contains, 0);
58 Cumulate counter =
new Cumulate(
59 new CumulativeFunction<Number>(Numbers.addition));
60 Connector.connect(src2, counter);
61 Connector.connect(counter, 0, contains, 1);
62 Pullable p = contains.getPullableOutput();
63 for (
int i = 0; i < 4; i++)
65 System.out.println(p.pull());
The documentation for this class was generated from the following file: