FileDocCategorySizeDatePackage
BallotBox.javaAPI DocExample630Sun Apr 25 18:53:58 BST 2004None

BallotBox

public class BallotBox extends Object
BallotBox - keep track of voting. Only used in ReadersWritersDemo.
version
$Id: BallotBox.java,v 1.1 2004/04/25 22:53:57 ian Exp $

Fields Summary
BallotPosition[]
data
Constructors Summary
BallotBox(List list)

		data = new BallotPosition[list.size()];
		for (int i = 0; i < list.size(); i++) {
			data[i] = new BallotPosition((String)list.get(i));
		}
	
Methods Summary
intgetCandidateCount()

		return data.length;
	
public java.util.Iteratoriterator()

		return new ArrayIterator(data);
	
public voidvoteFor(int i)

		++data[i].votes;