Package it.unimi.di.prog2.h25
Class Queues
java.lang.Object
it.unimi.di.prog2.h25.Queues
A collection of utilities related to
Queues
s.
This class provides Supplier
s and wrappers to Queue
s to be used by the DiGraph.visit(Object, Consumer, java.util.function.Supplier)
method.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Queues
private Queues()
-
-
Method Details
-
LIFOSupplier
- Type Parameters:
T
- the type of the graph nodes.- Returns:
- the supplier.
-
FIFOSupplier
- Type Parameters:
T
- the type of the graph nodes.- Returns:
- the supplier.
-
once
Wraps aQueue
making it a once queue.A once queue is a queue where every element can be added just once.
- Type Parameters:
T
- the type of the graph nodes.- Parameters:
queue
- the queue to be wrapped.- Returns:
- the wrapped queue.
-