Changeset 2076 for trunk/lang


Ignore:
Timestamp:
Jan 31, 2011, 3:06:56 PM (14 years ago)
Author:
braffert
Message:

Bringing java api up to sync with documentation

Location:
trunk/lang/java
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/lang/java/Library.java

    r1753 r2076  
    100100  }
    101101
     102  public String xml(){
     103    return jRpXml(libPtr);
     104  }
     105
    102106
    103107  // Native Functions----------------------------------------------------------
     
    118122
    119123  private native void jRpResult(long libPtr, int exitStatus); 
     124  private native String jRpXml(long libPtr);
    120125
    121126  // Private Attributes--------------------------------------------------------
  • trunk/lang/java/Units.java

    r1753 r2076  
    2323  }
    2424
    25   public static String convert(String fromVal, String to, boolean units){
     25  // Public Methods------------------------------------------------------------
     26  public static double convertDouble(double fromVal, String to){
     27    return Double.parseDouble(
     28      jRpUnitsConvert(Double.toString(fromVal), to, false));
     29  }
     30
     31  public static String convertString(String fromVal, String to, boolean units){
    2632    return jRpUnitsConvert(fromVal, to, units);
    2733  }
    2834
    29   public static String convert(String fromVal, String to){
     35  public static String convertString(String fromVal, String to){
    3036    return jRpUnitsConvert(fromVal, to, true);
    3137  }
    3238
    33   private static native String jRpUnitsConvert(String fromVal, String to, boolean units);
     39  // Native Functions----------------------------------------------------------
     40  private static native String jRpUnitsConvert(String fromVal, String to,
     41    boolean units);
    3442}
    3543
  • trunk/lang/java/Utils.java

    r1732 r2076  
    2626  }
    2727
     28  public static void progress(int percent){
     29    jRpUtilsProgress(percent, "");
     30  }
     31
    2832  private static native void jRpUtilsProgress(int percent, String text);
    2933
  • trunk/lang/java/jRpLibrary.cc

    r1753 r2076  
    145145}
    146146
     147// xml
     148JNIEXPORT jstring JNICALL Java_rappture_Library_jRpXml
     149  (JNIEnv *env, jobject obj, jlong libPtr) {
     150  std::string retStr = ((RpLibrary*)libPtr)->xml();
     151  return(env->NewStringUTF(retStr.c_str()));
     152}
     153
  • trunk/lang/java/jRpUnits.cc

    r1753 r2076  
    1717#include "rappture.h"
    1818
    19 // convert
     19// convertString
    2020JNIEXPORT jstring JNICALL Java_rappture_Units_jRpUnitsConvert
    2121  (JNIEnv *env, jclass cls, jstring javaFromVal, jstring javaTo, jboolean units){
     
    3434    ex = env->FindClass("java/lang/RuntimeException");
    3535    if (ex){
    36       errorMsg = "Connot convert ";
     36      errorMsg = "Cannot convert ";
    3737      errorMsg += nativeFromVal;
    3838      errorMsg += " to ";
Note: See TracChangeset for help on using the changeset viewer.