public abstract class AbstractCustomizable extends Object implements Adaptable, Customizable
Adaptable
and Customizable
interfaces,
providing some useful common behaviors. Implementors of metamodel-specific
environments are encourage to extend this class rather than implement
an evaluation environment "from scratch."
Constructor and Description |
---|
AbstractCustomizable() |
Modifier and Type | Method and Description |
---|---|
Map<Option<?>,Object> |
clearOptions()
Clears all options.
|
<T> T |
getAdapter(Class<T> adapterType)
Implements the interface method by testing whether I am an instance of
the requested adapter type.
|
Map<Option<?>,Object> |
getOptions()
Obtains a copy of my map of options.
|
<T> T |
getValue(Option<T> option)
Obtains the value of the specified option's setting in the my
options map.
|
boolean |
isEnabled(Option<Boolean> option)
Queries whether the specified boolean-valued option is enabled.
|
<T> void |
putOptions(Map<? extends Option<T>,? extends T> newOptions)
Adds options to apply to my behaviour.
|
<T> T |
removeOption(Option<T> option)
Removes the specified option.
|
<T> Map<Option<T>,T> |
removeOptions(Collection<Option<T>> unwantedOptions)
Removes the specified options.
|
<T> void |
setOption(Option<T> option,
T value)
Add an option to apply to my behaviour.
|
public Map<Option<?>,Object> clearOptions()
Customizable
clearOptions
in interface Customizable
public <T> T getAdapter(Class<T> adapterType)
getAdapter
in interface Adaptable
T
- the requested adapter interfaceadapterType
- the requested adapter interfacenull
if this environment does not adapt to itpublic Map<Option<?>,Object> getOptions()
Customizable
getOptions
in interface Customizable
public <T> T getValue(Option<T> option)
Customizable
getValue
in interface Customizable
option
- the option to querypublic boolean isEnabled(Option<Boolean> option)
Customizable
isEnabled
in interface Customizable
option
- an optionpublic <T> void putOptions(Map<? extends Option<T>,? extends T> newOptions)
Customizable
putOptions
in interface Customizable
newOptions
- the optionspublic <T> T removeOption(Option<T> option)
Customizable
removeOption
in interface Customizable
option
- the option to removepublic <T> Map<Option<T>,T> removeOptions(Collection<Option<T>> unwantedOptions)
Customizable
removeOptions
in interface Customizable
unwantedOptions
- the options to removepublic <T> void setOption(Option<T> option, T value)
Customizable
setOption
in interface Customizable
option
- the optionvalue
- the option's valueCopyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.