]> rtime.felk.cvut.cz Git - orte.git/blob - orte/java/src/org/ocera/orte/tools/Conversions.java
New ORTE version 0.3.0 committed
[orte.git] / orte / java / src / org / ocera / orte / tools / Conversions.java
1 /* Conversions.java */
2 package org.ocera.orte.tools;
3 import  org.ocera.orte.types.*;
4
5 /**
6   * Class Conversions provides conversions between IPAddress
7   * and String and between NtpTime and String.
8   *
9   * @author Lukas Pokorny (lukas_pokorny@centrum.cz)
10   * @author CTU FEE Prague - Department of Control Engineering (dce.felk.cvut.cz)
11   * @author Project ORTE - OCERA Real Time Ethernet (www.ocera.org)
12   * @author dedication to Kj
13   * @version 0.1
14   *
15   *
16   * This program is free software; you can redistribute it and/or modify
17   * it under the terms of the GNU General Public License as published by
18   * the Free Software Foundation; either version 2 of the License, or
19   * (at your option) any later version.
20   *
21   * This program is distributed in the hope that it will be useful,
22   * but WITHOUT ANY WARRANTY; without even the implied warranty of
23   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24   * GNU General Public License for more details.
25   *
26   */
27
28
29 public class Conversions {
30
31    /** load native library 'libjorte.so' */
32    static {
33       System.loadLibrary("jorte");
34    }
35
36
37   /** native methods */
38
39   /**
40    * IPAddressToString - converts and return IP address from number
41    * notation into its dot notation in string
42    *
43    * @param ipAddress source IP address in number notation
44    * @return IP address in string(dot) notation
45    */
46    public static native
47    String IPAddressToString(long ipAddress);
48
49
50   /**
51    * StringToIPAddress - converts IP and returns address from dot notation
52    * -string into its number notation
53    *
54    * @param ipAddress source IP address in string(dot) notation
55    * @return IP address in number notation
56    */
57    public static native
58    long StringToIPAddress(String ipAddress);
59
60
61   /**
62    * NtpTimeToStringMs - converts NtpTime from number notation into its
63    * string notation in miliseconds
64    *
65    * @param time time given in JNtpTime object
66    * @return NtpTime in string notation in miliseconds
67    */
68    public static native
69    String NtpTimeToStringMs(NtpTime time);
70
71
72    /**
73    * NtpTimeToStringUs - converts NtpTime from number notation into its
74    * string notation in microseconds
75    *
76    * @param time time given in JNtpTime object
77    * @return NtpTime in string notation in microseconds
78    */
79    public static native
80    String NtpTimeToStringUs(NtpTime time);
81
82
83 }
84