Sharkysoft home

lava
Class Platform

java.lang.Object
  |
  +--lava.Platform

public class Platform
extends java.lang.Object

Characterizes the host platform.

Details: Platform provides information about the current platform on which the JVM is running. This class does not provide any additional information beyond that which is already available through System.getProperty calls, but hopefully it does make access to -- and interpretation of -- that information a bit easier.

This class is always under development as new Java platforms are being introduced. If you wish to encourage the development of this class, please return the output of the following code:

Currently available dumps are available here.

Since:
1999.04.01
Version:
2000.01.22

Field Summary
static int MACINTOSH
          Apple Macintosh operating system.
static int MS_DOS
          Microsoft MS-DOS operating system.
static int UNIX
          Unix-style operating system.
static int UNKNOWN
          Indicates unknown information.
static int WINDOWS
          Microsoft Windows.
 
Constructor Summary
Platform()
           
 
Method Summary
static java.lang.String getLineSeparator()
          Returns platform's line separator.
static int getOsGenre()
          Determines host operating system family.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
Indicates unknown information.

Details: UNKNOWN indicates that some item of information could not be determined. For example, if you are caching the return value of get_os_genre, you can cache this value to avoid clashes with the other constants defined in this class.


UNIX

public static final int UNIX
Unix-style operating system.

Details: UNIX indicates any of the Unix-style operating systems.


MS_DOS

public static final int MS_DOS
Microsoft MS-DOS operating system.

Details: MS_DOS indicates the Microsoft MS-DOS operating system family.


MACINTOSH

public static final int MACINTOSH
Apple Macintosh operating system.

Details: MACINTOSH indicates the Apple Macintosh operating system family.


WINDOWS

public static final int WINDOWS
Microsoft Windows.

Details: WINDOWS indicates the Microsoft Windows operating system family.

Constructor Detail

Platform

public Platform()
Method Detail

getOsGenre

public static final int getOsGenre()
Determines host operating system family.

Details: get_os_genre identifies the operating system genre hosting the currently running JVM.

This implementation recognizes only Linux (UNIX), Windows (WINDOWS), Macintosh (MACINTOSH), and HP-UX (UNIX). If the initialization procedure detects any other platform, it will assume UNIX.

The author is currently in the process of collecting System.getProperty("os.name") values for as many platforms as possible, so that the initialization procedure can be expanded. Submissions are welcome.


getLineSeparator

public static final java.lang.String getLineSeparator()
Returns platform's line separator.

Details: getLineSeparator returns the default line separator for the host platform.

Returns:
the line separator
Since:
2000.01.29

Sharkysoft home