|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.runtime.DefaultGroovyStaticMethods
public class DefaultGroovyStaticMethods
This class defines all the new static groovy methods which appear on normal JDK classes inside the Groovy environment. Static methods are used with the first parameter as the destination class.
Constructor Summary | |
---|---|
DefaultGroovyStaticMethods()
|
Method Summary | |
---|---|
private static java.lang.Thread |
createThread(java.lang.String name,
boolean daemon,
Closure closure)
|
static java.util.regex.Matcher |
getLastMatcher(java.util.regex.Matcher self)
Get the last hidden matcher that the system used to do a match. |
static java.util.Date |
parse(java.util.Date self,
java.lang.String format,
java.lang.String input)
This convenience method acts as a wrapper for SimpleDateFormat . |
static void |
sleep(java.lang.Object self,
long milliseconds)
Sleep for so many milliseconds, even if interrupted. |
static void |
sleep(java.lang.Object self,
long milliseconds,
Closure onInterrupt)
Sleep for so many milliseconds, using a given closure for interrupt processing. |
private static void |
sleepImpl(long millis,
Closure closure)
This method is used by both sleep() methods to implement 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 |
start(java.lang.Thread self,
java.lang.String name,
Closure closure)
Start a Thread with a given name and 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. |
static java.lang.Thread |
startDaemon(java.lang.Thread self,
java.lang.String name,
Closure closure)
Start a daemon Thread with a given name and the given closure as a Runnable instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultGroovyStaticMethods()
Method Detail |
---|
public static java.lang.Thread start(java.lang.Thread self, Closure closure)
self
- placeholder variable used by Groovy categories; ignored for default static methodsclosure
- the Runnable closure
public static java.lang.Thread start(java.lang.Thread self, java.lang.String name, Closure closure)
self
- placeholder variable used by Groovy categories; ignored for default static methodsname
- the name to give the threadclosure
- the Runnable closure
public static java.lang.Thread startDaemon(java.lang.Thread self, Closure closure)
self
- placeholder variable used by Groovy categories; ignored for default static methodsclosure
- the Runnable closure
public static java.lang.Thread startDaemon(java.lang.Thread self, java.lang.String name, Closure closure)
self
- placeholder variable used by Groovy categories; ignored for default static methodsname
- the name to give the threadclosure
- the Runnable closure
private static java.lang.Thread createThread(java.lang.String name, boolean daemon, Closure closure)
public static java.util.regex.Matcher getLastMatcher(java.util.regex.Matcher self)
self
- placeholder variable used by Groovy categories; ignored for default static methods
private static void sleepImpl(long millis, Closure closure)
millis
- the number of milliseconds to sleepclosure
- optional closure called when interrupted
as long as the closure returns false the sleep continuespublic static void sleep(java.lang.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(java.lang.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 continuespublic static java.util.Date parse(java.util.Date self, java.lang.String format, java.lang.String input) throws java.text.ParseException
SimpleDateFormat
.
self
- placeholder variable used by Groovy categories; ignored for default static methodsformat
- pattern used to parse the input string.input
- String to be parsed to create the date instance
java.text.ParseException
- if there is a parse errorDateFormat.parse(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |