next up previous contents
Next: init(CoordinateSystem csysboolean forward, Up: Implementing New CoordTransform Classes Previous: getInAxes()getOutAxes()

determineConstraints(Metadata in, boolean forwards)

This method makes an educated guess as to how to apply itself to a CoordinateSystem that is described by a given set of metadata and returns that guess in the form of a CoordTransformConstraints object. If the boolean input forwards is true, then it should assume the transform will be applied in the forward direction; otherwise, it should assume the reverse direction. This method is called by a CoordinateSystem object when the transform gets attached to it via the attachTransform(CoordTransform) or attachTransform(CoordTransform, boolean) methods;
[0] that is, when you call one of these methods, you have asked the CoordinateSystem to attach the transform in a way seems sensible. (Note that there may exist several ``sensible'' ways; this method only returns one of them.)

As an example, consider a transform that operates on a longitude and latitude; this method should then search the Metadata for values of the ``Axis[n].type'' equal to ``longitude'' and ``latitude'' and create an Axis Index List that picks out these axes. If it operates on a declination axis-a kind of latitude axis-it might instead look for values of the ``Axis[n].name'' equal to ``declination''. If it cannot find the axes it is looking for, or if the Metadata does not have other needed data, and therefore cannot determine how to apply the transform, this method should return null.

If the transform does not care what axes it operates on or what order they are in, it can return constraints with a ``trivial'' Axis Index List. That is, the list will be an array containing the sequence of integers from 0 to the number of axes (minus one) that the Metadata list claims it has. In fact, this is the default implementation; so if this applies to your new transform, there is no need to override this method.


next up previous contents
Next: init(CoordinateSystem csysboolean forward, Up: Implementing New CoordTransform Classes Previous: getInAxes()getOutAxes()

Ray Plante
Mon Aug 25 15:16:12 CDT 1997