Class RolapResult.CellInfoPool
- java.lang.Object
-
- mondrian.rolap.RolapResult.CellInfoPool
-
- All Implemented Interfaces:
RolapResult.CellInfoContainer
- Enclosing class:
- RolapResult
static class RolapResult.CellInfoPool extends Object implements RolapResult.CellInfoContainer
Implementation ofRolapResult.CellInfoContainerwhich uses anObjectPoolto storeRolapResult.CellInfoObjects.There is an inner interface (
CellKeyMaker) and implementations for 0 through 4 axes that convert the Cell position integer array into a long.It should be noted that there is an alternate approach. As the
executeStripemethod is recursively called, at each call it is known which axis is being iterated across and it is known whether or not the Position object for that axis is a List or just an Iterable. It it is a List, then one knows the real size of the axis. If it is an Iterable, then one has to use one of the MAX_AXIS_SIZE values. Given that this information is available when one recursives down to the nextexecuteStripecall, the Cell ordinal, the position integer array could converted to anlong, could be generated on the call stack!! Just a thought for the future.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interfaceRolapResult.CellInfoPool.CellKeyMakerImplementations of CellKeyMaker convert the Cell position integer array to along.(package private) static classRolapResult.CellInfoPool.FourFor axis of size 4.(package private) static classRolapResult.CellInfoPool.OneFor axis of size 1.(package private) static classRolapResult.CellInfoPool.ThreeFor axis of size 3.(package private) static classRolapResult.CellInfoPool.TwoFor axis of size 2.(package private) static classRolapResult.CellInfoPool.ZeroFor axis of size 0.
-
Field Summary
Fields Modifier and Type Field Description protected static longMAX_AXIS_SIZE_2The maximum number of Members, 2,147,483,647, that can be any given Axis when the number of Axes is 2.protected static longMAX_AXIS_SIZE_3The maximum number of Members, 2,000,000, that can be any given Axis when the number of Axes is 3.protected static longMAX_AXIS_SIZE_4The maximum number of Members, 50,000, that can be any given Axis when the number of Axes is 4.
-
Constructor Summary
Constructors Constructor Description CellInfoPool(int axisLength)CellInfoPool(int axisLength, int initialSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes all CellInfo objects from container.RolapResult.CellInfocreate(int[] pos)Creates a new CellInfo object, adds it to the container a locationposand returns it.RolapResult.CellInfolookup(int[] pos)Gets the CellInfo object at the locationpos.intsize()Returns the number of CellInfo objects in this container.voidtrimToSize()Reduces the size of the internal data structures needed to support the current entries.
-
-
-
Field Detail
-
MAX_AXIS_SIZE_2
protected static final long MAX_AXIS_SIZE_2
The maximum number of Members, 2,147,483,647, that can be any given Axis when the number of Axes is 2.- See Also:
- Constant Field Values
-
MAX_AXIS_SIZE_3
protected static final long MAX_AXIS_SIZE_3
The maximum number of Members, 2,000,000, that can be any given Axis when the number of Axes is 3.- See Also:
- Constant Field Values
-
MAX_AXIS_SIZE_4
protected static final long MAX_AXIS_SIZE_4
The maximum number of Members, 50,000, that can be any given Axis when the number of Axes is 4.- See Also:
- Constant Field Values
-
-
Method Detail
-
size
public int size()
Description copied from interface:RolapResult.CellInfoContainerReturns the number of CellInfo objects in this container.- Specified by:
sizein interfaceRolapResult.CellInfoContainer- Returns:
- the number of CellInfo objects.
-
trimToSize
public void trimToSize()
Description copied from interface:RolapResult.CellInfoContainerReduces the size of the internal data structures needed to support the current entries. This should be called after all CellInfo objects have been added to container.- Specified by:
trimToSizein interfaceRolapResult.CellInfoContainer
-
clear
public void clear()
Description copied from interface:RolapResult.CellInfoContainerRemoves all CellInfo objects from container. Does not change the size of the internal data structures.- Specified by:
clearin interfaceRolapResult.CellInfoContainer
-
create
public RolapResult.CellInfo create(int[] pos)
Description copied from interface:RolapResult.CellInfoContainerCreates a new CellInfo object, adds it to the container a locationposand returns it.- Specified by:
createin interfaceRolapResult.CellInfoContainer- Parameters:
pos- where to store CellInfo object.- Returns:
- the newly create CellInfo object.
-
lookup
public RolapResult.CellInfo lookup(int[] pos)
Description copied from interface:RolapResult.CellInfoContainerGets the CellInfo object at the locationpos.- Specified by:
lookupin interfaceRolapResult.CellInfoContainer- Parameters:
pos- where to find the CellInfo object.- Returns:
- the CellInfo found or null.
-
-