public class DefaultGroovyStaticMethods extends Object
Constructor and Description |
---|
DefaultGroovyStaticMethods() |
Modifier and Type | Method and Description |
---|---|
static File |
createTempDir(File self) |
static File |
createTempDir(File self,
String prefix,
String suffix) |
static long |
currentTimeSeconds(System self)
Get the current time in seconds
|
static String |
dumpAll(Thread self)
Dump the thread dump of all threads
|
static ResourceBundle |
getBundle(ResourceBundle self,
String bundleName)
Works exactly like ResourceBundle.getBundle(String).
|
static ResourceBundle |
getBundle(ResourceBundle self,
String bundleName,
Locale locale)
Works exactly like ResourceBundle.getBundle(String, Locale).
|
static Matcher |
getLastMatcher(Matcher self)
Get the last hidden matcher that the system used to do a match.
|
static Date |
parse(Date self,
String format,
String input)
Deprecated.
|
static Date |
parse(Date self,
String format,
String input,
TimeZone zone)
Deprecated.
|
static Date |
parseToStringDate(Date self,
String dateToString)
Deprecated.
|
static void |
sleep(Object self,
long milliseconds)
Sleep for so many milliseconds, even if interrupted.
|
static void |
sleep(Object self,
long milliseconds,
Closure onInterrupt)
Sleep for so many milliseconds, using a given closure for interrupt processing.
|
static Thread |
start(Thread self,
Closure closure)
Start a Thread with the given closure as a Runnable instance.
|
static Thread |
start(Thread self,
String name,
Closure closure)
Start a Thread with a given name and the given closure
as a Runnable instance.
|
static Thread |
startDaemon(Thread self,
Closure closure)
Start a daemon Thread with the given closure as a Runnable instance.
|
static Thread |
startDaemon(Thread self,
String name,
Closure closure)
Start a daemon Thread with a given name and the given closure as
a Runnable instance.
|
public static Thread start(Thread self, Closure closure)
self
- placeholder variable used by Groovy categories; ignored for default static methodsclosure
- the Runnable closurepublic static Thread start(Thread self, String name, Closure closure)
self
- placeholder variable used by Groovy categories; ignored for default static methodsname
- the name to give the threadclosure
- the Runnable closurepublic static Thread startDaemon(Thread self, Closure closure)
self
- placeholder variable used by Groovy categories; ignored for default static methodsclosure
- the Runnable closurepublic static Thread startDaemon(Thread self, String name, Closure closure)
self
- placeholder variable used by Groovy categories; ignored for default static methodsname
- the name to give the threadclosure
- the Runnable closurepublic static String dumpAll(Thread self)
self
- placeholder variable used by Groovy categories; ignored for default static methodspublic static Matcher getLastMatcher(Matcher self)
self
- placeholder variable used by Groovy categories; ignored for default static methodspublic static void sleep(Object self, long milliseconds)
self
- placeholder variable used by Groovy categories; ignored for default static methodsmilliseconds
- the number of milliseconds to sleeppublic static void sleep(Object self, long milliseconds, Closure onInterrupt)
self
- placeholder variable used by Groovy categories; ignored for default static methodsmilliseconds
- the number of milliseconds to sleeponInterrupt
- interrupt handler, InterruptedException is passed to the Closure
as long as it returns false, the sleep continues@Deprecated public static Date parse(Date self, String format, String input) throws ParseException
ParseException
@Deprecated public static Date parse(Date self, String format, String input, TimeZone zone) throws ParseException
ParseException
@Deprecated public static Date parseToStringDate(Date self, String dateToString) throws ParseException
ParseException
public static ResourceBundle getBundle(ResourceBundle self, String bundleName)
self
- placeholder variable used by Groovy categories; ignored for default static methodsbundleName
- the name of the bundle.ResourceBundle.getBundle(java.lang.String)
public static ResourceBundle getBundle(ResourceBundle self, String bundleName, Locale locale)
self
- placeholder variable used by Groovy categories; ignored for default static methodsbundleName
- the name of the bundle.locale
- the specific localeResourceBundle.getBundle(java.lang.String, java.util.Locale)
public static File createTempDir(File self) throws IOException
IOException
public static File createTempDir(File self, String prefix, String suffix) throws IOException
IOException
public static long currentTimeSeconds(System self)
self
- placeholder variable used by Groovy categories; ignored for default static methodsSystem.currentTimeMillis()