Some javadocs, include javadocs in the application distribution.

This commit is contained in:
Adam Murdoch
2012-09-01 10:15:25 +10:00
parent 3e4dc956ed
commit ba2a54b403
11 changed files with 64 additions and 15 deletions

View File

@@ -2,12 +2,27 @@ package net.rubygrapefruit.platform;
import java.io.File;
/**
* Information about a file system. This is a snapshot view and does not change.
*/
public interface FileSystem {
/**
* Returns the root directory of this file system.
*/
File getMountPoint();
/**
* Returns the operating system specific name for the type of this file system.
*/
String getFileSystemType();
/**
* Returns true if this file system is a remote file system, or false if local.
*/
boolean isRemote();
/**
* Returns the operating system specific name for this file system.
*/
String getDeviceName();
}

View File

@@ -2,6 +2,9 @@ package net.rubygrapefruit.platform;
import java.util.List;
/**
* Provides access to the file systems of the current machine.
*/
public interface FileSystems extends NativeIntegration {
/**
* Returns the set of all file systems for the current machine.

View File

@@ -13,12 +13,16 @@ public class Native {
private static final Object lock = new Object();
private static boolean loaded;
private Native() {
}
/**
* Initialises the native integration, if not already initialized.
*
* @param extractDir The directory to extract native resources into. May be null.
* @param extractDir The directory to extract native resources into. May be null, in which case a default is
* selected.
*/
static void init(File extractDir) {
static public void init(File extractDir) {
synchronized (lock) {
if (!loaded) {
Platform platform = Platform.current();
@@ -56,7 +60,13 @@ public class Native {
}
}
static <T extends NativeIntegration> T get(Class<T> type) {
/**
* Locates a native integration of the given type.
*
* @return The native integration.
* @throws UnsupportedOperationException if the given integration is not available.
*/
public static <T extends NativeIntegration> T get(Class<T> type) throws UnsupportedOperationException {
init(null);
Platform platform = Platform.current();
T integration = platform.get(type);

View File

@@ -1,4 +1,7 @@
package net.rubygrapefruit.platform;
/**
* A marker interface that represents a native integration.
*/
public interface NativeIntegration {
}

View File

@@ -4,8 +4,6 @@ import java.io.File;
/**
* Functions to query and modify a file's POSIX meta-data.
*
* Supported on Linux, OS X
*/
public interface PosixFile extends NativeIntegration {
/**

View File

@@ -1,27 +1,21 @@
package net.rubygrapefruit.platform;
/**
* Provides access to some system information.
* Provides access to some system information. This is a snapshot view and does not change.
*/
public interface SystemInfo extends NativeIntegration {
/**
* Returns the name of the kernel for the current operating system.
*
* @throws NativeException on failure.
*/
String getKernelName() throws NativeException;
String getKernelName();
/**
* Returns the version of the kernel for the current operating system.
*
* @throws NativeException on failure.
*/
String getKernelVersion() throws NativeException;
String getKernelVersion();
/**
* Returns the machine architecture, as reported by the operating system.
*
* @throws NativeException on failure.
*/
String getMachineArchitecture() throws NativeException;
String getMachineArchitecture();
}

View File

@@ -6,6 +6,9 @@ package net.rubygrapefruit.platform;
* Supported on Linux, OS X, Windows.
*/
public interface Terminal {
/**
* Colors supported by a terminal.
*/
enum Color {
Black, Red, Green, Yellow, Blue, Magenta, Cyan, White
}

View File

@@ -1,7 +1,16 @@
package net.rubygrapefruit.platform;
/**
* The size of a terminal. This is a snapshot view and does not change.
*/
public interface TerminalSize {
/**
* Returns the number of character columns in the terminal.
*/
public int getCols();
/**
* Returns the number of character rows in the terminal.
*/
public int getRows();
}

View File

@@ -6,6 +6,9 @@ package net.rubygrapefruit.platform;
* Supported on Linux, OS X, Windows.
*/
public interface Terminals extends NativeIntegration {
/**
* System outputs.
*/
enum Output {Stdout, Stderr}
/**

View File

@@ -0,0 +1,4 @@
/**
* The native integrations. Use {@link net.rubygrapefruit.platform.Native#get(Class)} to access a native integration.
*/
package net.rubygrapefruit.platform;