|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucl.physiol.neuroconstruct.utils.GeneralUtils
public class GeneralUtils
Assorted handy utilities
| Field Summary | |
|---|---|
static String |
ARCH_64BIT
|
static String |
ARCH_I386
|
static String |
ARCH_I686
|
static String |
ARCH_POWERPC
|
static String |
ARCH_UMAC
|
static String |
DIR_64BIT
|
static String |
DIR_I686
|
static String |
DIR_POWERPC
|
static String |
DIR_UMAC
|
| Constructor Summary | |
|---|---|
GeneralUtils()
|
|
| Method Summary | |
|---|---|
static String |
convertToCygwinPath(String winPath)
Converts c\:temp to /cygdrive/c/temp etc. |
static boolean |
copyDirIntoDir(File originalDir,
File dirToCopyTo,
boolean includeSubDirs,
boolean ignoreCVS)
|
static File |
copyFileIntoDir(File originalFile,
File dirToCopyTo)
|
static String |
getArchSpecificDir()
|
static String |
getBetterFileName(String oldName)
Does a quick check for spaces, etc. |
static String |
getBold(float num,
boolean tabIt)
|
static String |
getBold(int num,
boolean tabIt)
|
static String |
getBold(String text,
boolean tabIt)
|
static String |
getBoldColouredString(String text,
String colour,
boolean html)
Quick way to get either a string in plaintext, or a html coloured string depending on a boolean value |
static String |
getColouredString(String text,
String colour,
boolean html)
Quick way to get either a string in plaintext, or a html coloured string depending on a boolean value |
static String |
getCurrentDateAsNiceString()
|
static String |
getCurrentTimeAsNiceString()
|
static String |
getCurrentTimeAsNiceStringWithMillis()
|
static String |
getEndLine(boolean html)
|
static Color |
getFractionalColour(Color zeroColour,
Color oneColour,
double fraction)
Gets a colour the specified fraction along a line between the two colours in 3D Red Green Blue space. |
static String |
getLocalHostname()
|
static String |
getMaxLenLine(String line,
int maxLength)
|
static String |
getMinLenLine(String line,
int minLength)
Handy to ensure printed comments etc. |
static String |
getNiceStringForSeconds(String timeInSeconds)
|
static ArrayList |
getOrderedList(Enumeration en,
boolean ascending)
|
static Color |
getRainbowColour(double fraction)
Gets a colour from Red to Violet, based on the fraction given. |
static String |
getTabbedString(String text,
String tabName,
boolean tabIt)
Quick way to get either a string in plaintext, or a html formatted string depending on a boolean value |
static boolean |
includeOsbProjects()
|
static boolean |
includeParallelFunc()
A simple check on whether to incl parallel/Python functionality. |
static String |
incrementName(String name)
Convenient function for creating an incremented string, e.g. |
static boolean |
is64bitPlatform()
|
static boolean |
isLinuxBasedPlatform()
|
static boolean |
isMacBasedPlatform()
|
static boolean |
isVersionControlDir(File dir)
|
static boolean |
isVersionControlDir(String dirname)
|
static boolean |
isWindowsBasedPlatform()
|
static void |
main(String[] args)
|
static String |
parseForHyperlinks(String text)
|
static void |
printMemory(boolean forcePrint)
|
static String |
readShortFile(File shortFile)
|
static void |
removeAllFiles(File directory,
boolean warn,
boolean removeDirToo,
boolean removeVC)
|
static AbstractList |
reorderAlphabetically(AbstractList list,
boolean ascending)
|
static File[] |
reorderAlphabetically(File[] files,
boolean ascending)
|
static String |
replaceAllTokens(String line,
String oldToken,
String newToken)
Replaces all occurances of the old token with the new one |
static String |
replaceToken(String line,
String oldToken,
String newToken,
int fromIndex)
Replaces the first occurance of the old token with the new one from the specified index |
static void |
timeCheck(String marker)
Prints the current time and the time since the function was last called Useful for timing methods |
static void |
timeCheck(String marker,
boolean alsoSysOut)
Prints the current time and the time since the function was last called Useful for timing methods |
static ArrayList<File> |
toArrayList(File[] files)
|
String |
truncateString(String longString,
int length,
boolean dotsToo)
Truncates a long string to the maximum length specified, and optionally adds three dots... |
static String |
wrapLine(String origLine,
String endLine,
int wrapLength)
Assumes a long string input, into which an endLine (usually \n or ) will be placed after every wrap characters |
static void |
writeShortFile(File shortFile,
String contents)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ARCH_I686
public static final String ARCH_I386
public static final String ARCH_64BIT
public static final String ARCH_POWERPC
public static final String ARCH_UMAC
public static final String DIR_I686
public static final String DIR_64BIT
public static final String DIR_POWERPC
public static final String DIR_UMAC
| Constructor Detail |
|---|
public GeneralUtils()
| Method Detail |
|---|
public static String getArchSpecificDir()
public static boolean is64bitPlatform()
public static boolean isWindowsBasedPlatform()
public static boolean isVersionControlDir(String dirname)
public static boolean isVersionControlDir(File dir)
public static boolean includeParallelFunc()
public static boolean includeOsbProjects()
public static boolean isLinuxBasedPlatform()
public static boolean isMacBasedPlatform()
public static String getLocalHostname()
public static void printMemory(boolean forcePrint)
public static void writeShortFile(File shortFile,
String contents)
throws IOException
IOExceptionpublic static String readShortFile(File shortFile)
public static void timeCheck(String marker)
marker - A string identifing the time step
public static void timeCheck(String marker,
boolean alsoSysOut)
marker - A string identifing the time stepalsoSysOut - If true, also prints output to system out
public String truncateString(String longString,
int length,
boolean dotsToo)
public static String getCurrentTimeAsNiceStringWithMillis()
public static String getNiceStringForSeconds(String timeInSeconds)
public static String getCurrentTimeAsNiceString()
public static String getCurrentDateAsNiceString()
public static ArrayList<File> toArrayList(File[] files)
public static File[] reorderAlphabetically(File[] files,
boolean ascending)
public static AbstractList reorderAlphabetically(AbstractList list,
boolean ascending)
public static ArrayList getOrderedList(Enumeration en,
boolean ascending)
public static String parseForHyperlinks(String text)
public static String replaceToken(String line,
String oldToken,
String newToken,
int fromIndex)
public static String replaceAllTokens(String line,
String oldToken,
String newToken)
public static String incrementName(String name)
public static String getBetterFileName(String oldName)
public static String getTabbedString(String text,
String tabName,
boolean tabIt)
public static String getBold(String text,
boolean tabIt)
public static String getBold(int num,
boolean tabIt)
public static String getBold(float num,
boolean tabIt)
public static String getColouredString(String text,
String colour,
boolean html)
public static String getBoldColouredString(String text,
String colour,
boolean html)
public static String getEndLine(boolean html)
public static String getMaxLenLine(String line,
int maxLength)
public static String getMinLenLine(String line,
int minLength)
public static File copyFileIntoDir(File originalFile,
File dirToCopyTo)
throws IOException
IOException
public static boolean copyDirIntoDir(File originalDir,
File dirToCopyTo,
boolean includeSubDirs,
boolean ignoreCVS)
throws IOException
IOException
public static Color getFractionalColour(Color zeroColour,
Color oneColour,
double fraction)
public static Color getRainbowColour(double fraction)
public static String convertToCygwinPath(String winPath)
public static void removeAllFiles(File directory,
boolean warn,
boolean removeDirToo,
boolean removeVC)
public static String wrapLine(String origLine,
String endLine,
int wrapLength)
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||