1 8 9 package com.sleepycat.bind.tuple; 10 11 import com.sleepycat.je.DatabaseEntry; 12 13 41 public class SortedDoubleBinding extends TupleBinding { 42 43 44 public Object entryToObject(TupleInput input) { 45 46 return new Double (input.readSortedDouble()); 47 } 48 49 50 public void objectToEntry(Object object, TupleOutput output) { 51 52 output.writeSortedDouble(((Number ) object).doubleValue()); 53 } 54 55 56 protected TupleOutput getTupleOutput(Object object) { 57 58 return DoubleBinding.sizedOutput(); 59 } 60 61 68 public static double entryToDouble(DatabaseEntry entry) { 69 70 return entryToInput(entry).readSortedDouble(); 71 } 72 73 80 public static void doubleToEntry(double val, DatabaseEntry entry) { 81 82 outputToEntry(DoubleBinding.sizedOutput().writeSortedDouble(val), 83 entry); 84 } 85 } 86 | Popular Tags |