Next: Implementing a New Coordinate Up: Implementing New CoordTransform Classes Previous: init(CoordinateSystem csysboolean forward,

#### `getMetadata(Metadata in, boolean forward, int[] axisIndices)`

After a
[4] `CoordinateSystem` calls a transform's `init()` method, it updates its own `Metadata` list by passing through to the transform's `getMetadata()` method. This method does to the metadata what `forward()` and `reverse()` do to positions: it transforms the metadata to the new system. Often this means updating the values of the ``Axis[n].name'' metadata; however, other metadata may need to be updated or added as well.

For example, the `CelToGalCoordTransform`'s `getMetadata()` will, when assuming the forward direction, will update the appropriate axis name to ``Galactic Longitude''. It also will update the appropriate axis formatter object (i.e. ``Axis[n].formatter'') so that transformed positions will be printed out with a more appropriate format. On the other hand, the `AbsToRelCoordTransform` does not care what kind of axes it operates on, and so it may (depending on how it was constructed) pass the Metadata through unchanged.

The behavior of the `getMetadata()` can be adjusted somewhat without having to override the `getMetadata()`. For instance, the `setName()` method allows one to tell the transform what name to give a particular axis when the transform is applied to a system. Similarly, the `setFormatter()` method sets the `AxisPosFormatter` object to use when formatting the tranformed position. By default, `getMetadata()` will pass the `Metadata` through the transform's `applyNamesAndFormatters()` method to apply any names and formatters that were set prior to attachment. Thus, if you do override the `getMetadata()` method, be sure to call either `super.getMetadata()` or `applyNamesAndFormatters()` within it (usually as the last step of method).