Package it.unimi.di.prog2.h25.digraph
Class Consumers
java.lang.Object
it.unimi.di.prog2.h25.digraph.Consumers
A collection of
Consumer
s to be used in graph visits.
This class provides some Consumer
s to be used by the DiGraph.visit(Object, Consumer, java.util.function.Supplier)
method.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Consumer<T>
collectConsumer
(Collection<T> result) AConsumer
that adds the visited nodes in the givenCollection
.static <T> Consumer<T>
AConsumer
printing to the standard output every visited node.
-
Constructor Details
-
Consumers
private Consumers()
-
-
Method Details
-
printConsumer
AConsumer
printing to the standard output every visited node.- Type Parameters:
T
- the type of the graph nodes.- Returns:
- the consumer.
-
collectConsumer
AConsumer
that adds the visited nodes in the givenCollection
.- Type Parameters:
T
- the type of the graph nodes.- Parameters:
result
- here will be added the visited nodes.- Returns:
- the consumer.
-