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