org.cts.cs
Class CoordinateSystem

java.lang.Object
  extended by org.cts.cs.CoordinateSystem

public class CoordinateSystem
extends Object

A CoordinateSystem is a set of ordered Axis defining how coordinates assigned to a point have to be interpreted.

Author:
Michaƫl Michaud

Constructor Summary
CoordinateSystem(Axis[] axes, Unit[] units)
          Create a new Coordinate System from an array of Axis
 
Method Summary
 String format(double[] coord)
          Return a String representation of this coordinate in this CoordinateSystem.
 Axis getAxis(int i)
          Return the Axis with index i of this CoordinateSystem.
 int getDimension()
          Return the axes number of this CoordinateSystem.
 int getIndex(Axis axis)
          Return the index of Axis axis or -1 if axis is not part of this CoordinateSystem.
 Unit getUnit(int i)
          Return the Unit for Axis with index i of this CoordinateSystem.
 String toString()
          Return a String representation of this CoordinateSystem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoordinateSystem

public CoordinateSystem(Axis[] axes,
                        Unit[] units)
Create a new Coordinate System from an array of Axis

Parameters:
axes - the array of axes defining this CoordinateSystem
units - the units used by coordinates, defined in the same order as axes.
Method Detail

getAxis

public Axis getAxis(int i)
             throws ArrayIndexOutOfBoundsException
Return the Axis with index i of this CoordinateSystem.

Parameters:
i - index of the Axis to return
Throws:
ArrayIndexOutOfBoundsException

getUnit

public Unit getUnit(int i)
             throws ArrayIndexOutOfBoundsException
Return the Unit for Axis with index i of this CoordinateSystem.

Parameters:
i - index of the Axis for which Unit is returned
Throws:
ArrayIndexOutOfBoundsException

getDimension

public int getDimension()
Return the axes number of this CoordinateSystem.


getIndex

public int getIndex(Axis axis)
Return the index of Axis axis or -1 if axis is not part of this CoordinateSystem. If there is many axes of the CoordinateSystem equals to the axis in argument, the minimum index of these axes is returned.

Parameters:
axis - the axis whose index is looked for

format

public String format(double[] coord)
              throws CoordinateDimensionException
Return a String representation of this coordinate in this CoordinateSystem.

Parameters:
coord - the coordinate to format
Throws:
CoordinateDimensionException

toString

public String toString()
Return a String representation of this CoordinateSystem.

Overrides:
toString in class Object


Copyright © 2014 IRSTV CNRS-FR-2488. All Rights Reserved.