public class Producer extends java.lang.Object implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private static int |
DELAY |
private java.lang.String |
greeting |
private int |
greetingCount |
private BoundedQueue<java.lang.String> |
queue |
Constructor and Description |
---|
Producer(java.lang.String aGreeting,
BoundedQueue<java.lang.String> aQueue,
int count)
Constructs the producer object.
|
Modifier and Type | Method and Description |
---|---|
void |
run() |
private java.lang.String greeting
private BoundedQueue<java.lang.String> queue
private int greetingCount
private static final int DELAY
public Producer(java.lang.String aGreeting, BoundedQueue<java.lang.String> aQueue, int count)
aGreeting
- the greating to insert into a queueaQueue
- the queue into which to insert greetingscount
- the number of greetings to producepublic void run()
run
in interface java.lang.Runnable