mondrian.rolap.agg
Class DenseSegmentDataset

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

 class DenseSegmentDataset
extends java.lang.Object
implements SegmentDataset

A DenseSegmentDataset is a means of storing segment values which is suitable when most of the combinations of keys have a value present.

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/DenseSegmentDataset.java#11 $
Author:
jhyde

Constructor Summary
DenseSegmentDataset(Segment segment, java.lang.Object[] values)
          Creates a DenseSegmentDataset.
 
Method Summary
 java.lang.Object get(CellKey key)
          Returns the value at a given coordinate.
 double getBytes()
          Returns the number of bytes occupied by this dataset.
 java.util.Iterator<java.util.Map.Entry<CellKey,java.lang.Object>> iterator()
           
 void put(CellKey key, java.lang.Object value)
           
(package private)  void set(int k, java.lang.Object o)
          Sets the value a given ordinal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DenseSegmentDataset

DenseSegmentDataset(Segment segment,
                    java.lang.Object[] values)
Creates a DenseSegmentDataset.

Parameters:
segment - Segment
values - Array of values, one for each possible coordinate
Method Detail

get

public java.lang.Object get(CellKey key)
Description copied from interface: SegmentDataset
Returns the value at a given coordinate.

Specified by:
get in interface SegmentDataset
Parameters:
key - Coordinate position
Returns:
Value

getBytes

public double getBytes()
Description copied from interface: SegmentDataset
Returns the number of bytes occupied by this dataset.

Specified by:
getBytes in interface SegmentDataset
Returns:
number of bytes

put

public void put(CellKey key,
                java.lang.Object value)
Specified by:
put in interface SegmentDataset

iterator

public java.util.Iterator<java.util.Map.Entry<CellKey,java.lang.Object>> iterator()
Specified by:
iterator in interface java.lang.Iterable<java.util.Map.Entry<CellKey,java.lang.Object>>

set

void set(int k,
         java.lang.Object o)
Sets the value a given ordinal.

Parameters:
k - Ordinal
o - Value

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