Simulcast 4.2

gov.nasa.gsfc.aisb.simulcast.util
Class Util

java.lang.Object
  extended by gov.nasa.gsfc.aisb.simulcast.util.Util

public class Util
extends java.lang.Object


Field Summary
static char[] alphabet
           
static java.text.DecimalFormat fp1
           
static java.text.DecimalFormat fp2
           
static java.text.DecimalFormat fp3
           
static java.text.DecimalFormat lz2
           
static java.text.DecimalFormat lz6
           
static int MS_PER_DAY
           
static int MS_PER_HOUR
           
static int MS_PER_MIN
           
static int MS_PER_SEC
           
static int SERVER_READY_INTERVAL_SEC
           
static java.lang.String XML_HEADER
           
 
Constructor Summary
Util()
           
 
Method Summary
static double acos(double value)
          acos.
static int adjustValue(int value, double contrast, int brightness)
          adjustValue.
static double asin(double value)
          asin.
static double atan(double value)
          atan.
static double cos(double degrees)
          cos.
static long decodeByteCount(java.lang.String count)
          decodeByteCount.
static long decodeTimeInterval(java.lang.String count)
          decodeTimeInterval.
static java.lang.String encodeByteCount(long nBytes)
          encodeByteCount.
static java.lang.String encodeContent(java.lang.String xml)
          encodeContent.
static java.lang.String encodeDateTime(long ms)
          encodeDateTime.
static java.lang.String encodeDuration(int ms)
          encodeDuration.
static java.lang.String encodeException(java.lang.Exception e)
          encodeException.
static java.lang.String encodeHostPort(java.lang.String addr)
          encodeHostPort.
static java.lang.String encodeThrowable(java.lang.Throwable t)
          encodeThrowable.
static java.lang.String encodeTimeInterval(long ms)
          encodeTimeInterval.
static void fill(byte[][][] array, byte value)
          fill.
static void fill(int[][][] array, int value)
           
static void fillBuffer(java.io.DataInputStream in, byte[] buffer, int needed)
          fillBuffer.
static boolean fillBuffer(java.io.DataInputStream in, byte[] buffer, int needed, boolean eofOk)
           
static void fillBuffer(java.io.DataInputStream in, byte[] buffer, int offset, int needed)
           
static boolean fillBuffer(java.io.DataInputStream in, byte[] buffer, int offset, int needed, boolean eofOk)
           
static java.lang.String getAcceptedLogEntry(java.net.Socket s)
          getAcceptedLogEntry.
static java.lang.String getEnv()
          getEnv.
static java.io.File getFile(java.lang.String path)
          getFile.
static java.io.InputStream getInputStream(java.lang.String path)
          getInputStream.
static int indexOf(int value, int[] values)
           
static int indexOf(java.lang.Object o, java.lang.Object[] os)
           
static int indexOf(java.lang.String string, java.lang.String[] strings)
          indexOf.
static Log initLog(XmlParser parser)
          initLog.
static boolean inRange(double min, double value, double max)
          inRange.
static java.lang.String leftJustify(java.lang.String text, int width)
          leftJustify.
static double max(double a, double b)
           
static double max(double a, double b, double c, double d)
           
static int max(int a, int b)
          max.
static int max(int a, int b, int c, int d)
           
static double min(double a, double b)
           
static double min(double a, double b, double c, double d)
           
static int min(int a, int b)
          min.
static int min(int a, int b, int c, int d)
           
static long min(long a, long b)
           
static double modToRange(double min, double value, double max)
          modToRange.
static boolean oneOf(int value, int[] values)
           
static boolean oneOf(java.lang.String string, java.lang.String[] strings)
          oneOf.
static java.lang.String readString(java.io.File file)
          readString.
static java.lang.String rightJustify(java.lang.String text, int width)
          rightJustify.
static java.lang.String setDirectorySeparator(java.lang.String path)
          setDirectorySeparator.
static double sin(double degrees)
          sin.
static void skipBytes(java.io.DataInput in, int nBytes)
          skipBytes.
static void sleep(double seconds)
          sleep.
static void sleep(int ms)
           
static void sleep(long ms)
           
static java.lang.Thread startThread(java.lang.Runnable runnable)
          startThread.
static java.lang.Thread startThread(java.lang.Runnable runnable, boolean daemon)
           
static double tan(double degrees)
          tan.
static void threadDump()
          threadDump.
static java.lang.String toHexString(byte b)
          toHexString.
static double toRange(double min, double value, double max)
           
static int toRange(int min, int value, int max)
          toRange.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MS_PER_SEC

public static final int MS_PER_SEC
See Also:
Constant Field Values

MS_PER_MIN

public static final int MS_PER_MIN
See Also:
Constant Field Values

MS_PER_HOUR

public static final int MS_PER_HOUR
See Also:
Constant Field Values

MS_PER_DAY

public static final int MS_PER_DAY
See Also:
Constant Field Values

lz2

public static final java.text.DecimalFormat lz2

lz6

public static final java.text.DecimalFormat lz6

fp1

public static final java.text.DecimalFormat fp1

fp2

public static final java.text.DecimalFormat fp2

fp3

public static final java.text.DecimalFormat fp3

XML_HEADER

public static final java.lang.String XML_HEADER
See Also:
Constant Field Values

alphabet

public static final char[] alphabet

SERVER_READY_INTERVAL_SEC

public static final int SERVER_READY_INTERVAL_SEC
See Also:
Constant Field Values
Constructor Detail

