Code Examples
A repository of 155 code examples for BeepBeep
basic.PullSoft 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 "soft" way of fetching objects from a Pullable.

Author
Sylvain Hallé
See also
PullHard

Definition at line 36 of file PullSoft.java.

Member Function Documentation

◆ main()

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

Definition at line 38 of file PullSoft.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  Pullable.NextStatus s = p.hasNextSoft();
51  System.out.println(s);
52  if (s == Pullable.NextStatus.YES)
53  {
54  System.out.println(p.pullSoft());
55  }
56  }
57  //!
58  }

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