From: <mrp...@us...> - 2010-07-21 19:50:17
|
Revision: 3262 http://bigdata.svn.sourceforge.net/bigdata/?rev=3262&view=rev Author: mrpersonick Date: 2010-07-21 19:50:11 +0000 (Wed, 21 Jul 2010) Log Message: ----------- temporary implementation for BigDecimal Modified Paths: -------------- branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/btree/keys/KeyBuilder.java Modified: branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/btree/keys/KeyBuilder.java =================================================================== --- branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/btree/keys/KeyBuilder.java 2010-07-21 19:49:10 UTC (rev 3261) +++ branches/LEXICON_REFACTOR_BRANCH/bigdata/src/java/com/bigdata/btree/keys/KeyBuilder.java 2010-07-21 19:50:11 UTC (rev 3262) @@ -947,7 +947,8 @@ // FIXME append(BigDecimal) public KeyBuilder append(final BigDecimal d) { - throw new UnsupportedOperationException(); +// throw new UnsupportedOperationException(); + return append(d.doubleValue()); } /* @@ -1061,6 +1062,10 @@ append((BigInteger) val); + } else if (val instanceof BigDecimal) { + + append((BigDecimal) val); + } else if (val instanceof Float) { append(((Float) val).floatValue()); @@ -1383,7 +1388,9 @@ // FIXME decodeBigDecimal(int, byte[]) static public BigDecimal decodeBigDecimal(final int offset, final byte[] key) { - throw new UnsupportedOperationException(); +// throw new UnsupportedOperationException(); + final double d = decodeDouble(key, offset); + return new BigDecimal(d); } public static IKeyBuilder newInstance() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |