Пример #1
0
        public void Enqueue(Animal animal)
        {
            animal.setTimestamp(order);
            if (animal is Dog)
                dogs.Enqueue((Dog)animal);
            else if (animal is Cat)
                cats.Enqueue((Cat)animal);

            order++;
        }
Пример #2
0
 public Boolean isOlder(Animal a)
 {
     return this.timestamp > a.timestamp;
 }