Package uk.ac.starlink.array
Class Order
- java.lang.Object
-
- uk.ac.starlink.array.Order
-
public class Order extends java.lang.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 Order
COLUMN_MAJOR
Object representing column-major (first-index-fastest) ordering.static Order
ROW_MAJOR
Object representing row-major (last-index-fastest) ordering.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List
allOrders()
Returns a list of all the known ordering schemes.boolean
isFitsLike()
Convenience method which returns true for ordering which is FITS-like and Fortran-like (that is for COLUMN_MAJOR), otherwise false.java.lang.String
toString()
-
-
-
Field Detail
-
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 Detail
-
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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
allOrders
public static java.util.List allOrders()
Returns a list of all the known ordering schemes.- Returns:
- an unmodifiable List containing all the existing Order objects.
-
-