=== modified file 'java/swig/decimal.i'
--- a/java/swig/decimal.i	2008-03-05 16:01:55 +0000
+++ b/java/swig/decimal.i	2008-03-06 09:19:27 +0000
@@ -1,12 +1,12 @@
 // -*- mode: c++ -*-
 /*  ndb-bindings: Bindings for the NDB API
     Copyright (C) 2006 MySQL, Inc.
-    
+
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or 
+    the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
-    
+
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -17,26 +17,21 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-//%typemap(jni) DECIMAL "jbyteArray"
-//%typemap(jtype) DECIMAL "byte[]"
+/* Skipping jni and jtype typemaps because we're letting SWIG handle it */
 %typemap(jstype) DECIMAL "java.math.BigDecimal"
-%typemap(javaout) DECIMAL { 
-  // TODO 
+%typemap(javaout) DECIMAL {
   DECIMAL theDecimal = new DECIMAL($jnicall, false);
   java.math.BigDecimal results = new java.math.BigDecimal(0);
-  return results;
-} 
-
-
-/*%typemap(out) (BYTES)  { 
- 
- $result = jenv->NewByteArray($1.theLength); 
- jenv->SetByteArrayRegion($result,0,$1.theLength,(jbyte*) $1.theString);
- 
-} 
-
-%typemap(in) (const char* BYTE, size_t len) { 
-  $1 = (char *)(jenv->GetByteArrayElements($input,0));
-  $2 = jenv->GetArrayLength($input);
- }
-*/
+  int[] theNumbers = theDecimal.getTheNumbers();
+  java.math.BigDecimal baseTen = new java.math.BigDecimal(10);
+  for (int x=0; x<theNumbers.length; x++) {
+	  java.math.BigDecimal newNumber =
+	    new java.math.BigDecimal(theNumbers[x]);
+	  java.math.BigDecimal tenShift = baseTen.pow(x*8);
+	  results.add(newNumber.multiply(tenShift));
+  }
+  return results.setScale(theDecimal.getTheScale());
+
+}
+
+



