org.olap4j
Enum Axis

java.lang.Object
  extended by java.lang.Enum<Axis>
      extended by org.olap4j.Axis
All Implemented Interfaces:
Serializable, Comparable<Axis>

public enum Axis
extends Enum<Axis>

Enumeration of axis types.

The most commonly used values are COLUMNS (the first axis of a 2-dimensional query), ROWS (the second axis of a 2-dimensional query) and FILTER (also known as the slicer axis, denoted by a WHERE clause in an MDX statement).

Since:
Oct 23, 2006
Author:
jhyde
 

Enum Constant Summary
CHAPTERS
           
COLUMNS
           
FILTER
           
PAGES
           
ROWS
           
SECTIONS
           
UNUSED
           
 
Field Summary
static int MAX_ORDINAL
          The largest legal value for forOrdinal(int).
 
Method Summary
 int axisOrdinal()
          Returns the ordinal which is to be used for retrieving this axis from the CellSet.getAxes(), or retrieving its coordinate from Cell.getCoordinateList().
static Axis forOrdinal(int axisOrdinal)
          Returns the axis with a given axisOrdinal().
 String getCaption(Locale locale)
          Returns localized name for this Axis.
static Axis valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Axis[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNUSED

public static final Axis UNUSED

FILTER

public static final Axis FILTER

COLUMNS

public static final Axis COLUMNS

ROWS

public static final Axis ROWS

PAGES

public static final Axis PAGES

CHAPTERS

public static final Axis CHAPTERS

SECTIONS

public static final Axis SECTIONS
Field Detail

MAX_ORDINAL

public static final int MAX_ORDINAL
The largest legal value for forOrdinal(int).

Method Detail

values

public static Axis[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Axis c : Axis.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Axis 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.)

Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name

axisOrdinal

public int axisOrdinal()
Returns the ordinal which is to be used for retrieving this axis from the CellSet.getAxes(), or retrieving its coordinate from Cell.getCoordinateList().

The axis ordinal is two less than the Enum.ordinal value which every enum value possesses. Hence, UNUSED is -2 and FILTER is -1 (because they are not treated the same as the other axes), COLUMNS is 0, ROWS is 1, and so forth.

Returns:
Axis ordinal

getCaption

public String getCaption(Locale locale)
Returns localized name for this Axis.

Parameters:
locale - Locale for which to give the name
Returns:
localized name for this Axis

forOrdinal

public static Axis forOrdinal(int axisOrdinal)
Returns the axis with a given axisOrdinal().

Parameters:
axisOrdinal - Axis ordinal
Returns:
Axis whose axisOrdinal() is as given

SourceForge.net_Logo