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++; }
public Boolean isOlder(Animal a) { return this.timestamp > a.timestamp; }