public class DefaultGroovyStaticMethods
extends java.lang.Object
Constructor and Description |
---|
DefaultGroovyStaticMethods() |
Modifier and Type | Method and Description |
---|---|
static java.util.regex.Matcher |
getLastMatcher(java.util.regex.Matcher matcher)
Get the last hidden matcher that system used to do a match.
|
static void |
sleep(java.lang.Object object,
long milliseconds)
Sleep for so many milliseconds, even if interrupted.
|
static void |
sleep(java.lang.Object object,
long milliseconds,
Closure onInterrupt)
Sleep for so many milliseconds
|
protected static void |
sleepImpl(java.lang.Object object,
long millis,
Closure closure)
This method is used by both sleep() methods to imlement sleeping
for the given time even if interrupted
|
static java.lang.Thread |
start(java.lang.Thread self,
Closure closure)
Start a Thread with the given closure as a Runnable instance.
|
static java.lang.Thread |
startDaemon(java.lang.Thread self,
Closure closure)
Start a daemon Thread with the given closure as a Runnable instance.
|
public static java.lang.Thread start(java.lang.Thread self, Closure closure)
self
- the thread on which the method is calledclosure
- the Runnable closurepublic static java.lang.Thread startDaemon(java.lang.Thread self, Closure closure)
self
- the thread on which the method is calledclosure
- the Runnable closurepublic static java.util.regex.Matcher getLastMatcher(java.util.regex.Matcher matcher)
matcher
- protected static void sleepImpl(java.lang.Object object, long millis, Closure closure)
object
- receivermillis
- the number of milliseconds to sleepclosure
- optional closure called when interrupted
if the closure returns true the sleep continuespublic static void sleep(java.lang.Object object, long milliseconds)
object
- receivermilliseconds
- the number of milliseconds to sleeppublic static void sleep(java.lang.Object object, long milliseconds, Closure onInterrupt)
object
- receivermilliseconds
- the number of milliseconds to sleeponInterrupt
- interrupt handler, InterruptedException is passed to the Closure
if it returns true, the sleep continues