Package org.apache.commons.math3.ode
Class AbstractParameterizable
- java.lang.Object
-
- org.apache.commons.math3.ode.AbstractParameterizable
-
- All Implemented Interfaces:
Parameterizable
public abstract class AbstractParameterizable extends java.lang.Object implements Parameterizable
This abstract class provides boilerplate parameters list.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Collection<java.lang.String>parametersNamesList of the parameters names.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractParameterizable(java.lang.String... names)Simple constructor.protectedAbstractParameterizable(java.util.Collection<java.lang.String> names)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplainIfNotSupported(java.lang.String name)Check if a parameter is supported and throw an IllegalArgumentException if not.java.util.Collection<java.lang.String>getParametersNames()Get the names of the supported parameters.booleanisSupported(java.lang.String name)Check if a parameter is supported.
-
-
-
Constructor Detail
-
AbstractParameterizable
protected AbstractParameterizable(java.lang.String... names)
Simple constructor.- Parameters:
names- names of the supported parameters
-
AbstractParameterizable
protected AbstractParameterizable(java.util.Collection<java.lang.String> names)
Simple constructor.- Parameters:
names- names of the supported parameters
-
-
Method Detail
-
getParametersNames
public java.util.Collection<java.lang.String> getParametersNames()
Get the names of the supported parameters.- Specified by:
getParametersNamesin interfaceParameterizable- Returns:
- parameters names
- See Also:
Parameterizable.isSupported(String)
-
isSupported
public boolean isSupported(java.lang.String name)
Check if a parameter is supported.Supported parameters are those listed by
Parameterizable.getParametersNames().- Specified by:
isSupportedin interfaceParameterizable- Parameters:
name- parameter name to check- Returns:
- true if the parameter is supported
- See Also:
Parameterizable.getParametersNames()
-
complainIfNotSupported
public void complainIfNotSupported(java.lang.String name) throws UnknownParameterExceptionCheck if a parameter is supported and throw an IllegalArgumentException if not.- Parameters:
name- name of the parameter to check- Throws:
UnknownParameterException- if the parameter is not supported- See Also:
isSupported(String)
-
-