mondrian.rolap.agg
Class DenseIntSegmentDataset

java.lang.Object
  extended by mondrian.rolap.agg.DenseSegmentDataset
      extended by mondrian.rolap.agg.DenseNativeSegmentDataset
          extended by mondrian.rolap.agg.DenseIntSegmentDataset
All Implemented Interfaces:
Iterable<Map.Entry<CellKey,Object>>, SegmentDataset

 class DenseIntSegmentDataset
extends DenseNativeSegmentDataset

Implementation of DenseSegmentDataset that stores values of type Object.

The storage requirements are as follows. Table requires 1 word per cell.

Since:
21 March, 2002
Version:
$Id: //open/mondrian/src/main/mondrian/rolap/agg/DenseIntSegmentDataset.java#4 $
Author:
jhyde

Field Summary
(package private)  int[] values
           
 
Fields inherited from class mondrian.rolap.agg.DenseNativeSegmentDataset
nullIndicators
 
Fields inherited from class mondrian.rolap.agg.DenseSegmentDataset
axisMultipliers
 
Constructor Summary
DenseIntSegmentDataset(Segment segment, int size)
          Creates a DenseIntSegmentDataset.
 
Method Summary
 SegmentBody createSegmentBody(SortedSet<Comparable<?>>[] axisValueSets, boolean[] nullAxisFlags)
          Must return an immutable, final and serializable implementation of a SegmentBody in order to cache this dataset.
 boolean exists(CellKey pos)
          Returns whether there is a value at a given coordinate.
 int getInt(CellKey key)
          Returns the value at a given coordinate, as an int.
 Object getObject(CellKey pos)
          Returns the value at a given coordinate, as an Object.
protected  Integer getObject(int offset)
           
protected  int getSize()
           
 SqlStatement.Type getType()
          Returns the SQL type of the data contained in this dataset.
 void populateFrom(int[] pos, SegmentDataset data, CellKey key)
           
 void populateFrom(int[] pos, SegmentLoader.RowList rowList, int column)
          Sets the value a given ordinal.
 void put(CellKey key, int value)
           
 void put(int[] ordinals, int value)
           
(package private)  void set(int k, int o)
           
 
Methods inherited from class mondrian.rolap.agg.DenseNativeSegmentDataset
isNull, isNull
 
Methods inherited from class mondrian.rolap.agg.DenseSegmentDataset
getBytes, getDouble, getOffset, getOffset, iterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

final int[] values
Constructor Detail

DenseIntSegmentDataset

DenseIntSegmentDataset(Segment segment,
                       int size)
Creates a DenseIntSegmentDataset.

Parameters:
segment - Segment
size - Number of coordinates
Method Detail

getInt

public int getInt(CellKey key)
Description copied from interface: SegmentDataset
Returns the value at a given coordinate, as an int.

Specified by:
getInt in interface SegmentDataset
Overrides:
getInt in class DenseSegmentDataset
Parameters:
key - Coordinate position
Returns:
Value

getObject

public Object getObject(CellKey pos)
Description copied from interface: SegmentDataset
Returns the value at a given coordinate, as an Object.

Specified by:
getObject in interface SegmentDataset
Overrides:
getObject in class DenseSegmentDataset
Parameters:
pos - Coordinate position
Returns:
Value

getObject

protected Integer getObject(int offset)
Specified by:
getObject in class DenseSegmentDataset

exists

public boolean exists(CellKey pos)
Description copied from interface: SegmentDataset
Returns whether there is a value at a given coordinate.

Parameters:
pos - Coordinate position
Returns:
Whether there is a value

populateFrom

public void populateFrom(int[] pos,
                         SegmentDataset data,
                         CellKey key)

populateFrom

public void populateFrom(int[] pos,
                         SegmentLoader.RowList rowList,
                         int column)
Description copied from interface: SegmentDataset
Sets the value a given ordinal.

Parameters:
pos - Ordinal
rowList - Row list
column - Column of row list

getType

public SqlStatement.Type getType()
Description copied from interface: SegmentDataset
Returns the SQL type of the data contained in this dataset.

Returns:
A value of SqlStatement.Type

put

public void put(CellKey key,
                int value)

put

public void put(int[] ordinals,
                int value)

set

void set(int k,
         int o)

getSize

protected int getSize()
Specified by:
getSize in class DenseSegmentDataset

createSegmentBody

public SegmentBody createSegmentBody(SortedSet<Comparable<?>>[] axisValueSets,
                                     boolean[] nullAxisFlags)
Description copied from interface: SegmentDataset
Must return an immutable, final and serializable implementation of a SegmentBody in order to cache this dataset.

Parameters:
axisValueSets - An array of SortedSets of Comparables. This is supplied by the SegmentLoader.
nullAxisFlags - An array of booleans indicating which segment axis has null values. This is supplied by the SegmentLoader.
Returns:
A SegmentBody object.
See Also:
SegmentBody.createSegmentDataset(Segment)

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads