bt747.sys
Class JavaLibBridge

java.lang.Object
  extended by bt747.sys.JavaLibBridge

public final class JavaLibBridge
extends java.lang.Object

This implements the Bridge for java functionality that is not the same across java platforms. For more information regarding a bridge, see "Design Patterns" theory.

Author:
Mario De Weerd, Florian Unger for indicated parts.

Constructor Summary
JavaLibBridge()
           
 
Method Summary
static double acos(double x)
          Calculate inverse cosinus
static void addThread(BT747Thread o, boolean highPrio)
          Add a thread to the thread list.
static double atan(double x)
          Calculate inverse tangent
static double atan2(double x, double y)
          Calculate inverse tangent
static void debug(java.lang.String s)
           
static void debug(java.lang.String s, java.lang.Throwable e)
           
static java.lang.String getAppSettings()
           
static BT747Date getDateInstance()
           
static BT747Date getDateInstance(int d, int m, int y)
           
static BT747Date getDateInstance(java.lang.String date, byte format)
           
static BT747File getFileInstance(BT747Path path)
           
static BT747File getFileInstance(BT747Path path, int mode)
           
static BT747HashSet getHashSetInstance()
           
static BT747Hashtable getHashtableInstance(int initialCapacity)
           
static BT747HttpSender getHttpSenderInstance()
          Retrieve an platform specific instance of a class implementing the BT747HttpSender interface.
static BT747RAFile getRAFileInstance(BT747Path path)
           
static BT747RAFile getRAFileInstance(BT747Path path, int mode)
           
static BT747Semaphore getSemaphoreInstance(int value)
           
static BT747StringTokenizer getStringTokenizerInstance(java.lang.String a, char b)
           
static BT747Time getTimeInstance()
           
static int getTimeStamp()
           
static BT747Vector getVectorInstance()
           
static boolean isAvailable()
           
static double longBitsToDouble(long l)
           
static double pow(double x, double y)
          Calculate x^^y.
static void removeThread(BT747Thread o)
          Remove a thread from the thread list.
static void setAppSettings(java.lang.String appSettings)
           
static void setJavaLibImplementation(JavaLibImplementation imp)
          Set the implementation.
static double toDouble(java.lang.String s)
           
static float toFloat(java.lang.String s)
           
static float toFloatBitwise(int l)
           
static int toInt(java.lang.String s)
           
static int toIntBitwise(float f)
           
static java.lang.String toString(boolean p)
           
static java.lang.String toString(double p)
           
static java.lang.String toString(double p, int i)
           
static java.lang.String toString(float p)
           
static java.lang.String toString(int p)
           
static java.lang.String[] toStringArrayAndEmpty(BT747Vector vector)
           
static java.lang.String unsigned2hex(int p, int i)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaLibBridge

public JavaLibBridge()
Method Detail

setJavaLibImplementation

public static final void setJavaLibImplementation(JavaLibImplementation imp)
Set the implementation.
The implementation must be provided by the application.

Parameters:
imp - is the class.

getHashtableInstance

public static final BT747Hashtable getHashtableInstance(int initialCapacity)

getSemaphoreInstance

public static final BT747Semaphore getSemaphoreInstance(int value)

getTimeInstance

public static final BT747Time getTimeInstance()

getStringTokenizerInstance

public static final BT747StringTokenizer getStringTokenizerInstance(java.lang.String a,
                                                                    char b)

toStringArrayAndEmpty

public static final java.lang.String[] toStringArrayAndEmpty(BT747Vector vector)

getVectorInstance

public static final BT747Vector getVectorInstance()

getHashSetInstance

public static final BT747HashSet getHashSetInstance()

getDateInstance

public static final BT747Date getDateInstance()

getDateInstance

public static final BT747Date getDateInstance(int d,
                                              int m,
                                              int y)

getDateInstance

public static final BT747Date getDateInstance(java.lang.String date,
                                              byte format)

addThread

public static final void addThread(BT747Thread o,
                                   boolean highPrio)
Add a thread to the thread list.

Parameters:
o - The thread.
highPrio - True if high priority.

removeThread

public static final void removeThread(BT747Thread o)
Remove a thread from the thread list.

Parameters:
o - Thread to remove.

acos

public static final double acos(double x)
Calculate inverse cosinus

Parameters:
x - x.
Returns:
acos(x)

atan2

public static final double atan2(double x,
                                 double y)
Calculate inverse tangent

Parameters:
x - x.
Returns:
acos(x)

atan

public static final double atan(double x)
Calculate inverse tangent

Parameters:
x - x.
Returns:
acos(x)

pow

public static final double pow(double x,
                               double y)
Calculate x^^y. (x to the power of y)

Parameters:
x - x.
y - y.
Returns:
x^^y.

getTimeStamp

public static final int getTimeStamp()

debug

public static final void debug(java.lang.String s,
                               java.lang.Throwable e)

debug

public static final void debug(java.lang.String s)

getAppSettings

public static final java.lang.String getAppSettings()
Returns:
the appSettings

setAppSettings

public static final void setAppSettings(java.lang.String appSettings)
Parameters:
appSettings - the appSettings to set

getFileInstance

public static final BT747File getFileInstance(BT747Path path)

getFileInstance

public static final BT747File getFileInstance(BT747Path path,
                                              int mode)

getRAFileInstance

public static final BT747RAFile getRAFileInstance(BT747Path path)

getRAFileInstance

public static final BT747RAFile getRAFileInstance(BT747Path path,
                                                  int mode)

isAvailable

public static final boolean isAvailable()

longBitsToDouble

public static final double longBitsToDouble(long l)

toDouble

public static final double toDouble(java.lang.String s)

toFloat

public static final float toFloat(java.lang.String s)

toFloatBitwise

public static final float toFloatBitwise(int l)

toInt

public static final int toInt(java.lang.String s)

toIntBitwise

public static final int toIntBitwise(float f)

toString

public static final java.lang.String toString(boolean p)

toString

public static final java.lang.String toString(double p)

toString

public static final java.lang.String toString(double p,
                                              int i)

toString

public static final java.lang.String toString(float p)

toString

public static final java.lang.String toString(int p)

unsigned2hex

public static final java.lang.String unsigned2hex(int p,
                                                  int i)

getHttpSenderInstance

public static final BT747HttpSender getHttpSenderInstance()
                                                   throws BT747Exception
Retrieve an platform specific instance of a class implementing the BT747HttpSender interface.
author Florian Unger

Returns:
an instance of a class implementing BT747HttpSender
Throws:
BT747Exception