Util

public Util()
Method Detail

getEnv

public static java.lang.String getEnv()
getEnv.


skipBytes

public static void skipBytes(java.io.DataInput in,
                             int nBytes)
                      throws java.lang.Exception
skipBytes.

Throws:
java.lang.Exception

encodeThrowable

public static java.lang.String encodeThrowable(java.lang.Throwable t)
encodeThrowable.


adjustValue

public static int adjustValue(int value,
                              double contrast,
                              int brightness)
adjustValue.


fill

public static void fill(byte[][][] array,
                        byte value)
fill.


fill

public static void fill(int[][][] array,
                        int value)

initLog

public static Log initLog(XmlParser parser)
                   throws java.lang.Exception
initLog.

Throws:
java.lang.Exception

decodeTimeInterval

public static long decodeTimeInterval(java.lang.String count)
decodeTimeInterval. Default to milliseconds if a unit isn't specified.


decodeByteCount

public static long decodeByteCount(java.lang.String count)
decodeByteCount.


encodeContent

public static java.lang.String encodeContent(java.lang.String xml)
encodeContent.


encodeHostPort

public static java.lang.String encodeHostPort(java.lang.String addr)
encodeHostPort.


getAcceptedLogEntry

public static java.lang.String getAcceptedLogEntry(java.net.Socket s)
getAcceptedLogEntry.


getInputStream

public static java.io.InputStream getInputStream(java.lang.String path)
                                          throws java.lang.Exception
getInputStream.

Throws:
java.lang.Exception

encodeTimeInterval

public static java.lang.String encodeTimeInterval(long ms)
encodeTimeInterval.


encodeByteCount

public static java.lang.String encodeByteCount(long nBytes)
encodeByteCount.


encodeException

public static java.lang.String encodeException(java.lang.Exception e)
encodeException.


encodeDateTime

public static java.lang.String encodeDateTime(long ms)
encodeDateTime.


encodeDuration

public static java.lang.String encodeDuration(int ms)
encodeDuration.


leftJustify

public static java.lang.String leftJustify(java.lang.String text,
                                           int width)
leftJustify.


rightJustify

public static java.lang.String rightJustify(java.lang.String text,
                                            int width)
rightJustify.


sleep

public static void sleep(double seconds)
sleep.


sleep

public static void sleep(int ms)

sleep

public static void sleep(long ms)

fillBuffer

public static void fillBuffer(java.io.DataInputStream in,
                              byte[] buffer,
                              int needed)
                       throws java.lang.Exception
fillBuffer.

Throws:
java.lang.Exception

fillBuffer

public static void fillBuffer(java.io.DataInputStream in,
                              byte[] buffer,
                              int offset,
                              int needed)
                       throws java.lang.Exception
Throws:
java.lang.Exception

fillBuffer

public static boolean fillBuffer(java.io.DataInputStream in,
                                 byte[] buffer,
                                 int needed,
                                 boolean eofOk)
                          throws java.lang.Exception
Throws:
java.lang.Exception

fillBuffer

public static boolean fillBuffer(java.io.DataInputStream in,
                                 byte[] buffer,
                                 int offset,
                                 int needed,
                                 boolean eofOk)
                          throws java.lang.Exception
Throws:
java.lang.Exception

min

public static int min(int a,
                      int b)
min.


min

public static int min(int a,
                      int b,
                      int c,
                      int d)

min

public static long min(long a,
                       long b)

min

public static double min(double a,
                         double b)

min

public static double min(double a,
                         double b,
                         double c,
                         double d)

max

public static int max(int a,
                      int b)
max.


max

public static int max(int a,
                      int b,
                      int c,
                      int d)

max

public static double max(double a,
                         double b)

max

public static double max(double a,
                         double b,
                         double c,
                         double d)

inRange

public static boolean inRange(double min,
                              double value,
                              double max)
inRange.


toRange

public static int toRange(int min,
                          int value,
                          int max)
toRange.


toRange

public static double toRange(double min,
                             double value,
                             double max)

modToRange

public static double modToRange(double min,
                                double value,
                                double max)
modToRange.


indexOf

public static int indexOf(java.lang.String string,
                          java.lang.String[] strings)
indexOf.


indexOf

public static int indexOf(int value,
                          int[] values)

indexOf

public static int indexOf(java.lang.Object o,
                          java.lang.Object[] os)

oneOf

public static boolean oneOf(java.lang.String string,
                            java.lang.String[] strings)
oneOf.


oneOf

public static boolean oneOf(int value,
                            int[] values)

toHexString

public static java.lang.String toHexString(byte b)
toHexString.


startThread

public static java.lang.Thread startThread(java.lang.Runnable runnable)
startThread.


startThread

public static java.lang.Thread startThread(java.lang.Runnable runnable,
                                           boolean daemon)

sin

public static double sin(double degrees)
sin.


cos

public static double cos(double degrees)
cos.


tan

public static double tan(double degrees)
tan.


asin

public static double asin(double value)
asin.


acos

public static double acos(double value)
acos.


atan

public static double atan(double value)
atan.


readString

public static java.lang.String readString(java.io.File file)
                                   throws java.lang.Exception
readString.

Throws:
java.lang.Exception

getFile

public static java.io.File getFile(java.lang.String path)
getFile.


setDirectorySeparator

public static java.lang.String setDirectorySeparator(java.lang.String path)
setDirectorySeparator.


threadDump

public static void threadDump()
threadDump.


Simulcast 4.2