Package uk.ac.starlink.array
Class Order
java.lang.Object
uk.ac.starlink.array.Order
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 -
Method Summary
-
Field Details
-
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
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
-
allOrders
Returns a list of all the known ordering schemes.- Returns:
- an unmodifiable List containing all the existing Order objects.
-