jskat.share
Class Tools

java.lang.Object
  extended by jskat.share.Tools

public class Tools
extends java.lang.Object

Author:
Markus J. Luzius , Jan Schäfer

Constructor Summary
Tools()
           
 
Method Summary
static void checkLog()
          Makes sure that a log4j appender exists.
static boolean checkPath(java.lang.String path, boolean doCreate)
           
static java.lang.String dump(int[] values)
          Converts an int array to a String
static java.lang.String dumpCards(java.util.HashSet[] values)
          Converts a HashSet array of Cards to a String
static java.lang.String dumpCards(java.util.Vector values)
          Converts a HashSet Vector of Cards to a String
static boolean isIn(int toCheck, int[] list)
          Checks whether a number is in a given set of numbers
static void setNewLogfile(java.lang.String filename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tools

public Tools()
Method Detail

checkLog

public static void checkLog()
Makes sure that a log4j appender exists. If no appenders can be found, then a simple console logger is created.


dump

public static java.lang.String dump(int[] values)
Converts an int array to a String

Parameters:
values - int array
Returns:
string

dumpCards

public static java.lang.String dumpCards(java.util.HashSet[] values)
Converts a HashSet array of Cards to a String

Parameters:
values - int array
Returns:
string

dumpCards

public static java.lang.String dumpCards(java.util.Vector values)
Converts a HashSet Vector of Cards to a String

Parameters:
values - int array
Returns:
string

setNewLogfile

public static void setNewLogfile(java.lang.String filename)

checkPath

public static boolean checkPath(java.lang.String path,
                                boolean doCreate)

isIn

public static boolean isIn(int toCheck,
                           int[] list)
Checks whether a number is in a given set of numbers

Parameters:
toCheck - the number that should be checked
list - a list, usually defined by new int[] {a, b, c, ...}
Returns: