Guest User

class RRQueue : Queue<double>

a guest
Jun 22nd, 2010
413
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class RRQueue : Queue<double>
  2.     {
  3.  
  4.         public int capacity;
  5.  
  6.         public RRQueue(int _capacity)
  7.         {
  8.             capacity = _capacity;
  9.         }
  10.  
  11.         public new void Enqueue(double item)
  12.         {
  13.             base.Enqueue(item);
  14.             if (this.Count > capacity) this.Dequeue();
  15.         }
  16.  
  17.         public double Average
  18.         {
  19.             get
  20.             {
  21.                 return this.Average();
  22.             }
  23.         }
  24.     }
RAW Paste Data