org.grinvin.factories

Class AbstractFactory

Implemented Interfaces:
Factory
Known Direct Subclasses:
AbstractInvariantComputerFactory, AbstractNamedFactory

public class AbstractFactory
extends java.lang.Object
implements Factory

Provides classes and interfaces for general factories.

Basic concepts

This package introduces the concept of a factory. These factories can be used to create graphs or invariants of a certain kind. All factories are represented as objects of type Factory and can have certain parameters set.
See Also:
org.grinvin.params

Field Summary

protected ParameterList
list
protected String[]
valueStrings
protected Object[]
values

Method Summary

protected void
checkParameters(Object[] values)
Check whether all parameters were properly initialized.
Object[]
getParameterValues()
Return the (current) parameter values.
ParameterList
getParameters()
Returns the list of parameters accepted by this factory.
String
getParametersAsString()
Convert the current parameters to a 'query' string, which is usually used as a suffix of an identifier or URI for the object created by this factory.
void
setParameterValues(Object[] values)
Initialize the factory with new parameter values.

Field Details

list

protected ParameterList list

valueStrings

protected String[] valueStrings

values

protected Object[] values

Method Details

checkParameters

protected void checkParameters(Object[] values)
            throws FactoryParameterException
Check whether all parameters were properly initialized. Can be overridden by client. This implementation simply checks whether all parameters have been given a value.
Throws:
FactoryParameterException - when the parameters were not properly initialized or invalid.

getParameterValues

public Object[] getParameterValues()
Return the (current) parameter values.
Specified by:
getParameterValues in interface Factory

getParameters

public ParameterList getParameters()
Returns the list of parameters accepted by this factory.
Specified by:
getParameters in interface Factory

getParametersAsString

public String getParametersAsString()
Convert the current parameters to a 'query' string, which is usually used as a suffix of an identifier or URI for the object created by this factory.

setParameterValues

public void setParameterValues(Object[] values)
            throws FactoryParameterException
Initialize the factory with new parameter values.
Specified by:
setParameterValues in interface Factory