Package mondrian.rolap.agg
Class DenseDoubleSegmentBody
- java.lang.Object
-
- mondrian.rolap.agg.AbstractSegmentBody
-
- mondrian.rolap.agg.DenseDoubleSegmentBody
-
- All Implemented Interfaces:
java.io.Serializable
,SegmentBody
class DenseDoubleSegmentBody extends AbstractSegmentBody
Implementation of a segment body which stores the data inside a dense primitive array of double precision numbers.- Author:
- LBoudreau
-
-
Field Summary
-
Fields inherited from class mondrian.rolap.agg.AbstractSegmentBody
axisValueSets
-
-
Constructor Summary
Constructors Constructor Description DenseDoubleSegmentBody(java.util.BitSet nullValues, double[] values, java.util.List<Pair<java.util.SortedSet<java.lang.Comparable>,java.lang.Boolean>> axes)
Creates a DenseDoubleSegmentBody.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
getEffectiveSize()
Returns the amount of non-null elements.java.util.BitSet
getNullValueIndicators()
Returns a bit-set indicating whether values are null.protected java.lang.Object
getObject(int i)
protected int
getSize()
Returns the overall amount of stored elements, including those, that are considered to be null.java.lang.Object
getValueArray()
Returns an array of values.java.lang.String
toString()
-
Methods inherited from class mondrian.rolap.agg.AbstractSegmentBody
getAxisValueSets, getNullAxisFlags, getValueMap
-
-
-
-
Constructor Detail
-
DenseDoubleSegmentBody
DenseDoubleSegmentBody(java.util.BitSet nullValues, double[] values, java.util.List<Pair<java.util.SortedSet<java.lang.Comparable>,java.lang.Boolean>> axes)
Creates a DenseDoubleSegmentBody.Stores the given array of cell values and null indicators; caller must not modify them afterwards.
- Parameters:
nullValues
- A bit-set indicating whether values are null. Each position in the bit-set corresponds to an offset in the value array. If position is null, the corresponding entry in the value array will also be 0.values
- Cell valuesaxes
- Axes
-
-
Method Detail
-
getValueArray
public java.lang.Object getValueArray()
Description copied from interface:SegmentBody
Returns an array of values.Use only for dense segments.
- Specified by:
getValueArray
in interfaceSegmentBody
- Overrides:
getValueArray
in classAbstractSegmentBody
- Returns:
- An array of values
-
getNullValueIndicators
public java.util.BitSet getNullValueIndicators()
Description copied from interface:SegmentBody
Returns a bit-set indicating whether values are null. The ordinals in the bit-set correspond to the indexes in the array returned fromSegmentBody.getValueArray()
.Use only for dense segments of native values.
- Specified by:
getNullValueIndicators
in interfaceSegmentBody
- Overrides:
getNullValueIndicators
in classAbstractSegmentBody
- Returns:
- Indicators
-
getSize
protected int getSize()
Description copied from class:AbstractSegmentBody
Returns the overall amount of stored elements, including those, that are considered to be null.- Specified by:
getSize
in classAbstractSegmentBody
- Returns:
- the size of stored data
-
getEffectiveSize
protected int getEffectiveSize()
Description copied from class:AbstractSegmentBody
Returns the amount of non-null elements. This amount is equal to number of elements thatgetValueMap().entrySet().iterator()
is returned. By default the method executesgetSize()
.- Overrides:
getEffectiveSize
in classAbstractSegmentBody
- Returns:
- the effective size of stored data
-
getObject
protected java.lang.Object getObject(int i)
- Specified by:
getObject
in classAbstractSegmentBody
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-