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 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(String txt, uk.ac.starlink.task.Parameter<?> txtParam, uk.ac.starlink.task.ChoiceParameter<Combiner> combinerParam) throws uk.ac.starlink.task.ParameterValueException
      Parses an input expression to a CombinedColumn value.
      Parameters:
      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, uk.ac.starlink.task.Parameter<Combiner> 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