# Class CombinedColumn

java.lang.Object
uk.ac.starlink.ttools.task.CombinedColumn

public class CombinedColumn extends Object
Describes an output column formed by aggregation of values from an input expression.

Since:
  21 Dec 2021
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`CombinedColumn(String expr, Combiner combiner, String name)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`static StringMultiParameter`
`createCombinedColumnsParameter(String name, CombinerParameter dfltCombinerParam)`
Creates a parameter for specifying aggregate columns.
`Combiner`
`getCombiner()`
Returns the aggregation method.
`String`
`getExpression()`
Returns the expression to be aggregated.
`String`
`getName()`
Returns the output column name.
`static CombinedColumn`
`parseSpecification(uk.ac.starlink.task.Environment env, String txt, uk.ac.starlink.task.Parameter<?> txtParam, CombinerParameter combinerParam)`
Parses an input expression to a CombinedColumn value.

### Methods inherited from class Object

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

## Constructor Details

### CombinedColumn

public CombinedColumn(String expr, Combiner combiner, String name)
Constructor.

Parameters:
  `expr` - expression to be aggregated
  `combiner` - aggregation method, may be null to indicate default
  `name` - name of output column, may be null to indicate default

## Method Details

### getExpression

public String getExpression()
Returns the expression to be aggregated.

Returns:
  input column name or expression, not null

### getCombiner

public Combiner getCombiner()
Returns the aggregation method.

Returns:
  aggregation method, or null to indicate default

### getName

public String getName()
Returns the output column name.

Returns:
  output name, or null to indicate default

### parseSpecification

public static CombinedColumn parseSpecification(uk.ac.starlink.task.Environment env, String txt, uk.ac.starlink.task.Parameter<?> txtParam, CombinerParameter combinerParam) throws uk.ac.starlink.task.ParameterValueException
Parses an input expression to a CombinedColumn value.

Parameters:
  `env` - execution environment
  `txt` - input expression
  `txtParam` - parameter supplying input value, used for reference in thrown exceptions
  `combinerParam` - parameter supplying combiner values, used to decode combiner specifications
Throws:
  `uk.ac.starlink.task.ParameterValueException`

### createCombinedColumnsParameter

public static StringMultiParameter createCombinedColumnsParameter(String name, CombinerParameter dfltCombinerParam)
Creates a parameter for specifying aggregate columns. The parameter return value is an array of strings, each of which can be parsed using the `parseSpecification` method.

Parameters:
  `name` - parameter name
  `dfltCombinerParam` - parameter used for specifying default aggregation method, used in documentation