Exemple #1
0
        }//end EnqueueApplication(GradApplication)

        public GradApplication Dequeue()
        {
            GradApplication Temp = ToDo.Dequeue();

            CalculateTotal();   //Update the total
            return(Temp);
        }//end DequeueApplication()
Exemple #2
0
        }//end Peek()

        #endregion

        /// <summary>
        /// Adds up all of the values in the queue to get the queue's total workload
        /// </summary>
        public void CalculateTotal()
        {
            double dComplexity = 0;

            if (this.ToDo.Peek() != null && this.ToDo.Count > 0)    //if there's actually stuff in the queue
            {
                GradApplication[] temp = new GradApplication[ToDo.Count];
                ToDo.CopyTo(temp, 0);
                for (int iCount = 0; iCount < ToDo.Count; iCount++)
                {
                    dComplexity += temp[iCount].GetComplexityRating();
                }
            }
        }//end CalculateTotal()
Exemple #3
0
        }//end GetTotal()

        #endregion

        #region Utility Methods
        public int Enqueue(GradApplication AppIn)
        {
            int iReturnCode = 0;

            if ((ToDo.Count + 1) != cutoff)
            {
                ToDo.Enqueue(AppIn);
                CalculateTotal();   //Update the total
            }
            else
            {
                iReturnCode = -1;
            }
            return(iReturnCode);
        }//end EnqueueApplication(GradApplication)