Code Examples
A repository of 155 code examples for BeepBeep
basic.PullHard Class Reference

Illustration of the difference between using pull() and pullSoft() on a Pullable object. More...

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

Illustration of the difference between using pull() and pullSoft() on a Pullable object.

In this example, we use the "hard" (or standard) way of fetching objects from a Pullable.

Author
Sylvain Hallé
See also
PullSoft

Definition at line 36 of file PullHard.java.

Member Function Documentation

◆ main()

static void basic.PullHard.main ( String []  args)
static

Definition at line 38 of file PullHard.java.

39  {
40  ///
41  QueueSource source = new QueueSource().loop(false);
42  source.setEvents(0, 1, 2, 3);
43  CountDecimate decim = new CountDecimate(2);
44  Connector.connect(source, decim);
45  Pullable p = decim.getPullableOutput();
46  ///
47  //!
48  for (int i = 0; i < 5; i++)
49  {
50  boolean b = p.hasNext();
51  System.out.println(b);
52  if (b == true)
53  {
54  System.out.println(p.pull());
55  }
56  }
57  //!
58  }

The documentation for this class was generated from the following file: