# Class StyleFactory

java.lang.Object
uk.ac.starlink.ttools.plottask.StyleFactory

Direct Known Subclasses:
  `BarStyleFactory, MarkStyleFactory`

public abstract class StyleFactory extends Object
Defines an object which can obtain a `Style` object from the environment.

Since:
  8 Aug 2008
Author:
  Mark Taylor

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`StyleFactory(String prefix)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`abstract uk.ac.starlink.task.Parameter<?>[]`
`getParameters(String stSuffix)`
Returns the parameters used by this factory.
`abstract Style`
`getStyle(uk.ac.starlink.task.Environment env, String stSuffix)`
Obtains a Style object from the environment by examining parameters.
`int`
`getStyleIndex(String suffix)`
Returns a zero-based index associated with a given suffix for this factory.
`String`
`paramName(String baseName, String stSuffix)`
Assembles a parameter name from a base name and a dataset suffix.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### StyleFactory

protected StyleFactory(String prefix)
Constructor.

Parameters:
  `prefix` - prefix to be prepended to all parameters used by this factory

## Method Details

### getParameters

public abstract uk.ac.starlink.task.Parameter<?>[] getParameters(String stSuffix)
Returns the parameters used by this factory.

Parameters:
  `stSuffix` - label identifying the data set for which the style will be required

### getStyle

public abstract Style getStyle(uk.ac.starlink.task.Environment env, String stSuffix) throws uk.ac.starlink.task.TaskException
Obtains a Style object from the environment by examining parameters.

Parameters:
  `env` - execution environment
  `stSuffix` - label identifying the data set for which the style is required
Returns:
  plotting style
Throws:
  `uk.ac.starlink.task.TaskException`

### paramName

public String paramName(String baseName, String stSuffix)
Assembles a parameter name from a base name and a dataset suffix.

Parameters:
  `baseName` - parameter base name
  `stSuffix` - label identifying dataset
Returns:
  parameter name

### getStyleIndex

public int getStyleIndex(String suffix)
Returns a zero-based index associated with a given suffix for this factory. The same suffix will always give the same result.

Parameters:
  `suffix` - identifier
Returns:
  identifier index