source: trunk/lang/java/Units.java @ 1753

Last change on this file since 1753 was 1753, checked in by braffert, 14 years ago

Added java exceptions where applicable. Also added Library.getInt

File size: 1008 bytes
Line 
1/*
2 * ======================================================================
3 *  AUTHOR:  Ben Rafferty, Purdue University
4 *  Copyright (c) 2010  Purdue Research Foundation
5 *
6 *  See the file "license.terms" for information on usage and
7 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8 * ======================================================================
9 */
10
11/*
12 * This file defines a java class that implemements the rappture units module.
13 * The class methods call the corresponding native code through c++ glue code
14 * located in jRpUnits.cc.
15 */
16
17
18package rappture;
19
20public class Units{
21  static {
22    System.loadLibrary("JRappture");
23  }
24
25  public static String convert(String fromVal, String to, boolean units){
26    return jRpUnitsConvert(fromVal, to, units);
27  }
28
29  public static String convert(String fromVal, String to){
30    return jRpUnitsConvert(fromVal, to, true);
31  }
32
33  private static native String jRpUnitsConvert(String fromVal, String to, boolean units);
34}
35
36
37
Note: See TracBrowser for help on using the repository browser.