Package org.moeaframework.core.spi
Class IndirectAlgorithmProvider
java.lang.Object
org.moeaframework.core.spi.AlgorithmProvider
org.moeaframework.core.spi.IndirectAlgorithmProvider
Algorithm provider that avoids creating runtime dependencies on external libraries. It accomplishes this by
attempting to load the class dynamically and, if unable to do so, treats it as if the provider simply does not exist.
-
Constructor Summary
ConstructorDescriptionIndirectAlgorithmProvider
(String className) Creates an indirect provider for the given algorithm provider. -
Method Summary
Modifier and TypeMethodDescriptiongetAlgorithm
(String name, TypedProperties properties, Problem problem) Returns the algorithm with the specified name, ornull
if this provider does not support the algorithm.Methods inherited from class org.moeaframework.core.spi.AlgorithmProvider
getDiagnosticToolAlgorithms
-
Constructor Details
-
IndirectAlgorithmProvider
Creates an indirect provider for the given algorithm provider.- Parameters:
className
- the fully-qualified class name for the algorithm provider we want to reference without creating runtime dependencies
-
-
Method Details
-
getAlgorithm
Description copied from class:AlgorithmProvider
Returns the algorithm with the specified name, ornull
if this provider does not support the algorithm. An optional set of properties may be provided to further define the algorithm; however, the provider is expected to supply default properties if none are provided.- Specified by:
getAlgorithm
in classAlgorithmProvider
- Parameters:
name
- the algorithm nameproperties
- optional properties for the algorithmproblem
- the problem- Returns:
- the algorithm with the specified name, or
null
if this provider does not support the algorithm
-