All Packages Class Hierarchy This Package Previous Next Index
Class JBMSTours.Util
java.lang.Object
|
+----JBMSTours.Util
- public class Util
- extends Object
This is a utility class with static methods for doing various unrelated
things.
-
Util()
-
-
doubleMyInt(int[])
-
-
lineSeparator()
- Return the line separator for the OS.
-
println()
- Does a System.out.println unless a property is set.
-
println(Object)
- Does a System.out.println unless a property is set.
-
round(double, double)
- Round a double to the given precision.
-
wrapAsJavaExpressionWithComma(String)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
-
wrapAsSQLDate(Date)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
-
wrapAsSQLDateWithComma(Date)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
-
wrapAsSQLTime(Time)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
-
wrapAsSQLTimeWithComma(Time)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
-
wrapAsString(String)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
-
wrapAsStringSQ(String)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
-
wrapAsStringWithComma(String)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
-
wrapAsStringWithCommaSQ(String)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
-
wrapIntWithComma(int)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
-
wrapShortWithComma(short)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
Util
public Util()
round
public static double round(double valueToRound,
double roundPrecision)
- Round a double to the given precision. Round positive numbers up,
and negative numbers down.
- Parameters:
- valueToRound - The double to round
- roundPrecision - The precision to round the number to.
For example, if you want to round a
number to the nearest hundredth, the value
of this parameter should be 0.01. It is
possible to round to precisions that
are not powers of 10.
- Returns:
- The rounded value.
println
public static void println(Object s)
- Does a System.out.println unless a property is set.
Allows you to avoid printing out messages for database-side
methods, when application and server are running in different
JVMs (client/server scenario or synchronization scenario).
In those situations, set JBMSTours.databaseSide to true before
starting up the server or the source database.
- Parameters:
- The - string to print.
println
public static void println()
- Does a System.out.println unless a property is set.
Allows you to avoid printing out messages for database-side
methods, when application and server are running in different
JVMs (client/server scenario or synchronization scenario).
In those situations, set JBMSTours.databaseSide to true before
starting up the server or the source database.
wrapAsString
public static String wrapAsString(String s)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
- Parameters:
- s - a String
- Returns:
- The String wrapped in quotation marks.
wrapAsStringSQ
public static String wrapAsStringSQ(String s)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
- Parameters:
- s - a String
- Returns:
- The String wrapped in single quotation marks.
wrapAsStringWithComma
public static String wrapAsStringWithComma(String s)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
- Parameters:
- s - a String
- Returns:
- The String wrapped in quotation marks and a comma.
wrapAsStringWithCommaSQ
public static String wrapAsStringWithCommaSQ(String s)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
- Parameters:
- s - a String
- Returns:
- The String wrapped in single quotation marks and a comma.
wrapAsJavaExpressionWithComma
public static String wrapAsJavaExpressionWithComma(String s)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
- Parameters:
- s - a String
- Returns:
- The string returned without any quotation marks,but with a comma.
wrapIntWithComma
public static String wrapIntWithComma(int i)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
- Parameters:
- i - an int
- Returns:
- The int plus a comma
wrapShortWithComma
public static String wrapShortWithComma(short s)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
- Parameters:
- s - a short
- Returns:
- The short plus a comma
wrapAsSQLDate
public static String wrapAsSQLDate(Date d)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
- Parameters:
- d - a date
- Returns:
- AN SQL represenation of the date.
wrapAsSQLTime
public static String wrapAsSQLTime(Time t)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
- Parameters:
- t - a time
- Returns:
- AN SQL represenation of the time.
wrapAsSQLDateWithComma
public static String wrapAsSQLDateWithComma(Date d)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
- Parameters:
- d - a date
- Returns:
- AN SQL represenation of the date plus a comma.
wrapAsSQLTimeWithComma
public static String wrapAsSQLTimeWithComma(Time t)
- Used for extracting data into an SQL script or into Java
program for re-insert (CreateScript).
- Parameters:
- d - a date
- Returns:
- AN SQL represenation of the date plus a comma.
doubleMyInt
public static void doubleMyInt(int i[])
lineSeparator
public static String lineSeparator()
- Return the line separator for the OS.
- Returns:
- The line separator.
All Packages Class Hierarchy This Package Previous Next Index