source: ether_statistics/service/implementation/gov/noaa/pmel/util/EPICSystem.java @ 569

Last change on this file since 569 was 569, checked in by vmipsl, 12 years ago

Nouveau projet

File size: 1.4 KB
Line 
1/*
2 * $Id: EPICSystem.java,v 1.2 2003/08/22 23:02:40 dwd Exp $
3 *
4 * This software is provided by NOAA for full, free and open release.  It is
5 * understood by the recipient/user that NOAA assumes no liability for any
6 * errors contained in the code.  Although this software is released without
7 * conditions or restrictions in its use, it is expected that appropriate
8 * credit be given to its author and to the National Oceanic and Atmospheric
9 * Administration should the software be included by the recipient as an
10 * element in other product development.
11 */
12
13package gov.noaa.pmel.util;
14
15import java.util.StringTokenizer;
16
17/**
18 * Uility methods for accessing Java System information.
19 *
20 * @author Donald Denbo
21 * @version $Revision: 1.2 $, $Date: 2003/08/22 23:02:40 $
22 * @since 3.0
23 **/
24public class EPICSystem {
25
26  public EPICSystem() {
27  }
28
29  /**
30   * Get the major java version.  If 1.4.2, returns 1.
31   * @return java version
32   */
33  static public int getJavaMajorVersion() {
34    StringTokenizer st = new StringTokenizer(System.getProperty("java.version"),
35        ".", false);
36    return Integer.parseInt(st.nextToken());
37  }
38  /**
39   * Get the minor java version.  If 1.4.2, returns 2.
40   * @return java minor version
41   */
42 static public int getJavaMinorVersion() {
43   StringTokenizer st = new StringTokenizer(System.getProperty("java.version"),
44       ".", false);
45   st.nextToken();
46   return Integer.parseInt(st.nextToken());
47  }
48}
Note: See TracBrowser for help on using the repository browser.