Package mondrian.rolap.agg
Class AbstractSegmentBody
- java.lang.Object
-
- mondrian.rolap.agg.AbstractSegmentBody
-
- All Implemented Interfaces:
Serializable
,SegmentBody
- Direct Known Subclasses:
DenseDoubleSegmentBody
,DenseIntSegmentBody
,DenseObjectSegmentBody
,SparseSegmentBody
abstract class AbstractSegmentBody extends Object implements SegmentBody
Abstract implementation of a SegmentBody.- Author:
- LBoudreau
-
-
Field Summary
Fields Modifier and Type Field Description protected SortedSet<Comparable>[]
axisValueSets
-
Constructor Summary
Constructors Constructor Description AbstractSegmentBody(List<Pair<SortedSet<Comparable>,Boolean>> axes)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description SortedSet<Comparable>[]
getAxisValueSets()
Returns the cached axis value sets to be used as an initializer for the segment's axis.protected int
getEffectiveSize()
Returns the amount of non-null elements.boolean[]
getNullAxisFlags()
Returns an array of boolean values which identify which axis of the cached segment contained null values.BitSet
getNullValueIndicators()
Returns a bit-set indicating whether values are null.protected abstract Object
getObject(int i)
protected abstract int
getSize()
Returns the overall amount of stored elements, including those, that are considered to be null.Object
getValueArray()
Returns an array of values.Map<CellKey,Object>
getValueMap()
Converts contents of this segment into a cellkey/value map.
-
-
-
Field Detail
-
axisValueSets
protected final SortedSet<Comparable>[] axisValueSets
-
-
Constructor Detail
-
AbstractSegmentBody
public AbstractSegmentBody(List<Pair<SortedSet<Comparable>,Boolean>> axes)
-
-
Method Detail
-
getAxisValueSets
public SortedSet<Comparable>[] getAxisValueSets()
Description copied from interface:SegmentBody
Returns the cached axis value sets to be used as an initializer for the segment's axis.- Specified by:
getAxisValueSets
in interfaceSegmentBody
- Returns:
- An array of SortedSets which was cached previously.
-
getNullAxisFlags
public boolean[] getNullAxisFlags()
Description copied from interface:SegmentBody
Returns an array of boolean values which identify which axis of the cached segment contained null values.- Specified by:
getNullAxisFlags
in interfaceSegmentBody
- Returns:
- An array of boolean values.
-
getValueMap
public Map<CellKey,Object> getValueMap()
Description copied from interface:SegmentBody
Converts contents of this segment into a cellkey/value map. Use only for sparse segments.- Specified by:
getValueMap
in interfaceSegmentBody
- Returns:
- Map containing cell values keyed by their coordinates
-
getValueArray
public Object getValueArray()
Description copied from interface:SegmentBody
Returns an array of values.Use only for dense segments.
- Specified by:
getValueArray
in interfaceSegmentBody
- Returns:
- An array of values
-
getNullValueIndicators
public 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
- Returns:
- Indicators
-
getSize
protected abstract int getSize()
Returns the overall amount of stored elements, including those, that are considered to be null.- Returns:
- the size of stored data
-
getEffectiveSize
protected int getEffectiveSize()
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()
.- Returns:
- the effective size of stored data
-
getObject
protected abstract Object getObject(int i)
-
-