Class Order

java.lang.Object
uk.ac.starlink.array.Order

public class Order extends Object
Pixel ordering identifier. Objects in this class are used to identify the ordering of pixels when they are presented as a vectorised array.

This class exemplifies the typesafe enum pattern -- the only possible instances are supplied as static final fields of the class, and these instances are immutable.

Version:
$Id$
Author:
Mark Taylor (Starlink)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Order
    Object representing column-major (first-index-fastest) ordering.
    static final Order
    Object representing row-major (last-index-fastest) ordering.
  • Method Summary

    Modifier and Type
    Method
    Description
    static List
    Returns a list of all the known ordering schemes.
    boolean
    Convenience method which returns true for ordering which is FITS-like and Fortran-like (that is for COLUMN_MAJOR), otherwise false.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • COLUMN_MAJOR

      public static final Order COLUMN_MAJOR
      Object representing column-major (first-index-fastest) ordering. This is how FITS data is organised, and is natural to Fortran. The pixels of an array with origin=(1,1) and dims=(2,2) with this ordering would be vectorised in the order (1,1), (2,1), (1,2), (2,2).
    • ROW_MAJOR

      public static final Order ROW_MAJOR
      Object representing row-major (last-index-fastest) ordering. Row-major order, in which the last index varies fastest. it is natural to C-like languages (though such languages generally lack true multi-dimensional rectangular arrays).
  • Method Details

    • isFitsLike

      public boolean isFitsLike()
      Convenience method which returns true for ordering which is FITS-like and Fortran-like (that is for COLUMN_MAJOR), otherwise false.
      Returns:
      true for COLUMN_MAJOR, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • allOrders

      public static List allOrders()
      Returns a list of all the known ordering schemes.
      Returns:
      an unmodifiable List containing all the existing Order objects.