1 25 26 package org.jrobin.core; 27 28 import java.io.IOException ; 29 30 class RrdDoubleArray extends RrdPrimitive { 31 private int length; 32 33 RrdDoubleArray(RrdUpdater updater, int length) throws IOException { 34 super(updater, RrdPrimitive.RRD_DOUBLE, length); 35 this.length = length; 36 } 37 38 void set(int index, double value) throws IOException { 39 set(index, value, 1); 40 } 41 42 void set(int index, double value, int count) throws IOException { 43 assert index + count <= length: "Invalid robin index supplied: index=" + index + 45 ", count=" + count + ", length=" + length; 46 writeDouble(index, value, count); 47 } 48 49 double get(int index) throws IOException { 50 assert index < length: "Invalid index supplied: " + index + ", length=" + length; 51 return readDouble(index); 52 } 53 54 double[] get(int index, int count) throws IOException { 55 assert index + count <= length: "Invalid index/count supplied: " + index + 56 "/" + count + " (length=" + length + ")"; 57 return readDouble(index, count); 58 } 59 60 } 61 | Popular Tags |