# Class AngleColumnConverter

java.lang.Object
uk.ac.starlink.topcat.ColumnConverter
uk.ac.starlink.topcat.AngleColumnConverter

public abstract class AngleColumnConverter extends ColumnConverter
ColumnConverter that knows how to deal with angles. It provides an additional method, `angleExpression(String, AngleColumnConverter.Unit)`, that's useful when assembling stilts command lines.

Since:
  18 Sep 2024
Author:
  Mark Taylor

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`AngleColumnConverter.Unit`
Angular units understood by this converter.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`AngleColumnConverter(String name)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`abstract String`
`angleExpression(String inExpr, AngleColumnConverter.Unit toUnit)`
Returns a JEL expression that converts an an input value suitable for input to this converter to a value in the supplied angle unit.
`static String`
`angleExpression(AngleColumnConverter.Unit fromUnit, AngleColumnConverter.Unit toUnit, String inExpr)`
Converts a JEL expression assumed in a given input unit to an expression that will evaluate to the value in the given output unit.
`static AngleColumnConverter`
`toRadianConverter(AngleColumnConverter.Unit fromUnit)`
Creates a converter that converts to radians from a given angular unit.
`String`
`toString()`
Provides a user-understandable description of what this converter does.

### Methods inherited from class ColumnConverter

`convertExpression, convertValue, getConverters`

### Methods inherited from class Object

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

## Constructor Details

### AngleColumnConverter

protected AngleColumnConverter(String name)
Constructor.

Parameters:
  `name` - converter name, will appear in GUI

## Method Details

### angleExpression

public abstract String angleExpression(String inExpr, AngleColumnConverter.Unit toUnit)
Returns a JEL expression that converts an an input value suitable for input to this converter to a value in the supplied angle unit.

Parameters:
  `inExpr` - input expression, assumed JEL-friendly
  `toUnit` - output angular unit
Returns:
  JEL expression evaluating to angular value in supplied unit

### toString

public String toString()
Description copied from class: `ColumnConverter`
Provides a user-understandable description of what this converter does. Must be enough to distinguish it from distinct converters which might do the same sort of thing.

Specified by:
  `toString` in class `ColumnConverter`

### toRadianConverter

public static AngleColumnConverter toRadianConverter(AngleColumnConverter.Unit fromUnit)
Creates a converter that converts to radians from a given angular unit.

Parameters:
  `fromUnit` - input unit
Returns:
  converter

### angleExpression

public static String angleExpression(AngleColumnConverter.Unit fromUnit, AngleColumnConverter.Unit toUnit, String inExpr)
Converts a JEL expression assumed in a given input unit to an expression that will evaluate to the value in the given output unit.

Parameters:
  `fromUnit` - input angular unit
  `toUnit` - output angular unit
  `inExpr` - input expression, assumed JEL-friendly
Returns:
  compact JEL expression