Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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: 13717 $
Author:
  Guillaume Laforge, Dierk Koenig, Joachim Baumann, Paul King

Constructor Summary
`DefaultGroovyStaticMethods()`

Method Summary
`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)` This convenience method acts as a wrapper for `SimpleDateFormat`.
`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.

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` - placeholder variable used by Groovy categories; ignored for default static methods
    `closure` - the Runnable closure
  Returns:
    the started thread

### start

    public static Thread start(Thread self,
                               String name,
                               Closure closure)

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

  Parameters:
    `self` - placeholder variable used by Groovy categories; ignored for default static methods
    `name` - the name to give the thread
    `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` - placeholder variable used by Groovy categories; ignored for default static methods
    `closure` - the Runnable closure
  Returns:
    the started thread

### startDaemon

    public 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.

  Parameters:
    `self` - placeholder variable used by Groovy categories; ignored for default static methods
    `name` - the name to give the thread
    `closure` - the Runnable closure
  Returns:
    the started thread

### getLastMatcher

    public static Matcher getLastMatcher(Matcher self)

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

  Parameters:
    `self` - placeholder variable used by Groovy categories; ignored for default static methods
  Returns:
    the last regex matcher

### sleep

    public static void sleep(Object self,
                             long milliseconds)

  Sleep for so many milliseconds, even if interrupted.

  Parameters:
    `self` - placeholder variable used by Groovy categories; ignored for default static methods
    `milliseconds` - the number of milliseconds to sleep

### sleep

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

  Sleep for so many milliseconds, using a given closure for interrupt processing.

  Parameters:
    `self` - placeholder variable used by Groovy categories; ignored for default static methods
    `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

### parse

    public static Date parse(Date self,
                             String format,
                             String input)
                      throws ParseException

  This convenience method acts as a wrapper for `SimpleDateFormat`.

  Parameters:
    `self` - placeholder variable used by Groovy categories; ignored for default static methods
    `format` - pattern used to parse the input string.
    `input` - String to be parsed to create the date instance
  Returns:
    a new Date instance representing the parsed input string
  Throws:
    `ParseException` - if there is a parse error
  See Also:
    `DateFormat.parse(String)`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2003-2008 The Codehaus. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD