/****************************************************** * from http://home.att.net/~gobruen/ * * Needed to work with GameDriver.java and Roulette.java * * * * This queue class is for the storage of * previous winning numbers from the Roulette game. * It stores to most recent 10 wins and pushes it * down as the game goes on. * * Queues are loaded from the rear and emptied from the * front. In this example with load a 5 item queue with 5 items * and then add one more item. The item first added is removed, * and everything else is moved up a notch. * * * Empty queue * N->N->N->N->N-> * * add the number 3 * 3->N->N->N->N-> * * add the number 7 * 7->3->N->N->N-> * * Full queue * 5->4->3->2->1-> * * add the number 8 * 8->5->4->3->2-> 1 goes in the garbage * * * *Methods: * insert() inserts new nodes in the queue * showQueue() displays the queue * * * * **********************************************/ public class Queue { int maxSize = 10; int queArray[]; int front; int rear; int nItems; public Queue() { //maxSize = s; queArray = new int[maxSize]; front = 0; rear = -1; nItems = 0; } public void insert(int j) { if(rear == maxSize-1){ for(int i = 0; i