Class CellKey.Many

java.lang.Object
mondrian.rolap.CellKey.Many
All Implemented Interfaces:
Serializable, CellKey
Enclosing interface:
CellKey

public static class CellKey.Many extends Object implements CellKey
See Also:
  • Constructor Details

    • Many

      protected Many(int[] ordinals)
      Creates a Many.
      Parameters:
      ordinals - Ordinates
  • Method Details

    • size

      public final int size()
      Description copied from interface: CellKey
      Returns the number of axes.
      Specified by:
      size in interface CellKey
      Returns:
      number of axes
    • setOrdinals

      public final void setOrdinals(int[] pos)
      Description copied from interface: CellKey
      This method make a copy of the int array parameter. Throws a RuntimeException if the int array size is not the size of the CellKey.
      Specified by:
      setOrdinals in interface CellKey
      Parameters:
      pos - Array of axis keys
    • getOrdinals

      public final int[] getOrdinals()
      Description copied from interface: CellKey
      Returns the axis keys as an array.

      Note: caller should treat the array as immutable. If the contents of the array are modified, behavior is unspecified.

      Specified by:
      getOrdinals in interface CellKey
      Returns:
      Array of axis keys
    • setAxis

      public void setAxis(int axis, int value)
      Description copied from interface: CellKey
      Sets a given axis.
      Specified by:
      setAxis in interface CellKey
      Parameters:
      axis - Axis ordinal
      value - Value
    • getAxis

      public int getAxis(int axis)
      Description copied from interface: CellKey
      Returns the axisth axis value.
      Specified by:
      getAxis in interface CellKey
      Parameters:
      axis - Axis ordinal
      Returns:
      Value of the axisth axis
    • toString

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

      public CellKey.Many copy()
      Description copied from interface: CellKey
      Returns a mutable copy of this CellKey.
      Specified by:
      copy in interface CellKey
      Returns:
      Mutable copy
    • getOffset

      public int getOffset(int[] axisMultipliers)
      Description copied from interface: CellKey
      Returns the offset of the cell in a raster-scan order.

      For example, if the axes have lengths {2, 5, 10} then cell (2, 3, 4) has offset

      (2 * mulitiplers[0]) + (3 * multipliers[1]) + (4 * multipliers[2])
      = (2 * 50) + (3 * 10) + (4 * 1)
      = 134

      The multipliers are the product of the lengths of all later axes, in this case (50, 10, 1).

      Specified by:
      getOffset in interface CellKey
      Parameters:
      axisMultipliers - For each axis, the product of the lengths of later axes
      Returns:
      The raster-scan ordinal of this cell
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object