1 13 package mondrian.rolap.agg; 14 15 import mondrian.olap.Util; 16 import mondrian.rolap.CellKey; 17 18 import java.util.Map ; 19 import java.util.HashMap ; 20 import java.util.Iterator ; 21 22 37 class SparseSegmentDataset implements SegmentDataset { 38 private final Map <CellKey, Object > values = new HashMap <CellKey, Object >(); 39 40 SparseSegmentDataset(Segment segment) { 41 Util.discard(segment); 42 } 43 44 public Object get(CellKey pos) { 45 return values.get(pos); 46 } 47 48 public void put(CellKey key, Object value) { 49 values.put(key, value); 50 } 51 52 public Iterator <Map.Entry <CellKey, Object >> iterator() { 53 return values.entrySet().iterator(); 54 } 55 56 public double getBytes() { 57 return values.size() * 12; 59 } 60 } 61 62 | Popular Tags |