java.lang.Object
org.jgrapht.util.SupplierUtil
public class SupplierUtil
extends java.lang.Object
Helper class for suppliers.
- Author:
- Dimitrios Michail
-
Field Summary
Fields Modifier and Type Field Description static java.util.function.Supplier<DefaultEdge>DEFAULT_EDGE_SUPPLIERSupplier forDefaultEdge.static java.util.function.Supplier<DefaultWeightedEdge>DEFAULT_WEIGHTED_EDGE_SUPPLIERSupplier forDefaultWeightedEdge.static java.util.function.Supplier<java.lang.Object>OBJECT_SUPPLIERSupplier forObject. -
Constructor Summary
Constructors Constructor Description SupplierUtil() -
Method Summary
Modifier and Type Method Description static java.util.function.Supplier<DefaultEdge>createDefaultEdgeSupplier()Create a default edge supplier.static java.util.function.Supplier<DefaultWeightedEdge>createDefaultWeightedEdgeSupplier()Create a default weighted edge supplier.static java.util.function.Supplier<java.lang.Integer>createIntegerSupplier()Create an integer supplier which returns a sequence starting from zero.static java.util.function.Supplier<java.lang.Integer>createIntegerSupplier(int start)Create an integer supplier which returns a sequence starting from a specific numbers.static java.util.function.Supplier<java.lang.Long>createLongSupplier()Create a long supplier which returns a sequence starting from zero.static java.util.function.Supplier<java.lang.Long>createLongSupplier(long start)Create a long supplier which returns a sequence starting from a specific numbers.static java.util.function.Supplier<java.lang.String>createRandomUUIDStringSupplier()Create a string supplier which returns random UUIDs.static java.util.function.Supplier<java.lang.String>createStringSupplier()Create a string supplier which returns unique strings.static java.util.function.Supplier<java.lang.String>createStringSupplier(int start)Create a string supplier which returns unique strings.static <T> java.util.function.Supplier<T>createSupplier(java.lang.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
public static final java.util.function.Supplier<java.lang.Object> OBJECT_SUPPLIERSupplier forObject.
-
-
Constructor Details
-
SupplierUtil
public SupplierUtil()
-
-
Method Details
-
createSupplier
public static <T> java.util.function.Supplier<T> createSupplier(java.lang.Class<? extends T> clazz)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
public static java.util.function.Supplier<java.lang.Integer> createIntegerSupplier()Create an integer supplier which returns a sequence starting from zero.- Returns:
- an integer supplier
-
createIntegerSupplier
public static java.util.function.Supplier<java.lang.Integer> createIntegerSupplier(int start)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
public static java.util.function.Supplier<java.lang.Long> createLongSupplier()Create a long supplier which returns a sequence starting from zero.- Returns:
- a long supplier
-
createLongSupplier
public static java.util.function.Supplier<java.lang.Long> createLongSupplier(long start)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
public static java.util.function.Supplier<java.lang.String> createStringSupplier()Create a string supplier which returns unique strings. The returns strings are simply integers starting from zero.- Returns:
- a string supplier
-
createRandomUUIDStringSupplier
public static java.util.function.Supplier<java.lang.String> createRandomUUIDStringSupplier()Create a string supplier which returns random UUIDs.- Returns:
- a string supplier
-
createStringSupplier
public static java.util.function.Supplier<java.lang.String> createStringSupplier(int start)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
-