public class OperatorRegistry extends Object implements IOperatorRegistry
IOperatorRegistry.
The OperatorRegistry is designed as singleton.
| Modifier and Type | Field and Description |
|---|---|
private ArrayList<Class<IOperatorDescriptor>> |
descriptors
The descriptor object associated with the name.
|
private ArrayList<Class<IOperatorGUI>> |
guis
The operator GUI object associated with the name.
|
private static org.apache.log4j.Logger |
logger |
private ArrayList<String> |
names
The operator names.
|
private ArrayList<Class<IOperator>> |
operators
The operator object associated with the name.
|
private ArrayList<StackProcessingType> |
stackProcessingTypes
The stack processing type associated with the name.
|
private ArrayList<OperatorType> |
types
The operator type object associated with the name.
|
private ArrayList<Class<IOperatorValidator>> |
validators
The operator validator object associated with the name.
|
| Modifier | Constructor and Description |
|---|---|
private |
OperatorRegistry()
The default constructor is set private since this object is a singleton.
|
| Modifier and Type | Method and Description |
|---|---|
Class<IOperatorDescriptor> |
getDescriptor(String name)
Gets the descriptor of an operator by name.
|
static IOperatorRegistry |
getInstance()
Returns the reference to this singleton.
|
List<String> |
getNames()
Gets the list of registered names from the registry.
|
Class<IOperator> |
getOperator(String name)
Gets an operator by name.
|
Class<IOperatorGUI> |
getOperatorGUI(String name)
Gets the GUI of an operator by name.
|
Class<IOperatorValidator> |
getOperatorValidator(String name)
Gets the validator of an operator by name.
|
StackProcessingType |
getStackProcessingType(String name)
Gets the
StackProcessingType of an operator by name. |
OperatorType |
getType(String name)
Gets the type of an operator by name.
|
int |
indexOf(String name)
Gets the index of a given operator name from the registry.
|
boolean |
isRegistered(String name)
Checks whether or not a given name is registered with this registry
|
void |
register(String name,
Class opDesc,
Class op,
Class opGUI,
Class opVal,
OperatorType type,
StackProcessingType stackProcessingType)
Adds a new operator to the registry using the unique name associated with
the
IOperatorDescriptor. |
void |
unRegister(String name)
Removes an operator from the registry using the unique name.
|
void |
updateRegistryEntry(String name)
Updates a registry entry and re-registers the
IOperatorDescriptor
with the same name in the registry. |
private static final org.apache.log4j.Logger logger
private ArrayList<Class<IOperatorDescriptor>> descriptors
private ArrayList<Class<IOperator>> operators
private ArrayList<Class<IOperatorValidator>> validators
private ArrayList<Class<IOperatorGUI>> guis
private ArrayList<OperatorType> types
private ArrayList<StackProcessingType> stackProcessingTypes
private OperatorRegistry()
The reference to the operator registry can be retrieved using
getInstance().
public static IOperatorRegistry getInstance()
public int indexOf(String name) throws NoSuchElementException
name - NoSuchElementException - if no such name is found in the registrypublic void register(String name, Class opDesc, Class op, Class opGUI, Class opVal, OperatorType type, StackProcessingType stackProcessingType)
IOperatorRegistryIOperatorDescriptor.register in interface IOperatorRegistrypublic void updateRegistryEntry(String name) throws NoSuchElementException
IOperatorRegistryIOperatorDescriptor
with the same name in the registry.updateRegistryEntry in interface IOperatorRegistryname - the operator nameNoSuchElementExceptionpublic void unRegister(String name) throws NoSuchElementException
IOperatorRegistryunRegister in interface IOperatorRegistryNoSuchElementException - if the provided name is not found in the registrypublic Class<IOperatorDescriptor> getDescriptor(String name) throws NoSuchElementException
IOperatorRegistrygetDescriptor in interface IOperatorRegistryname - the operator nameClass of the descriptorNoSuchElementException - if the provided name is not found in the registrypublic Class<IOperator> getOperator(String name) throws NoSuchElementException
IOperatorRegistrygetOperator in interface IOperatorRegistryname - the operator nameClass of the operatorNoSuchElementException - if the provided name is not found in the registrypublic Class<IOperatorGUI> getOperatorGUI(String name) throws NoSuchElementException
IOperatorRegistrygetOperatorGUI in interface IOperatorRegistryname - the name of the operatorClass of the operator GUINoSuchElementException - if the provided name is not found in the registrypublic Class<IOperatorValidator> getOperatorValidator(String name) throws NoSuchElementException
IOperatorRegistrygetOperatorValidator in interface IOperatorRegistryname - the name of the operatorClass of the operator validatorNoSuchElementException - if the provided name is not found in the registrypublic OperatorType getType(String name) throws NoSuchElementException
IOperatorRegistrygetType in interface IOperatorRegistryOperatorTypeNoSuchElementExceptionpublic List<String> getNames()
IOperatorRegistrygetNames in interface IOperatorRegistryList of operator namespublic StackProcessingType getStackProcessingType(String name) throws NoSuchElementException
IOperatorRegistryStackProcessingType of an operator by name.getStackProcessingType in interface IOperatorRegistryStackProcessingTypeNoSuchElementExceptionpublic boolean isRegistered(String name)
IOperatorRegistryisRegistered in interface IOperatorRegistryname - the operator nametrue, if the name is registered, false,
if notCopyright © 2009–2017 Helmut Ahammer, Philipp Kainz. All rights reserved.