FileDocCategorySizeDatePackage
Consumer.javaAPI DocExample1789Thu Feb 04 16:10:36 GMT 1999None

Consumer

public class Consumer extends Thread

Fields Summary
Vector
data
Constructors Summary
public Consumer(Vector data)

		this.data = data;
	
Methods Summary
voidprocess(java.lang.Object o)

public voidrun()

		Object o;
		while (true) {
			synchronized(data) {
				while (data.size() == 0) {
					try {
						data.wait();
					} catch (InterruptedException ie) {
						return;
					}
				}
				o = data.elementAt(0);
				data.removeElementAt(0);
			}
			process(o);
		}