Enum AxesMapper

java.lang.Object
java.lang.Enum<AxesMapper>
org.apache.sis.internal.referencing.AxesMapper
All Implemented Interfaces:
Serializable, Comparable<AxesMapper>, java.lang.constant.Constable

enum AxesMapper extends Enum<AxesMapper>
Maps coordinate axes for a "sub-coordinate system" to the axes of a coordinate systems with more dimensions. This enumeration contains the criterion to apply for matching axes, in priority order.

In current implementation, the enumeration values are used only internally. The useful method is indices(CoordinateSystem, CoordinateSystem).

Since:
1.2
Version:
1.2
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Match axes having opposite direction.
    Match axes of the kind "South along 90° East".
    Match axes having the exact same direction.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final int
    Bitmask for axis direction handled in a special way.
    private static final int
    Bitmask for axis direction handled in a special way.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static long
    clearMask(int dim)
    Returns a mask for clearing the bit associated to the given coordinate system dimension.
    private static boolean
    hasMore(int numBits)
    Returns true if the given value computed by Long.numberOfTrailingZeros(long) means that there is at least one more dimension to process.
    static int[]
    indices(org.opengis.referencing.cs.CoordinateSystem cs, org.opengis.referencing.cs.CoordinateSystem subCS)
    Returns the indices in cs of axes presumed covariant with the subCS axes.
    static AxesMapper
    Returns the enum constant of this type with the specified name.
    static AxesMapper[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • SAME

      public static final AxesMapper SAME
      Match axes having the exact same direction.
    • OPPOSITE

      public static final AxesMapper OPPOSITE
      Match axes having opposite direction.
    • POLAR

      public static final AxesMapper POLAR
      Match axes of the kind "South along 90° East".
  • Field Details

    • EAST

      private static final int EAST
      Bitmask for axis direction handled in a special way. They are the substitute for directions like "South along 90° East". We arbitrarily replace the first direction by East and the second direction by North.
      See Also:
    • NORTH

      private static final int NORTH
      Bitmask for axis direction handled in a special way. They are the substitute for directions like "South along 90° East". We arbitrarily replace the first direction by East and the second direction by North.
      See Also:
  • Constructor Details

    • AxesMapper

      private AxesMapper()
  • Method Details

    • values

      public static AxesMapper[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static AxesMapper valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • indices

      public static int[] indices(org.opengis.referencing.cs.CoordinateSystem cs, org.opengis.referencing.cs.CoordinateSystem subCS)
      Returns the indices in cs of axes presumed covariant with the subCS axes. Directions such as "South along 90°E" are arbitrarily handled as if they were covariant with East and North.

      Limitations

      Current implementation considers only the first 64 dimensions. If there is more dimensions, the extra ones are silently ignored.
      Parameters:
      cs - the coordinate system which contains all axes, or null.
      subCS - the coordinate system to search into cs.
      Returns:
      indices in cs of axes covariant with subCS axes in the order they appear in subCS, or null if at least one subCS axis cannot be mapped to a cs axis.
    • hasMore

      private static boolean hasMore(int numBits)
      Returns true if the given value computed by Long.numberOfTrailingZeros(long) means that there is at least one more dimension to process. This is used for stopping iterations.
    • clearMask

      private static long clearMask(int dim)
      Returns a mask for clearing the bit associated to the given coordinate system dimension.