java.lang.Object
org.jgrapht.util.SupplierUtil
Helper class for suppliers.
- Author:
- Dimitrios Michail
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Supplier<DefaultEdge>
Supplier forDefaultEdge
.static final Supplier<DefaultWeightedEdge>
Supplier forDefaultWeightedEdge
.Supplier forObject
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Supplier<DefaultEdge>
Create a default edge supplier.static Supplier<DefaultWeightedEdge>
Create a default weighted edge supplier.Create an integer supplier which returns a sequence starting from zero.createIntegerSupplier
(int start) Create an integer supplier which returns a sequence starting from a specific numbers.Create a long supplier which returns a sequence starting from zero.createLongSupplier
(long start) Create a long supplier which returns a sequence starting from a specific numbers.Create a string supplier which returns random UUIDs.Create a string supplier which returns unique strings.createStringSupplier
(int start) Create a string supplier which returns unique strings.static <T> Supplier<T>
createSupplier
(Class<? extends T> clazz) Create a supplier from a class which calls the default constructor.
-
Field Details
-
DEFAULT_EDGE_SUPPLIER
Supplier forDefaultEdge
. -
DEFAULT_WEIGHTED_EDGE_SUPPLIER
Supplier forDefaultWeightedEdge
. -
OBJECT_SUPPLIER
Supplier forObject
.
-
-
Constructor Details
-
SupplierUtil
public SupplierUtil()
-
-
Method Details
-
createSupplier
Create a supplier from a class which calls the default constructor.- Type Parameters:
T
- the type of results supplied by this supplier- Parameters:
clazz
- the class- Returns:
- the supplier
-
createDefaultEdgeSupplier
Create a default edge supplier.- Returns:
- a default edge supplier
-
createDefaultWeightedEdgeSupplier
Create a default weighted edge supplier.- Returns:
- a default weighted edge supplier
-
createIntegerSupplier
Create an integer supplier which returns a sequence starting from zero.- Returns:
- an integer supplier
-
createIntegerSupplier
Create an integer supplier which returns a sequence starting from a specific numbers.- Parameters:
start
- where to start the sequence- Returns:
- an integer supplier
-
createLongSupplier
Create a long supplier which returns a sequence starting from zero.- Returns:
- a long supplier
-
createLongSupplier
Create a long supplier which returns a sequence starting from a specific numbers.- Parameters:
start
- where to start the sequence- Returns:
- a long supplier
-
createStringSupplier
Create a string supplier which returns unique strings. The returns strings are simply integers starting from zero.- Returns:
- a string supplier
-
createRandomUUIDStringSupplier
Create a string supplier which returns random UUIDs.- Returns:
- a string supplier
-
createStringSupplier
Create a string supplier which returns unique strings. The returns strings are simply integers starting from start.- Parameters:
start
- where to start the sequence- Returns:
- a string supplier
-