## org.codehaus.groovy.runtime
Class DefaultGroovyStaticMethods

    java.lang.Object
      org.codehaus.groovy.runtime.DefaultGroovyStaticMethods

    public class DefaultGroovyStaticMethods

extends Object

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.

Version:
  $Revision: 9764 $
Author:
  Guillaume Laforge, Dierk Koenig, Joachim Baumann

Constructor Summary
`DefaultGroovyStaticMethods()`

Method Summary
`static Matcher` `getLastMatcher(Matcher matcher)` Get the last hidden matcher that system used to do a match.
`static void` `sleep(Object object, long milliseconds)` Sleep for so many milliseconds, even if interrupted.
`static void` `sleep(Object object, long milliseconds, Closure onInterrupt)` Sleep for so many milliseconds
`protected static void` `sleepImpl(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 Thread` `start(Thread self, Closure closure)` Start a Thread with 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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultGroovyStaticMethods

    public DefaultGroovyStaticMethods()

Method Detail

### start

    public static Thread start(Thread self,
                               Closure closure)

  Start a Thread with the given closure as a Runnable instance.

  Parameters:
    `self` - the thread on which the method is called
    `closure` - the Runnable closure
  Returns:
    the started thread

### startDaemon

    public static Thread startDaemon(Thread self,
                                     Closure closure)

  Start a daemon Thread with the given closure as a Runnable instance.

  Parameters:
    `self` - the thread on which the method is called
    `closure` - the Runnable closure
  Returns:
    the started thread

### getLastMatcher

    public static Matcher getLastMatcher(Matcher matcher)

  Get the last hidden matcher that system used to do a match.

  Parameters:
    `matcher` -
  Returns:
    the last regex matcher

### sleepImpl

    protected static void sleepImpl(Object object,
                                    long millis,
                                    Closure closure)

  This method is used by both sleep() methods to imlement sleeping for the given time even if interrupted

  Parameters:
    `object` - receiver
    `millis` - the number of milliseconds to sleep
    `closure` - optional closure called when interrupted as long as the closure returns false the sleep continues

### sleep

    public static void sleep(Object object,
                             long milliseconds)

  Sleep for so many milliseconds, even if interrupted.

  Parameters:
    `object` - receiver
    `milliseconds` - the number of milliseconds to sleep

### sleep

    public static void sleep(Object object,
                             long milliseconds,
                             Closure onInterrupt)

  Sleep for so many milliseconds

  Parameters:
    `object` - receiver
    `milliseconds` - the number of milliseconds to sleep
    `onInterrupt` - interrupt handler, InterruptedException is passed to the Closure as long as it returns false, the sleep continues

Copyright © 2003-2008 The Codehaus. All rights reserved.