Exemple #1
0
 private void enqueueSamples(AnimalShelter shelter) {
   shelter
       .enqueue(new Dog("Charlie"))
       .enqueue(new Dog("Silver"))
       .enqueue(new Cat("Muscat Love"))
       .enqueue(new Dog("Snoopy"))
       .enqueue(new Cat("Persian"));
 }
Exemple #2
0
 private void dequeueAndPrints(AnimalShelter shelter) {
   System.out.println("dequeueAny() - " + shelter.dequeueAny().name);
   System.out.println("dequeueCat() - " + shelter.dequeueCat().name);
   System.out.println("dequeueDog() - " + shelter.dequeueDog().name);
 }