# Class Suffixer

java.lang.Object
uk.ac.starlink.ttools.plot2.task.Suffixer

public abstract class Suffixer extends Object
Object that defines how groups of (parameter) suffixes are constructed.

Since:
  14 Sep 2017
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`Suffixer()`

## Method Summary

Modifier and Type
Method
Description
`static Suffixer`
`createAlphaSuffixer(String name, String separator, boolean isBlank1, boolean isUpper)`
Returns an instance that generates alphabetic suffixes a, b, c, ...
`static Suffixer`
`createNumericSuffixer(String name, String separator, boolean isBlank1)`
Returns an instance that generates numeric suffixes 1, 2, 3, ...
`abstract List<String>`
`createSuffixes(int n)`
Returns a list of suffixes according to this object's policy.

### Methods inherited from class Object

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

## Constructor Details

### Suffixer

public Suffixer()

## Method Details

### createSuffixes

public abstract List<String> createSuffixes(int n)
Returns a list of suffixes according to this object's policy. Note that, because of the way that these suffixes are used in STILTS plotting commands, no suffix in the returned list should contain any other suffix as a leading substring. Making all the elements the same length and unique is a straightforward way to ensure this, for instance by using something like leading zeroes.

Parameters:
  `n` - number of suffixes required
Returns:
  `n`-element list

### createNumericSuffixer

public static Suffixer createNumericSuffixer(String name, String separator, boolean isBlank1)
Returns an instance that generates numeric suffixes 1, 2, 3, ... prepended with an optional supplied separator string. Leading zeroes are used when the number of suffixes requied is greater than 9.

Parameters:
  `name` - suffixer name
  `separator` - string to prepend to all non-blank suffixes, may be null
  `isBlank1` - if true, then a request for a single-element suffix list will be treated specially, giving an empty string
Returns:
  new suffixer

### createAlphaSuffixer

public static Suffixer createAlphaSuffixer(String name, String separator, boolean isBlank1, boolean isUpper)
Returns an instance that generates alphabetic suffixes a, b, c, ... If there are more than 26, letters are repeated (the output is actually in base 26 with digits 'a'-'z').

Parameters:
  `name` - suffixer name
  `separator` - string to prepend to all non-blank suffixes, may be null
  `isBlank1` - if true, then a request for a single-element suffix list will be treated specially, giving an empty string
  `isUpper` - true for upper case letters, false for lower case
Returns:
  new suffixer