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 intgetEffectiveSize()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.BitSetgetNullValueIndicators()Returns a bit-set indicating whether values are null.protected abstract ObjectgetObject(int i)protected abstract intgetSize()Returns the overall amount of stored elements, including those, that are considered to be null.ObjectgetValueArray()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:SegmentBodyReturns the cached axis value sets to be used as an initializer for the segment's axis.- Specified by:
getAxisValueSetsin interfaceSegmentBody- Returns:
- An array of SortedSets which was cached previously.
-
getNullAxisFlags
public boolean[] getNullAxisFlags()
Description copied from interface:SegmentBodyReturns an array of boolean values which identify which axis of the cached segment contained null values.- Specified by:
getNullAxisFlagsin interfaceSegmentBody- Returns:
- An array of boolean values.
-
getValueMap
public Map<CellKey,Object> getValueMap()
Description copied from interface:SegmentBodyConverts contents of this segment into a cellkey/value map. Use only for sparse segments.- Specified by:
getValueMapin interfaceSegmentBody- Returns:
- Map containing cell values keyed by their coordinates
-
getValueArray
public Object getValueArray()
Description copied from interface:SegmentBodyReturns an array of values.Use only for dense segments.
- Specified by:
getValueArrayin interfaceSegmentBody- Returns:
- An array of values
-
getNullValueIndicators
public BitSet getNullValueIndicators()
Description copied from interface:SegmentBodyReturns 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:
getNullValueIndicatorsin 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)
-
-