org.codehaus.groovy.runtime
Class DefaultGroovyMethods

java.lang.Object
  extended by org.codehaus.groovy.runtime.DefaultGroovyMethodsSupport
      extended by org.codehaus.groovy.runtime.DefaultGroovyMethods

public class DefaultGroovyMethods
extends DefaultGroovyMethodsSupport

This class defines all the new groovy methods which appear on normal JDK classes inside the Groovy environment. Static methods are used with the first parameter the destination class.

Version:
$Revision: 16365 $
Author:
James Strachan, Jeremy Rayner, Sam Pullara, Rod Cope, Guillaume Laforge, John Wilson, Hein Meling, Dierk Koenig, Pilho Kim, Marc Guillemot, Russel Winder, bing ran, Jochen Theodorou, Paul King, Michael Baehr, Joachim Baumann, Alex Tkachman, Ted Naleid

Nested Class Summary
protected static class DefaultGroovyMethods.ProcessRunner
          A Runnable which waits for a process to complete together with a notification scheme allowing another thread to wait a maximum number of seconds for the process to complete before killing it.
 
Nested classes/interfaces inherited from class org.codehaus.groovy.runtime.DefaultGroovyMethodsSupport
DefaultGroovyMethodsSupport.RangeInfo
 
Field Summary
static Class[] additionals
           
 
Constructor Summary
DefaultGroovyMethods()
           
 
Method Summary
static double abs(Double number)
          Get the absolute value
static float abs(Float number)
          Get the absolute value
static long abs(Long number)
          Get the absolute value
static int abs(Number number)
          Get the absolute value
static Socket accept(ServerSocket serverSocket, Closure closure)
          Accepts a connection and passes the resulting Socket to the closure which runs in a new Thread.
static void addShutdownHook(Object self, Closure closure)
          Allows the usage of addShutdownHook without getting the runtime first.
static BitSet and(BitSet left, BitSet right)
          Bitwise AND together two BitSets.
static Boolean and(Boolean left, Boolean right)
          Logical conjunction of two boolean operators.
static Number and(Number left, Number right)
          Bitwise AND together two Numbers.
static boolean any(Map self, Closure closure)
          Iterates over the entries of a map, and checks whether a predicate is valid for at least one entry
static boolean any(Object self)
          Iterates over the elements of a collection, and checks whether at least one element is true according to the Groovy Truth.
static boolean any(Object self, Closure closure)
          Iterates over the contents of an object or collection, and checks whether a predicate is valid for at least one element.
static void append(File file, byte[] bytes)
          Append bytes to the end of a File.
static void append(File self, InputStream stream)
          Append binary data to the file.
static void append(File file, Object text)
          Append the text at the end of the File.
static void append(File file, Object text, String charset)
          Append the text at the end of the File, using a specified encoding.
static Collection asImmutable(Collection self)
          A convenience method for creating an immutable Collection.
static List asImmutable(List self)
          A convenience method for creating an immutable list
static Map asImmutable(Map self)
          A convenience method for creating an immutable map.
static Set asImmutable(Set self)
          A convenience method for creating an immutable list.
static SortedMap asImmutable(SortedMap self)
          A convenience method for creating an immutable sorted map.
static SortedSet asImmutable(SortedSet self)
          A convenience method for creating an immutable sorted set.
static List asList(Collection self)
          Converts this collection to a List.
static Collection asSynchronized(Collection self)
          A convenience method for creating a synchronized Collection.
static List asSynchronized(List self)
          A convenience method for creating a synchronized List.
static Map asSynchronized(Map self)
          A convenience method for creating a synchronized Map.
static Set asSynchronized(Set self)
          A convenience method for creating a synchronized Set.
static SortedMap asSynchronized(SortedMap self)
          A convenience method for creating a synchronized SortedMap.
static SortedSet asSynchronized(SortedSet self)
          A convenience method for creating a synchronized SortedSet.
static Object asType(Closure cl, Class clazz)
          Coerces the closure to an implementation of the given class.
static Object asType(Collection col, Class clazz)
          Converts the given collection to another type.
static Object asType(File f, Class c)
          Converts this File to a Writable or delegates to default asType(Object,Class).
static Object asType(GString self, Class c)
          Converts the GString to a File, or delegates to the default asType(Object,Class)
static Object asType(Map map, Class clazz)
          Coerces this map to the given type, using the map's keys as the public method names, and values as the implementation.
static Object asType(Number self, Class c)
          Transform this number to a the given type, using the 'as' operator.
static Object asType(Object[] ary, Class clazz)
          Converts the given array to either a List, Set, or SortedSet.
static Object asType(Object obj, Class type)
          Converts a given object to a type.
static Object asType(String self, Class c)
          Provides a method to perform custom 'dynamic' type conversion to the given class using the as operator.
static File asWritable(File file)
          Converts this File to a Writable.
static File asWritable(File file, String encoding)
          Allows a file to return a Writable implementation that can output itself to a Writer stream.
static BitSet bitwiseNegate(BitSet self)
          Bitwise NEGATE a BitSet.
static Pattern bitwiseNegate(String self)
          Turns a String into a regular expression Pattern
protected static Object callClosureForLine(Closure closure, String line, int counter)
           
protected static Object callClosureForMapEntry(Closure closure, Map.Entry entry)
           
protected static Object callClosureForMapEntryAndCounter(Closure closure, Map.Entry entry, int counter)
           
static String center(String self, Number numberOfChars)
          Center a String and pad it with spaces appended around it
static String center(String self, Number numberOfChars, String padding)
          Center a String and pad it with the characters appended around it
static List collect(Collection self, Closure closure)
          Iterates through this collection transforming each entry into a new value using the closure as a transformer, returning a list of transformed values.
static Collection collect(Collection self, Collection collection, Closure closure)
          Iterates through this collection transforming each value into a new value using the closure as a transformer, returning an initial collection plus the transformed values.
static List collect(Map self, Closure closure)
          Iterates through this Map transforming each entry into a new value using the closure as a transformer, returning a list of transformed values.
static Collection collect(Map self, Collection collection, Closure closure)
          Iterates through this Map transforming each entry into a new value using the closure as a transformer, returning a list of transformed values.
static List collect(Object self, Closure closure)
          Iterates through this object transforming each value into a new value using the closure as a transformer, returning a list of transformed values.
static Collection collect(Object self, Collection collection, Closure closure)
          Iterates through this object transforming each object into a new value using the closure as a transformer and adding it to the collection, returning the resulting collection.
static List collectAll(Collection self, Closure closure)
          Recursively iterates through this collection transforming each non-Collection value into a new value using the closure as a transformer.
static Collection collectAll(Collection self, Collection collection, Closure closure)
          Recursively iterates through this collection transforming each non-Collection value into a new value using the closure as a transformer.
static List combinations(Collection self)
          Adds GroovyCollections#combinations(Collection) as a method on collections.
static int compareTo(Character left, Character right)
          Compare two Characters.
static int compareTo(Character left, Number right)
          Compare a Character and a Number.
static int compareTo(Number left, Character right)
          Compare a Number and a Character.
static int compareTo(Number left, Number right)
          Compare two Numbers.
static void consumeProcessErrorStream(Process self, OutputStream err)
          Gets the error stream from a process and reads it to keep the process from blocking due to a full buffer.
static void consumeProcessErrorStream(Process self, StringBuffer error)
          Gets the error stream from a process and reads it to keep the process from blocking due to a full buffer.
static void consumeProcessErrorStream(Process self, Writer err)
          Gets the error stream from a process and reads it to keep the process from blocking due to a full buffer.
static void consumeProcessOutput(Process self)
          Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer.
static void consumeProcessOutput(Process self, OutputStream output, OutputStream error)
          Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer.
static void consumeProcessOutput(Process self, StringBuffer output, StringBuffer error)
          Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer.
static void consumeProcessOutputStream(Process self, OutputStream output)
          Gets the output stream from a process and reads it to keep the process from blocking due to a full output buffer.
static void consumeProcessOutputStream(Process self, StringBuffer output)
          Gets the output stream from a process and reads it to keep the process from blocking due to a full output buffer.
static void consumeProcessOutputStream(Process self, Writer output)
          Gets the output stream from a process and reads it to keep the process from blocking due to a full output buffer.
static boolean contains(String self, String text)
          Provide an implementation of contains() like Collection.contains(Object) to make Strings more polymorphic.
static int count(Collection self, Object value)
          Counts the number of occurrences of the given value inside this collection.
static int count(Iterator self, Object value)
          Counts the number of occurrences of the given value from the items within this Iterator.
static int count(String self, String text)
          Count the number of occurencies of a substring.
protected static StringBufferWriter createStringBufferWriter(StringBuffer self)
           
protected static StringWriter createStringWriter(String self)
           
static byte[] decodeBase64(String value)
          Decode the String from Base64 into a byte array.
static boolean deleteDir(File self)
          Deletes a directory with all contained files and subdirectories.
static String denormalize(String self)
          Return a String with lines (separated by LF, CR/LF, or CR) terminated by the platform specific line separator.
static boolean disjoint(Collection left, Collection right)
          Returns true if the intersection of two collections is empty.
static Number div(Character left, Character right)
          Divide one Character by another.
static Number div(Character left, Number right)
          Divide a Character by a Number.
static Number div(Number left, Character right)
          Divide a Number by a Character.
static void downto(BigDecimal self, Number to, Closure closure)
          Iterates from this number down to the given number, inclusive, decrementing by one each time.
static void downto(BigInteger self, Number to, Closure closure)
          Iterates from this number down to the given number, inclusive, decrementing by one each time.
static void downto(double self, Number to, Closure closure)
          Iterates from this number down to the given number, inclusive, decrementing by one each time.
static void downto(Double self, Number to, Closure closure)
          Iterates from this number down to the given number, inclusive, decrementing by one each time.
static void downto(float self, Number to, Closure closure)
          Iterates from this number down to the given number, inclusive, decrementing by one each time.
static void downto(Float self, Number to, Closure closure)
          Iterates from this number down to the given number, inclusive, decrementing by one each time.
static void downto(long self, Number to, Closure closure)
          Iterates from this number down to the given number, inclusive, decrementing by one each time.
static void downto(Long self, Number to, Closure closure)
          Iterates from this number down to the given number, inclusive, decrementing by one each time.
static void downto(Number self, Number to, Closure closure)
          Iterates from this number down to the given number, inclusive, decrementing by one each time.
static String dump(Object self)
          Generates a detailed dump string of an object showing its class, hashCode and fields.
static Map each(Map self, Closure closure)
          Allows a Map to be iterated through using a closure.
static Object each(Object self, Closure closure)
          Iterates through an aggregate type or data structure, passing each item to the given closure.
static void eachByte(byte[] self, Closure closure)
          Traverse through each byte of this byte array.
static void eachByte(Byte[] self, Closure closure)
          Traverse through each byte of this Byte array.
static void eachByte(File self, Closure closure)
          Traverse through each byte of this File
static void eachByte(InputStream is, Closure closure)
          Traverse through each byte of the specified stream.
static void eachByte(URL url, Closure closure)
          Reads the InputStream from this URL, passing each byte to the given closure.
static void eachDir(File self, Closure closure)
          Invokes the closure for each directory in this directory, ignoring regular files.
static void eachDirMatch(File self, Object filter, Closure closure)
          Invokes the closure for each directory whose name (dir.name) matches the given filter in the given directory - calling the isCase() method to determine if a match occurs.
static void eachDirRecurse(File self, Closure closure)
          Invokes the closure for each descendant directory of this directory.
static void eachFile(File self, Closure closure)
          Invokes the closure for each file in the given directory
static void eachFileMatch(File self, Object filter, Closure closure)
          Invokes the closure for each file whose name (file.name) matches the given filter in the given directory - calling the isCase() method to determine if a match occurs.
static void eachFileRecurse(File self, Closure closure)
          Invokes the closure for each descendant file in this directory.
static Object eachLine(File self, Closure closure)
          Iterates through this file line by line.
static Object eachLine(File self, int firstLine, Closure closure)
          Iterates through this file line by line.
static Object eachLine(InputStream stream, Closure closure)
          Iterates through this stream, passing each line to the given 1 or 2 arg closure.
static Object eachLine(InputStream stream, int firstLine, Closure closure)
          Iterates through this stream, passing each line to the given 1 or 2 arg closure.
static Object eachLine(InputStream stream, String charset, Closure closure)
          Iterates through this stream reading with the provided charset, passing each line to the given 1 or 2 arg closure.
static Object eachLine(InputStream stream, String charset, int firstLine, Closure closure)
          Iterates through this stream reading with the provided charset, passing each line to the given 1 or 2 arg closure.
static Object eachLine(Reader self, Closure closure)
          Iterates through the given reader line by line.
static Object eachLine(Reader self, int firstLine, Closure closure)
          Iterates through the given reader line by line.
static Object eachLine(String self, Closure closure)
          Iterates through this String line by line.
static Object eachLine(String self, int firstLine, Closure closure)
          Iterates through this String line by line.
static Object eachLine(URL url, Closure closure)
          Iterates through the lines read from the URL's associated input stream passing each line to the given 1 or 2 arg closure.
static Object eachLine(URL url, int firstLine, Closure closure)
          Iterates through the lines read from the URL's associated input stream passing each line to the given 1 or 2 arg closure.
static Object eachLine(URL url, String charset, Closure closure)
          Iterates through the lines read from the URL's associated input stream passing each line to the given 1 or 2 arg closure.
static Object eachLine(URL url, String charset, int firstLine, Closure closure)
          Iterates through the lines read from the URL's associated input stream passing each line to the given 1 or 2 arg closure.
static String eachMatch(String self, Pattern pattern, Closure closure)
          Process each regex group matched substring of the given pattern.
static String eachMatch(String self, String regex, Closure closure)
          Process each regex group matched substring of the given string.
static void eachObject(File self, Closure closure)
          Iterates through the given file object by object.
static void eachObject(ObjectInputStream ois, Closure closure)
          Iterates through the given object stream object by object.
static Object eachWithIndex(Map self, Closure closure)
          Allows a Map to be iterated through using a closure.
static Object eachWithIndex(Object self, Closure closure)
          Iterates through an aggregate type or data structure, passing each item and the item's index (a counter starting at zero) to the given closure.
static Writable encodeBase64(byte[] data)
          Produce a Writable object which writes the Base64 encoding of the byte array.
static Writable encodeBase64(Byte[] data)
          Produce a Writable object which writes the Base64 encoding of the byte array.
static Writable encodeBase64(byte[] data, boolean chunked)
          Produce a Writable object which writes the Base64 encoding of the byte array.
static Writable encodeBase64(Byte[] data, boolean chunked)
          Produce a Writable object which writes the Base64 encoding of the byte array.
static boolean equals(int[] left, int[] right)
          Compare the contents of this array to the contents of the given array.
static boolean equals(List left, List right)
          Compare the contents of two Lists.
static boolean equals(List left, Object[] right)
          Determines if the contents of this list are equal to the contents of the given array in the same order.
static boolean equals(Object[] left, List right)
          Determines if the contents of this array are equal to the contents of the given list, in the same order.
static boolean every(Map self, Closure closure)
          Iterates over the entries of a map, and checks whether a predicate is valid for all entries.
static boolean every(Object self)
          Iterates over every element of a collection, and checks whether all elements are true according to the Groovy Truth.
static boolean every(Object self, Closure closure)
          Used to determine if the given predicate closure is valid (i.e.&nsbp;returns true for all items in this data structure).
static Process execute(List commandList)
          Executes the command specified by the String list that is the parameter.
static Process execute(String self)
          Executes the given string as a command line process.
static Process execute(String[] commandArray)
          Executes the command specified by the String array that is the parameter.
static Process execute(String self, List envp, File dir)
          Executes the command specified by the self with environments envp under the working directory dir.
static Process execute(String self, String[] envp, File dir)
          Executes the command specified by the self with environments envp under the working directory dir.
static Writable filterLine(File self, Closure closure)
          Filters the lines of a File and creates a Writeable in return to stream the filtered lines.
static void filterLine(File self, Writer writer, Closure closure)
          Filter the lines from this File, and write them to the given writer based on the given closure predicate.
static Writable filterLine(InputStream self, Closure predicate)
          Filter lines from an input stream using a closure predicate.
static void filterLine(InputStream self, Writer writer, Closure predicate)
          Uses a closure to filter lines from this InputStream and pass them to the given writer.
static Writable filterLine(Reader reader, Closure closure)
          Filter the lines from this Reader, and return a Writable which can be used to stream the filtered lines to a destination.
static void filterLine(Reader reader, Writer writer, Closure closure)
          Filter the lines from a reader and write them on the writer, according to a closure which returns true if the line should be included.
static Object find(Collection self, Closure closure)
          Finds the first value matching the closure condition.
static Object find(Map self, Closure closure)
          Finds the first entry matching the closure condition.
static Object find(Object self, Closure closure)
          Finds the first value matching the closure condition
static String find(String self, Pattern pattern)
          Finds the first occurrence of a compiled regular expression Pattern within a String.
static String find(String self, Pattern pattern, Closure closure)
          Finds the first occurrence of a compiled regular expression Pattern within a String.
static String find(String self, String regex)
          Finds the first occurrence of a regular expression String within a String.
static String find(String self, String regex, Closure closure)
          Finds the first occurrence of a regular expression String within a String.
static Collection findAll(Collection self, Closure closure)
          Finds all values matching the closure condition.
static Map findAll(Map self, Closure closure)
          Finds all entries matching the closure condition.
static Collection findAll(Object self, Closure closure)
          Finds all items matching the closure condition.
static List findAll(String self, Pattern pattern)
          Finds all occurrences of a regular expression Pattern within a String.
static List findAll(String self, Pattern pattern, Closure closure)
          Finds all occurrences of a compiled regular expression Pattern within a String.
static List findAll(String self, String regex)
          Finds all occurrences of a regular expression string within a String.
static List findAll(String self, String regex, Closure closure)
          Finds all occurrences of a regular expression string within a String.
static int findIndexOf(Object self, Closure closure)
          Iterates over the elements of an iterable collection of items and returns the index of the first item that matches the condition specified in the closure.
static int findIndexOf(Object self, int startIndex, Closure closure)
          Iterates over the elements of an iterable collection of items, starting from a specified startIndex, and returns the index of the first item that matches the condition specified in the closure.
static List findIndexValues(Object self, Closure closure)
          Iterates over the elements of an iterable collection of items and returns the index values of the items that match the condition specified in the closure.
static List findIndexValues(Object self, int startIndex, Closure closure)
          Iterates over the elements of an iterable collection of items, starting from a specified startIndex, and returns the index values of the items that match the condition specified in the closure.
static int findLastIndexOf(Object self, Closure closure)
          Iterates over the elements of an iterable collection of items and returns the index of the last item that matches the condition specified in the closure.
static int findLastIndexOf(Object self, int startIndex, Closure closure)
          Iterates over the elements of an iterable collection of items, starting from a specified startIndex, and returns the index of the last item that matches the condition specified in the closure.
static Object first(List self)
          Returns the first item from the List.
static Collection flatten(boolean[] self)
          Flatten an array.
static Collection flatten(byte[] self)
          Flatten an array.
static Collection flatten(char[] self)
          Flatten an array.
static Collection flatten(Collection self)
          Flatten a collection.
static Collection flatten(Collection self, Closure flattenUsing)
          Flatten a collection.
static Collection flatten(double[] self)
          Flatten an array.
static Collection flatten(float[] self)
          Flatten an array.
static Collection flatten(int[] self)
          Flatten an array.
static Collection flatten(long[] self)
          Flatten an array.
static Collection flatten(Object[] self)
          Flatten an array.
static Collection flatten(short[] self)
          Flatten an array.
static String format(Date self, String format)
          Create a String representation of this date according to the given pattern.
static Object get(Map map, Object key, Object defaultValue)
          Looks up an item in a Map for the given key and returns the value - unless there is no entry for the given key in which case add the default value to the map and return that.
static boolean getAt(BitSet self, int index)
          Support the subscript operator for a Bitset
static BitSet getAt(BitSet self, IntRange range)
          Support retrieving a subset of a BitSet using a Range
static Object getAt(boolean[] array, Collection indices)
          Support the subscript operator with a collection for a boolean array
static Object getAt(boolean[] array, IntRange range)
          Support the subscript operator with an IntRange for a boolean array
static Object getAt(boolean[] array, ObjectRange range)
          Support the subscript operator with an ObjectRange for a byte array
static Object getAt(boolean[] array, Range range)
          Support the subscript operator with a range for a boolean array
static Object getAt(byte[] array, Collection indices)
          Support the subscript operator with a collection for a byte array
static Object getAt(byte[] array, IntRange range)
          Support the subscript operator with an IntRange for a byte array
static Object getAt(byte[] array, ObjectRange range)
          Support the subscript operator with an ObjectRange for a byte array
static Object getAt(byte[] array, Range range)
          Support the subscript operator with a range for a byte array
static Object getAt(char[] array, Collection indices)
          Support the subscript operator with a collection for a char array
static Object getAt(char[] array, IntRange range)
          Support the subscript operator with an IntRange for a char array
static Object getAt(char[] array, ObjectRange range)
          Support the subscript operator with an ObjectRange for a char array
static Object getAt(char[] array, Range range)
          Support the subscript operator with a range for a char array
static CharSequence getAt(CharSequence self, Collection indices)
          Select a List of characters from a CharSequence using a Collection to identify the indices to be selected.
static CharSequence getAt(CharSequence text, EmptyRange range)
          Support the range subscript operator for CharSequence or StringBuffer with EmptyRange
static CharSequence getAt(CharSequence text, int index)
          Support the subscript operator for CharSequence.
static CharSequence getAt(CharSequence text, IntRange range)
          Support the range subscript operator for CharSequence or StringBuffer with IntRange
static CharSequence getAt(CharSequence text, Range range)
          Support the range subscript operator for CharSequence
static List getAt(Collection coll, String property)
          Support the subscript operator for List
static int getAt(Date self, int field)
          Support the subscript operator for a Date.
static Object getAt(double[] array, Collection indices)
          Support the subscript operator with a collection for a double array
static Object getAt(double[] array, IntRange range)
          Support the subscript operator with an IntRange for a double array
static Object getAt(double[] array, ObjectRange range)
          Support the subscript operator with an ObjectRange for a double array
static Object getAt(double[] array, Range range)
          Support the subscript operator with a range for a double array
static Object getAt(float[] array, Collection indices)
          Support the subscript operator with a collection for a float array
static Object getAt(float[] array, IntRange range)
          Support the subscript operator with an IntRange for a float array
static Object getAt(float[] array, ObjectRange range)
          Support the subscript operator with an ObjectRange for a float array
static Object getAt(float[] array, Range range)
          Support the subscript operator with a range for a float array
static Object getAt(int[] array, Collection indices)
          Support the subscript operator with a collection for an int array
static Object getAt(int[] array, IntRange range)
          Support the subscript operator with an IntRange for an int array
static Object getAt(int[] array, ObjectRange range)
          Support the subscript operator with an ObjectRange for an int array
static Object getAt(int[] array, Range range)
          Support the subscript operator with a range for an int array
static List getAt(List self, Collection indices)
          Select a List of items from a List using a Collection to identify the indices to be selected.
static Object getAt(List self, int idx)
          Support the subscript operator for a List.
static List getAt(List self, IntRange range)
          Support the range subscript operator for a List
static Object getAt(long[] array, Collection indices)
          Support the subscript operator with a collection for a long array
static Object getAt(long[] array, IntRange range)
          Support the subscript operator with an IntRange for a long array
static Object getAt(long[] array, ObjectRange range)
          Support the subscript operator with an ObjectRange for a long array
static Object getAt(long[] array, Range range)
          Support the subscript operator with a range for a long array
static Object getAt(Map self, Object key)
          Support the subscript operator for a Map.
static List getAt(Matcher self, Collection indices)
          Select a List of values from a Matcher using a Collection to identify the indices to be selected.
static Object getAt(Matcher matcher, int idx)
          Support the subscript operator, e.g. matcher[index], for a regex Matcher.
static List getAt(Object[] self, Collection indices)
          Select a List of items from an Object array using a Collection to identify the indices to be selected.
static List getAt(Object[] array, EmptyRange range)
           
static List getAt(Object[] array, IntRange range)
           
static List getAt(Object[] array, ObjectRange range)
           
static List getAt(Object[] array, Range range)
          Support the range subscript operator for an Array
static Object getAt(Object self, String property)
          Allows the subscript operator to be used to lookup dynamic property values.
static Object getAt(short[] array, Collection indices)
          Support the subscript operator with a collection for a short array
static Object getAt(short[] array, IntRange range)
          Support the subscript operator with an IntRange for a short array
static Object getAt(short[] array, ObjectRange range)
          Support the subscript operator with an ObjectRange for a short array
static Object getAt(short[] array, Range range)
          Support the subscript operator with a range for a short array
static String getAt(String self, Collection indices)
          Select a List of characters from a String using a Collection to identify the indices to be selected.
static String getAt(String text, EmptyRange range)
          Support the range subscript operator for String with EmptyRange
static String getAt(String text, int index)
          Support the subscript operator for String.
static String getAt(String text, IntRange range)
          Support the range subscript operator for String with IntRange
static String getAt(String text, Range range)
          Support the range subscript operator for String
static char[] getChars(String self)
          Converts the given String into an array of characters.
static int getCount(Matcher matcher)
          Find the number of Strings matched to the given Matcher.
static String getDateString(Date self)
          Return a string representation of the 'day' portion of this date according to the locale-specific DateFormat.SHORT default format.
static String getDateTimeString(Date self)
          Return a string representation of the date and time time portion of this Date instance, according to the locale-specific format used by DateFormat.
static InputStream getErr(Process self)
          An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar fashion.
static InputStream getIn(Process self)
          An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar fashion.
static MetaClass getMetaClass(Class c)
          Adds a "metaClass" property to all class objects so you can use the syntax String.metaClass.myMethod = { println "foo" }
static MetaClass getMetaClass(GroovyObject obj)
          Obtains a MetaClass for an object either from the registry or in the case of a GroovyObject from the object itself.
static MetaClass getMetaClass(Object obj)
          Obtains a MetaClass for an object either from the registry or in the case of a GroovyObject from the object itself.
static List getMetaPropertyValues(Object self)
          Retrieves the list of MetaProperty objects for 'self' and wraps it in a list of PropertyValue objects that additionally provide the value for each property of 'self'.
static OutputStream getOut(Process self)
          An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar fashion.
static Map getProperties(Object self)
          Convenience method that calls getMetaPropertyValues(Object)(self) and provides the data in form of simple key/value pairs, i.e.&nsbp;without type() information.
static ClassLoader getRootLoader(ClassLoader self)
          Iterates through the classloader parents until it finds a loader with a class named "org.codehaus.groovy.tools.RootLoader".
protected static List getSubList(List self, List splice)
           
static String getText(BufferedReader reader)
          Read the content of the BufferedReader and return it as a String.
static String getText(File file)
          Read the content of the File and returns it as a String.
static String getText(File file, String charset)
          Read the content of the File using the specified encoding and return it as a String.
static String getText(InputStream is)
          Read the content of this InputStream and return it as a String.
static String getText(InputStream is, String charset)
          Read the content of this InputStream using specified charset and return it as a String.
static String getText(Process self)
          Read the text of the output stream of the Process.
static String getText(Reader reader)
          Read the content of the Reader and return it as a String.
static String getText(URL url)
          Read the content of this URL and returns it as a String.
static String getText(URL url, String charset)
          Read the data from this URL and return it as a String.
static String getTimeString(Date self)
          Return a string representation of the time portion of this date according to the locale-specific DateFormat.MEDIUM default format.
static Collection grep(Object self, Object filter)
          Iterates over every element of the collection and returns each item that matches the given filter - calling the isCase(Object,Object) method used by switch statements.
protected static void groupAnswer(Map answer, Object element, Object value)
          Groups the current element according to the value
static Map groupBy(Collection self, Closure closure)
          Sorts all collection members into groups determined by the supplied mapping closure.
static Map groupBy(Map self, Closure closure)
          Groups the members of a map into sub maps determined by the supplied mapping closure.
static Map groupEntriesBy(Map self, Closure closure)
          Groups all map entries into groups determined by the supplied mapping closure.
static boolean hasGroup(Matcher matcher)
          Check whether a Matcher contains a group or not.
static MetaProperty hasProperty(Object self, String name)
          Returns true of the implementing MetaClass has a property of the given name
static Object head(List self)
          Returns the first item from the List.
static Object identity(Object self, Closure closure)
          Allows the closure to be called for the object reference self synonym for 'with()'.
static Object inject(Collection self, Object value, Closure closure)
          Iterates through the given collection, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure.
static Object inject(Iterator self, Object value, Closure closure)
          Iterates through the given iterator, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure.
static Object inject(Object[] self, Object initialValue, Closure closure)
          Iterates through the given array of objects, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure.
static Object inject(Object self, Object value, Closure closure)
          Iterates through the given object, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure.
static String inspect(Object self)
          Inspects returns the String that matches what would be typed into a terminal to create this object.
static Number intdiv(Character left, Character right)
          Integer Divide two Characters.
static Number intdiv(Character left, Number right)
          Integer Divide a Character by a Number.
static Number intdiv(Number left, Character right)
          Integer Divide a Number by a Character.
static Number intdiv(Number left, Number right)
          Integer Divide two Numbers.
static Collection intersect(Collection left, Collection right)
          Create a Collection composed of the intersection of both collections.
static Object invokeMethod(Object object, String method, Object arguments)
          Provide a dynamic method invocation method which can be overloaded in classes to implement dynamic proxies easily.
static boolean is(Object self, Object other)
          Identity check.
static boolean isBigDecimal(String self)
          Determine if a String can be parsed into a BigDecimal.
static boolean isBigInteger(String self)
          Determine if a String can be parsed into a BigInteger.
static boolean isCase(Class caseValue, Object switchValue)
          Special 'Case' implementation for Class, which allows testing for a certain class in a switch statement.
static boolean isCase(Collection caseValue, Object switchValue)
          'Case' implementation for collections which tests if the 'switch' operand is contained in any of the 'case' values.
static boolean isCase(GString caseValue, Object switchValue)
          'Case' implementation for a GString, which simply calls the equivalet method for String.
static boolean isCase(Number caseValue, Number switchValue)
          Special 'case' implementation for all numbers, which delegates to the compareTo() method for comparing numbers of different types.
static boolean isCase(Object caseValue, Object switchValue)
          Method for overloading the behavior of the 'case' method in switch statements.
static boolean isCase(Pattern caseValue, Object switchValue)
          'Case' implementation for the Pattern class, which allows testing a String against a number of regular expressions.
static boolean isCase(String caseValue, Object switchValue)
          'Case' implementation for a String, which uses String#equals(Object) in order to allow Strings to be used in switch statements.
static boolean isDigit(Character self)
          Determines if a character is a digit.
static boolean isDouble(String self)
          Determine if a String can be parsed into a Double.
static boolean isFloat(String self)
          Determine if a String can be parsed into a Float.
static boolean isInteger(String self)
          Determine if a String can be parsed into an Integer.
static boolean isLetter(Character self)
          Determines if a character is a letter.
static boolean isLetterOrDigit(Character self)
          Determines if a character is a letter or digit.
static boolean isLong(String self)
          Determine if a String can be parsed into a Long.
static boolean isLowerCase(Character self)
          Determine if a Character is lowercase.
static boolean isNumber(String self)
          Determine if a String can be parsed into a Number.
static boolean isUpperCase(Character self)
          Determine if a Character is uppercase.
static boolean isWhitespace(Character self)
          Determines if a character is a whitespace character.
static Iterator iterator(DataInputStream self)
          Standard iterator for a data input stream which iterates through the stream content a byte at a time.
static Iterator iterator(Enumeration enumeration)
          Allows an Enumeration to behave like an Iterator.
static Iterator iterator(File self)
          Deprecated. use File#eachLine instead please
static Iterator iterator(InputStream self)
          Standard iterator for a input stream which iterates through the stream content in a byte-based fashion.
static Iterator iterator(Iterator self)
          An identity function for iterators, supporting 'duck-typing' when trying to get an iterator for each object within a collection, some of which may already be iterators.
static Iterator iterator(Matcher matcher)
          Returns an Iterator which traverses each match.
static Iterator iterator(NodeList nodeList)
          Makes NodeList iterable by returning a read-only Iterator which traverses over each Node.
static Iterator iterator(Object o)
          Attempts to create an Iterator for the given object by first converting it to a Collection.
static Iterator iterator(Reader self)
          Creates an iterator which will traverse through the reader a line at a time.
static String join(Collection self, String separator)
          Concatenates the toString() representation of each item in this collection, with the given String as a separator between each item.
static String join(Iterator self, String separator)
          Concatenates the toString() representation of each item from the iterator, with the given String as a separator between each item.
static String join(Object[] self, String separator)
          Concatenates the toString() representation of each items in this array, with the given String as a separator between each item.
static Object last(List self)
          Returns the last item from the List.
static Collection leftShift(Collection self, Object value)
          Overloads the left shift operator to provide an easy way to append objects to a Collection.
static File leftShift(File file, byte[] bytes)
          Write bytes to a File.
static File leftShift(File file, InputStream data)
          Append binary data to the file.
static File leftShift(File file, Object text)
          Write the text to the File.
static Map leftShift(Map self, Map.Entry entry)
          Overloads the left shift operator to provide an easy way to append Map.Entry values to a Map.
static Number leftShift(Number self, Number operand)
          Implementation of the left shift operator for integral types.
static void leftShift(ObjectOutputStream self, Object value)
          Overloads the leftShift operator to add objects to an ObjectOutputStream.
static OutputStream leftShift(OutputStream self, byte[] value)
          Overloads the leftShift operator to provide an append mechanism to add bytes to a stream.
static OutputStream leftShift(OutputStream self, InputStream in)
          Pipe an InputStream into an OutputStream for efficient stream copying.
static Writer leftShift(OutputStream self, Object value)
          Overloads the leftShift operator to provide an append mechanism to add values to a stream.
static OutputStream leftShift(Process self, byte[] value)
          Overloads the left shift operator to provide an append mechanism to pipe into a Process
static Writer leftShift(Process self, Object value)
          Overloads the left shift operator (<<) to provide an append mechanism to pipe data to a Process.
static OutputStream leftShift(Socket self, byte[] value)
          Overloads the left shift operator to provide an append mechanism to add bytes to the output stream of a socket
static Writer leftShift(Socket self, Object value)
          Overloads the left shift operator to provide an append mechanism to add things to the output stream of a socket
static StringBuffer leftShift(StringBuffer self, Object value)
          Overloads the left shift operator to provide an easy way to append multiple objects as string representations to a StringBuffer.
static StringBuffer leftShift(String self, Object value)
          Overloads the left shift operator to provide an easy way to append multiple objects as string representations to a String.
static Writer leftShift(Writer self, Object value)
          Overloads the left shift operator to provide a mechanism to append values to a writer.
static boolean matches(String self, Pattern regex)
          Tells whether or not self matches the given compiled regular expression Pattern.
static Object max(Collection self)
          Adds max() method to Collection objects.
static Object max(Collection self, Closure closure)
          Selects the maximum value found in the collection using the given closure as a comparator.
static Object max(Collection self, Comparator comparator)
          Selects the maximum value found in the collection using the given comparator.
static Object max(Iterator self)
          Adds max() method to Iterator objects.
static Object max(Iterator self, Closure closure)
          Selects the maximum value found from the Iterator using the given closure as a comparator.
static Object max(Iterator self, Comparator comparator)
          Selects the maximum value found from the Iterator using the given comparator.
static Object max(Object[] self)
          Adds max() method to Object arrays.
static Object max(Object[] self, Closure closure)
          Selects the maximum value found from the Object array using the given closure as a comparator.
static Object max(Object[] self, Comparator comparator)
          Selects the maximum value found from the Object array using the given comparator.
static MetaClass metaClass(Class self, Closure closure)
          Sets/updates the metaclass for a given class to a closure.
static MetaClass metaClass(Object self, Closure closure)
          Sets/updates the metaclass for a given object to a closure.
static Object min(Collection self)
          Adds min() method to Collection objects.
static Object min(Collection self, Closure closure)
          Selects the minimum value found in the collection using the given closure as a comparator.
static Object min(Collection self, Comparator comparator)
          Selects the minimum value found in the collection using the given comparator.
static Object min(Iterator self)
          Adds min() method to Iterator objects.
static Object min(Iterator self, Closure closure)
          Selects the minimum value found from the Iterator using the given closure as a comparator.
static Object min(Iterator self, Comparator comparator)
          Selects the minimum value found from the Iterator using the given comparator.
static Object min(Object[] self)
          Adds min() method to Object arrays.
static Object min(Object[] self, Closure closure)
          Selects the minimum value found from the Object array using the given closure as a comparator.
static Object min(Object[] self, Comparator comparator)
          Selects the minimum value found from the Object array using the given comparator.
static int minus(Calendar self, Calendar then)
          Subtract another date from this one and return the number of days of the difference.
static Number minus(Character left, Character right)
          Subtract one Characters from another by converting them both to their Integer representations.
static Number minus(Character left, Number right)
          Subtract a Number from a Character.
static int minus(Date self, Date then)
          Subtract another Date from this one and return the number of days of the difference.
static Date minus(Date self, int days)
          Subtract a number of days from this date and returns the new date.
static Date minus(Date self, int days)
          Subtract a number of days from this date and returns the new date.
static List minus(List self, Collection removeMe)
          Create a List composed of the elements of the first list minus the elements of the given collection.
static List minus(List self, Object operand)
          Create a new List composed of the elements of the first list minus the operand.
static Number minus(Number left, Character right)
          Subtract a Character from a Number.
static Object[] minus(Object[] self, Collection removeMe)
          Create an array composed of the elements of the first array minus the elements of the given collection.
static Object[] minus(Object[] self, Object operand)
          Create a new object array composed of the elements of the first array minus the operand.
static Object[] minus(Object[] self, Object[] removeMe)
          Create an array composed of the elements of the first array minus the elements of the given array.
static Set minus(Set self, Collection operands)
          Create a Set composed of the elements of the first set minus the elements of the given collection.
static Set minus(Set self, Object operand)
          Create a Set composed of the elements of the first set minus the operand.
static String minus(String self, Object target)
          Remove a part of a String.
static void mixin(Class self, Class categoryClass)
          Extend class globally with category methods.
static void mixin(Class self, Class[] categoryClass)
          Extend class globally with category methods.
static void mixin(Class self, List categoryClasses)
          Extend class globally with category methods.
static void mixin(MetaClass self, Class categoryClass)
          Extend class globally with category methods.
static void mixin(MetaClass self, Class[] categoryClass)
          Extend class globally with category methods.
static void mixin(MetaClass self, List categoryClasses)
          Extend object with category methods.
static Number mod(Number left, Number right)
          Performs a division modulus operation.
static Number multiply(BigDecimal left, BigInteger right)
          Multiply a BigDecimal and a BigInteger.
static Number multiply(BigDecimal left, Double right)
          Multiply a BigDecimal and a Double.
static Number multiply(Character left, Character right)
          Multiply two Characters.
static Number multiply(Character left, Number right)
          Multiply a Character by a Number.
static List multiply(Collection self, Number factor)
          Create a List composed of the elements of this list, repeated a certain number of times.
static Number multiply(Number left, Character right)
          Multiply a Number by a Character.
static String multiply(String self, Number factor)
          Repeat a String a certain number of times.
static DataInputStream newDataInputStream(File file)
          Create a data input stream for this file
static DataOutputStream newDataOutputStream(File file)
          Creates a new data output stream for this file.
static BufferedInputStream newInputStream(File file)
          Creates a buffered input stream for this file.
static BufferedInputStream newInputStream(URL url)
          Creates a buffered input stream for this URL.
static Object newInstance(Class c)
          Convenience method to dynamically create a new instance of this class.
static Object newInstance(Class c, Object[] args)
          Helper to construct a new instance from the given arguments.
static ObjectInputStream newObjectInputStream(File file)
          Create an object input stream for this file.
static ObjectInputStream newObjectInputStream(File file, ClassLoader classLoader)
          Create an object input stream for this file using the given class loader.
static ObjectInputStream newObjectInputStream(InputStream inputStream)
          Create an object input stream for this input stream.
static ObjectInputStream newObjectInputStream(InputStream inputStream, ClassLoader classLoader)
          Create an object input stream for this input stream using the given class loader.
static ObjectOutputStream newObjectOutputStream(File file)
          Create an object output stream for this file.
static ObjectOutputStream newObjectOutputStream(OutputStream outputStream)
          Create an object output stream for this output stream.
static BufferedOutputStream newOutputStream(File file)
          Create a buffered output stream for this file.
static PrintWriter newPrintWriter(File file)
          Create a new PrintWriter for this file.
static PrintWriter newPrintWriter(File file, String charset)
          Create a new PrintWriter for this file, using specified charset.
static PrintWriter newPrintWriter(Writer writer)
          Create a new PrintWriter for this file, using specified charset.
static BufferedReader newReader(File file)
          Create a buffered reader for this file.
static BufferedReader newReader(File file, String charset)
          Create a buffered reader for this file, using the specified charset as the encoding.
static BufferedReader newReader(InputStream self)
          Creates a reader for this input stream.
static BufferedReader newReader(InputStream self, String charset)
          Creates a reader for this input stream, using the specified charset as the encoding.
static BufferedReader newReader(URL url)
          Creates a buffered reader for this URL.
static BufferedReader newReader(URL url, String charset)
          Creates a buffered reader for this URL using the given encoding.
static BufferedWriter newWriter(File file)
          Create a buffered writer for this file.
static BufferedWriter newWriter(File file, boolean append)
          Creates a buffered writer for this file, optionally appending to the existing file content.
static BufferedWriter newWriter(File file, String charset)
          Creates a buffered writer for this file, writing data using the given encoding.
static BufferedWriter newWriter(File file, String charset, boolean append)
          Helper method to create a buffered writer for a file.
static Character next(Character self)
          Increment a Character by one.
static Date next(Date self)
          Increment a Date by one day.
static Date next(Date self)
          Increment a java.sql.Date by one day.
static Number next(Number self)
          Increment a Number by one.
static String next(String self)
          This method is called by the ++ operator for the class String.
static String normalize(String self)
          Return a String with linefeeds and carriage returns normalized to linefeeds.
static int numberAwareCompareTo(Comparable self, Comparable other)
          Provides a method that compares two comparables using Groovy's default number aware comparator.
static BitSet or(BitSet left, BitSet right)
          Bitwise OR together two BitSets.
static Boolean or(Boolean left, Boolean right)
          Logical disjunction of two boolean operators
static Number or(Number left, Number right)
          Bitwise OR together two numbers.
static Process or(Process left, Process right)
          Overrides the or operator to allow one Process to asynchronously pipe data to another Process.
static String padLeft(String self, Number numberOfChars)
          Pad a String with the spaces appended to the left
static String padLeft(String self, Number numberOfChars, String padding)
          Pad a String with the characters appended to the left
static String padRight(String self, Number numberOfChars)
          Pad a String with the spaces appended to the right
static String padRight(String self, Number numberOfChars, String padding)
          Pad a String with the characters appended to the right
static Process pipeTo(Process left, Process right)
          Allows one Process to asynchronously pipe data to another Process.
static Number plus(Character left, Character right)
          Add two Characters.
static Number plus(Character left, Number right)
          Add a Character and a Number.
static Collection plus(Collection left, Collection right)
          Create a Collection as a union of two collections.
static Collection plus(Collection left, Object right)
          Create a collection as a union of a Collection and an Object.
static Date plus(Date self, int days)
          Add a number of days to this date and returns the new date.
static Date plus(Date self, int days)
          Add a number of days to this date and returns the new date.
static Map plus(Map self, Collection<Map.Entry> entries)
          Returns a new Map containing all entries from self and entries, giving precedence to entries.
static Map plus(Map left, Map right)
          Returns a new Map containing all entries from left and right, giving precedence to right.
static Number plus(Number left, Character right)
          Add a Number and a Character.
static String plus(Number value, String right)
          Appends a String to the string representation of this number.
static String plus(StringBuffer left, String value)
          Appends a String to this StringBuffer.
static String plus(String left, Object value)
          Appends the String representation of the given operand to this string.
static Object pop(List self)
          Removes the last item from the List.
static Number power(Number self, Number exponent)
          Power of a Number to a certain exponent.
static Character previous(Character self)
          Decrement a Character by one.
static Date previous(Date self)
          Decrement a Date by one day.
static Date previous(Date self)
          Decrement a java.sql.Date by one day.
static Number previous(Number self)
          Decrement a Number by one.
static String previous(String self)
          This method is called by the -- operator for the class String.
protected static List primitiveArrayGet(Object self, Collection indices)
          Implements the getAt(Collection) method for primitve type arrays.
protected static Object primitiveArrayGet(Object self, int idx)
          Implements the getAt(int) method for primitve type arrays.
protected static List primitiveArrayGet(Object self, Range range)
          Implements the getAt(Range) method for primitve type arrays.
protected static Object primitiveArrayPut(Object self, int idx, Object newValue)
          Implements the setAt(int idx) method for primitve type arrays.
static void print(Closure self, Object value)
          Print a value to the standard output stream.
static void print(Object self, Object value)
          Print a value formatted Groovy style to self if it is a Writer, otherwise to the standard output stream.
static void print(Object self, PrintWriter out)
          Print to a console in interactive format.
static void print(PrintStream self, Object value)
          Print a value formatted Groovy style to the print stream.
static void print(PrintWriter self, Object value)
          Print a value formatted Groovy style to the print writer.
static void printf(Object self, String format, Object arg)
          Prints a formatted string using the specified format string and arguments.
static void printf(Object self, String format, Object[] values)
          Printf to a console (Only works with JDK1.5 or later).
static void println(Closure self)
          Print a linebreak to the standard output stream.
static void println(Closure self, Object value)
          Print a value (followed by a newline) to the standard output stream.
static void println(Object self)
          Print a linebreak to the standard output stream.
static void println(Object self, Object value)
          Print a value formatted Groovy style (followed by a newline) to self if it is a Writer, otherwise to the standard output stream.
static void println(Object self, PrintWriter out)
          Print to a console in interactive format.
static void println(PrintStream self, Object value)
          Print a value formatted Groovy style (followed by a newline) to the print stream.
static void println(PrintWriter self, Object value)
          Print a value formatted Groovy style (followed by a newline) to the print writer.
static boolean push(List self, Object value)
          Appends an item to the List.
static Map putAll(Map self, Collection<Map.Entry> entries)
          Provides an easy way to append multiple Map.Entry values to a Map.
static void putAt(BitSet self, int index, boolean value)
          Support subscript-style assignment for a BitSet.
static void putAt(BitSet self, IntRange range, boolean value)
          Support assigning a range of values with a single assignment statement.
static void putAt(List self, EmptyRange range, Object value)
          A helper method to allow lists to work with subscript operators.
static void putAt(List self, int idx, Object value)
          A helper method to allow lists to work with subscript operators.
static void putAt(List self, IntRange range, Collection col)
          List subscript assignment operator when given a range as the index and the assignment operand is a collection.
static void putAt(List self, IntRange range, Object value)
          List subscript assignment operator when given a range as the index.
static void putAt(List self, List splice, List values)
          Deprecated. replace with putAt(List self, Range range, List value)
static void putAt(List self, List splice, Object value)
          Deprecated. replace with putAt(List self, Range range, Object value)
static Object putAt(Map self, Object key, Object value)
          A helper method to allow lists to work with subscript operators
static void putAt(Object self, String property, Object newValue)
          Allows the subscript operator to be used to set dynamically named property values.
static void putAt(StringBuffer self, EmptyRange range, Object value)
          Support the range subscript operator for StringBuffer.
static void putAt(StringBuffer self, IntRange range, Object value)
          Support the range subscript operator for StringBuffer.
static byte[] readBytes(File file)
          Reads the content of the file into a byte array.
static String readLine(InputStream stream)
          Deprecated. use Reader#readLine instead please
static String readLine(Reader self)
          Read a single, whole line from the given Reader.
static List readLines(File file)
          Reads the file into a list of Strings, with one item for each line.
static List readLines(InputStream stream)
          Reads the stream into a list, with one element for each line.
static List readLines(Reader reader)
          Reads the reader into a list of Strings, with one entry for each line.
static List readLines(String self)
          Return the lines of a String as a List of Strings.
static String replace(String self, CharSequence target, CharSequence replacement)
          Replaces all occurrances of a literal string with another literal string.
static String replaceAll(String self, Pattern regex, String replacement)
          Replaces all substrings of a String that match the given compiled regular expression with the given replacement.
static String replaceAll(String self, String regex, Closure closure)
          Replaces all occurrencies of a captured group by the result of a closure on that text.
static String replaceFirst(String self, Pattern regex, String replacement)
          Replaces the first substring of a String that matches the given compiled regular expression with the given replacement.
static List respondsTo(Object self, String name)
          Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name regardless of the arguments.
static List respondsTo(Object self, String name, Object[] argTypes)
          Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name and arguments types.
static Iterator reverse(Iterator self)
          Reverses the iterator.
static List reverse(List self)
          Reverses the list.
static Object[] reverse(Object[] self)
          Reverse the items in an Object array.
static String reverse(String self)
          Creates a new string which is the reverse (backwards) of this string
static List reverseEach(List self, Closure closure)
          Iterate over each element of the list in the reverse order.
static Object[] reverseEach(Object[] self, Closure closure)
          Iterate over each element of the array in the reverse order.
static Number rightShift(Number self, Number operand)
          Implementation of the right shift operator for integral types.
static Number rightShiftUnsigned(Number self, Number operand)
          Implementation of the right shift (unsigned) operator for integral types.
static long round(Double number)
          Round the value
static int round(Float number)
          Get the absolute value
static TimerTask runAfter(Timer timer, int delay, Closure closure)
          Allows a simple syntax for using timers.
static void setIndex(Matcher matcher, int idx)
          Set the position of the given Matcher to the given index.
static void setMetaClass(Class self, MetaClass metaClass)
          Sets the metaclass for a given class.
static void setMetaClass(Object self, MetaClass metaClass)
          Set the metaclass for an object
static void setText(File file, String text)
          Synonym for write(text) allowing file.text = 'foo'.
static int size(boolean[] array)
          Allows arrays to behave similar to collections.
static int size(byte[] array)
          Allows arrays to behave similar to collections.
static int size(char[] array)
          Allows arrays to behave similar to collections.
static int size(double[] array)
          Allows arrays to behave similar to collections.
static long size(File self)
          Provide the standard Groovy size() method for File.
static int size(float[] array)
          Allows arrays to behave similar to collections.
static int size(int[] array)
          Allows arrays to behave similar to collections.
static int size(Iterator self)
          Provide the standard Groovy size() method for Iterator.
static int size(long[] array)
          Allows arrays to behave similar to collections.
static long size(Matcher self)
          Provide the standard Groovy size() method for Matcher.
static int size(Object[] self)
          Provide the standard Groovy size() method for an array.
static int size(short[] array)
          Allows arrays to behave similar to collections.
static int size(String text)
          Provide the standard Groovy size() method for String.
static int size(StringBuffer buffer)
          Provide the standard Groovy size() method for StringBuffer.
static List sort(Collection self)
          Sorts the given collection into a sorted list.
static List sort(Collection self, Closure closure)
          Sorts this Collection using the given closure as a comparator.
static List sort(Collection self, Comparator comparator)
          Sorts the Collection using the given comparator.
static Iterator sort(Iterator self)
          Sorts the given iterator items into a sorted iterator.
static Iterator sort(Iterator self, Closure closure)
          Sorts the given iterator items into a sorted iterator using the closure as a comparator.
static Iterator sort(Iterator self, Comparator comparator)
          Sorts the given iterator items into a sorted iterator using the comparator.
static Map sort(Map self, Closure closure)
          Sorts the given map into a sorted map using the closure as a comparator.
static Object[] sort(Object[] self)
          Sorts the given Object array into sorted order.
static Object[] sort(Object[] self, Closure closure)
          Sorts the given Object array into a newly created array using the given comparator.
static Object[] sort(Object[] self, Comparator comparator)
          Sorts the given Object array into sorted order using the given comparator.
static SortedSet sort(SortedSet self)
          Avoids doing unnecessary work when sorting an already sorted set.
static Collection split(Collection self, Closure closure)
          Splits all items into two collections based on the closure condition.
static String[] split(GString self)
          Convenience method to split a GString (with whitespace as delimiter).
static Collection split(Object self, Closure closure)
          Splits all items into two lists based on the closure condition.
static String[] split(String self)
          Convenience method to split a string (with whitespace as delimiter) Like tokenize, but returns an Array of Strings instead of a List
static Object splitEachLine(File self, String sep, Closure closure)
          Iterates through this file line by line, splitting on the seperator.
static Object splitEachLine(InputStream stream, String sep, Closure closure)
          Iterates through the given InputStream line by line, splitting each line using the given separator.
static Object splitEachLine(InputStream stream, String sep, String charset, Closure closure)
          Iterates through the given InputStream line by line using the specified encoding, splitting each line using the given separator.
static Object splitEachLine(Reader self, String sep, Closure closure)
          Iterates through the given reader line by line, splitting each line using the given separator.
static Object splitEachLine(String self, String sep, Closure closure)
          Iterates through the given String line by line, splitting each line using the given separator.
static SpreadMap spread(Map self)
          Synonym for toSpreadMap(Map).
static String sprintf(Object self, String format, Object arg)
          Returns a formatted string using the specified format string and arguments.
static String sprintf(Object self, String format, Object[] values)
          Sprintf to a string (Only works with JDK1.5 or later).
static void step(Number self, Number to, Number stepNumber, Closure closure)
          Iterates from this number up to the given number using a step increment.
static Map subMap(Map map, Collection keys)
          Creates a sub-Map containing the given keys.
static Object sum(Collection self)
          Sums the items in a collection.
static Object sum(Collection self, Closure closure)
          Sums the result of apply a closure to each item of a collection.
static Object sum(Collection self, Object initialValue)
          Sums the items in a collection, adding the result to some initial value.
static Object sum(Collection self, Object initialValue, Closure closure)
          Sums the result of apply a closure to each item of a collection to sum intial value.
static Object sum(Iterator self)
          Sums the items from an Iterator.
static Object sum(Iterator self, Object initialValue)
          Sums the items from an Iterator.
static List tail(List self)
          Returns the items from the List excluding the first item.
static void times(Number self, Closure closure)
          Executes the closure this many times, starting from zero.
static String toArrayString(Object[] self)
          Returns the string representation of the given array.
static BigDecimal toBigDecimal(Number self)
          Transform a Number into a BigDecimal
static BigDecimal toBigDecimal(String self)
          Parse a String into a BigDecimal
static BigInteger toBigInteger(Number self)
          Transform this Number into a BigInteger.
static BigInteger toBigInteger(String self)
          Parse a String into a BigInteger
static Boolean toBoolean(String self)
          Converts the given string into a Boolean object.
static Character toCharacter(String self)
          Converts the given string into a Character object using the first character in the string.
static Double toDouble(Number self)
          Transform a Number into a Double
static Double toDouble(String self)
          Parse a String into a Double
static Float toFloat(Number self)
          Transform a Number into a Float
static Float toFloat(String self)
          Parse a String into a Float
static Integer toInteger(Number self)
          Transform a Number into an Integer
static Integer toInteger(String self)
          Parse a String into an Integer
static List tokenize(String self)
          Tokenize a String (with a whitespace as the delimiter).
static List tokenize(String self, String token)
          Tokenize a String based on the given string delimiter.
static List toList(boolean[] array)
          Converts this array to a List of the same size, with each element added to the list.
static List toList(byte[] array)
          Converts this array to a List of the same size, with each element added to the list.
static List toList(char[] array)
          Converts this array to a List of the same size, with each element added to the list.
static List toList(Collection self)
          Convert a collection to a List.
static List toList(double[] array)
          Converts this array to a List of the same size, with each element added to the list.
static List toList(Enumeration self)
          Convert an enumeration to a List.
static List toList(float[] array)
          Converts this array to a List of the same size, with each element added to the list.
static List toList(int[] array)
          Converts this array to a List of the same size, with each element added to the list.
static List toList(Iterator self)
          Convert an iterator to a List.
static List toList(long[] array)
          Converts this array to a List of the same size, with each element added to the list.
static List toList(Object[] array)
          Allows conversion of arrays into a mutable List.
static List toList(short[] array)
          Converts this array to a List of the same size, with each element added to the list.
static List toList(String self)
          Converts the given String into a List of strings of one character.
static String toListString(Collection self)
          Returns the string representation of the given list.
static Long toLong(Number self)
          Transform a Number into a Long
static Long toLong(String self)
          Parse a String into a Long
static char toLowerCase(Character self)
          Converts the character to lowercase.
static String toMapString(Map self)
          Returns the string representation of this map.
static GroovyRowResult toRowResult(ResultSet rs)
          Returns a GroovyRowResult given a ResultSet.
static Short toShort(String self)
          Parse a String into a Short
static SpreadMap toSpreadMap(Map self)
          Returns a new SpreadMap from this map.
static SpreadMap toSpreadMap(Object[] self)
          Creates a spreadable map from this array.
static String toString(AbstractCollection self)
          Returns the string representation of the given collection.
static String toString(AbstractMap self)
          Returns the string representation of the given map.
static String toString(boolean[] self)
          Returns the string representation of the given array.
static String toString(byte[] self)
          Returns the string representation of the given array.
static String toString(char[] self)
          Returns the string representation of the given array.
static String toString(double[] self)
          Returns the string representation of the given array.
static String toString(float[] self)
          Returns the string representation of the given array.
static String toString(int[] self)
          Returns the string representation of the given array.
static String toString(long[] self)
          Returns the string representation of the given array.
static String toString(Object value)
          Create a String representation of this object.
static String toString(Object[] self)
          Returns the string representation of this array's contents.
static String toString(short[] self)
          Returns the string representation of the given array.
static char toUpperCase(Character self)
          Converts the character to uppercase.
static URI toURI(String self)
          Transforms a String representing a URI into a URI object.
static URL toURL(String self)
          Transforms a String representing a URL into a URL object.
static void transformChar(Reader self, Writer writer, Closure closure)
          Transforms each character from this reader by passing it to the given closure.
static void transformLine(Reader reader, Writer writer, Closure closure)
          Transforms the lines from a reader with a Closure and write them to a writer.
static List transpose(List self)
          Adds GroovyCollections#transpose(List) as a method on lists.
static Number unaryMinus(Number left)
          Negates the number.
static Collection unique(Collection self)
          Modifies this collection to remove all duplicated items, using the default comparator.
static Collection unique(Collection self, Closure closure)
          A convenience method for making a collection unique using a closure as a comparator.
static Collection unique(Collection self, Comparator comparator)
          Remove all duplicates from a given Collection.
static Iterator unique(Iterator self)
          Returns an iterator equivalent to this iterator all duplicated items removed by using the default comparator.
static Iterator unique(Iterator self, Closure closure)
          Returns an iterator equivalent to this iterator all duplicated items removed by using a closure as a comparator.
static Iterator unique(Iterator self, Comparator comparator)
          Returns an iterator equivalent to this iterator with all duplicated items removed by using the supplied comparator.
static void upto(BigDecimal self, Number to, Closure closure)
          Iterates from this number up to the given number, inclusive, incrementing by one each time.
static void upto(BigInteger self, Number to, Closure closure)
          Iterates from this number up to the given number, inclusive, incrementing by one each time.
static void upto(double self, Number to, Closure closure)
          Iterates from this number up to the given number, inclusive, incrementing by one each time.
static void upto(Double self, Number to, Closure closure)
          Iterates from this number up to the given number, inclusive, incrementing by one each time.
static void upto(float self, Number to, Closure closure)
          Iterates from this number up to the given number, inclusive, incrementing by one each time.
static void upto(Float self, Number to, Closure closure)
          Iterates from this number up to the given number, inclusive, incrementing by one each time.
static void upto(long self, Number to, Closure closure)
          Iterates from this number up to the given number, inclusive, incrementing by one each time.
static void upto(Long self, Number to, Closure closure)
          Iterates from this number up to the given number, inclusive, incrementing by one each time.
static void upto(Number self, Number to, Closure closure)
          Iterates from this number up to the given number, inclusive, incrementing by one each time.
static Object use(Object self, Class categoryClass, Closure closure)
          Scoped use method
static Object use(Object self, List categoryClassList, Closure closure)
          Scoped use method with list of categories.
static Object use(Object self, Object[] array)
          Allows you to use a list of categories, specifying the list as varargs.
static void waitForOrKill(Process self, long numberOfMillis)
          Wait for the process to finish during a certain amount of time, otherwise stops the process.
static Object with(Object self, Closure closure)
          Allows the closure to be called for the object reference self
static Object withDataInputStream(File file, Closure closure)
          Create a new DataInputStream for this file and passes it into the closure.
static Object withDataOutputStream(File file, Closure closure)
          Create a new DataOutputStream for this file and passes it into the closure.
static Object withInputStream(File file, Closure closure)
          Create a new InputStream for this file and passes it into the closure.
static Object withInputStream(URL url, Closure closure)
          Creates a new InputStream for this URL and passes it into the closure.
static Object withObjectInputStream(File file, ClassLoader classLoader, Closure closure)
          Create a new ObjectInputStream for this file associated with the given class loader and pass it to the closure.
static Object withObjectInputStream(File file, Closure closure)
          Create a new ObjectInputStream for this file and pass it to the closure.
static Object withObjectInputStream(InputStream inputStream, ClassLoader classLoader, Closure closure)
          Create a new ObjectInputStream for this file and pass it to the closure.
static Object withObjectInputStream(InputStream inputStream, Closure closure)
          Create a new ObjectInputStream for this file and pass it to the closure.
static Object withObjectOutputStream(File file, Closure closure)
          Create a new ObjectOutputStream for this file and then pass it to the closure.
static Object withObjectOutputStream(OutputStream outputStream, Closure closure)
          Create a new ObjectOutputStream for this output stream and then pass it to the closure.
static Object withObjectStreams(Socket socket, Closure closure)
          Creates an InputObjectStream and an OutputObjectStream from a Socket, and passes them to the closure.
static Object withOutputStream(File file, Closure closure)
          Creates a new OutputStream for this file and passes it into the closure.
static void withOutputStream(Process self, Closure closure)
          Creates a new buffered OutputStream as stdin for this process, passes it to the closure, and ensures the stream is flushed and closed after the closure returns.
static Object withPrintWriter(File file, Closure closure)
          Create a new PrintWriter for this file which is then passed it into the given closure.
static Object withPrintWriter(File file, String charset, Closure closure)
          Create a new PrintWriter with a specified charset for this file.
static Object withPrintWriter(Writer writer, Closure closure)
          Create a new PrintWriter with a specified charset for this file.
static Object withReader(File file, Closure closure)
          Create a new BufferedReader for this file and then passes it into the closure, ensuring the reader is closed after the closure returns.
static Object withReader(File file, String charset, Closure closure)
          Create a new BufferedReader for this file using the specified charset and then passes it into the closure, ensuring the reader is closed after the closure returns.
static Object withReader(InputStream in, Closure closure)
          Helper method to create a new Reader for a stream and then passes it into the closure.
static Object withReader(InputStream in, String charset, Closure closure)
          Helper method to create a new Reader for a stream and then passes it into the closure.
static Object withReader(Reader reader, Closure closure)
          Allows this reader to be used within the closure, ensuring that it is closed before this method returns.
static Object withReader(URL url, Closure closure)
          Helper method to create a new BufferedReader for a URL and then passes it to the closure.
static Object withReader(URL url, String charset, Closure closure)
          Helper method to create a new Reader for a URL and then passes it to the closure.
static Object withStream(InputStream stream, Closure closure)
          Allows this input stream to be used within the closure, ensuring that it is flushed and closed before this method returns.
static Object withStream(OutputStream os, Closure closure)
          Passes this OutputStream to the closure, ensuring that the stream is closed after the closure returns, regardless of errors.
static Object withStreams(Socket socket, Closure closure)
          Passes the Socket's InputStream and OutputStream to the closure.
static Object withWriter(File file, Closure closure)
          Creates a new BufferedWriter for this file, passes it to the closure, and ensures the stream is flushed and closed after the closure returns.
static Object withWriter(File file, String charset, Closure closure)
          Creates a new BufferedWriter for this file, passes it to the closure, and ensures the stream is flushed and closed after the closure returns.
static Object withWriter(OutputStream stream, Closure closure)
          Creates a writer from this stream, passing it to the given closure.
static Object withWriter(OutputStream stream, String charset, Closure closure)
          Creates a writer from this stream, passing it to the given closure.
static void withWriter(Process self, Closure closure)
          Creates a new BufferedWriter as stdin for this process, passes it to the closure, and ensures the stream is flushed and closed after the closure returns.
static Object withWriter(Writer writer, Closure closure)
          Allows this writer to be used within the closure, ensuring that it is flushed and closed before this method returns.
static Object withWriterAppend(File file, Closure closure)
          Create a new BufferedWriter for this file in append mode.
static Object withWriterAppend(File file, String charset, Closure closure)
          Create a new BufferedWriter which will append to this file.
static void write(File file, String text)
          Write the text to the File.
static void write(File file, String text, String charset)
          Write the text to the File, using the specified encoding.
static void write(Writer self, Writable writable)
          A helper method so that dynamic dispatch of the writer.write(object) method will always use the more efficient Writable.writeTo(writer) mechanism if the object implements the Writable interface.
static void writeLine(BufferedWriter writer, String line)
          Write the text and append a newline (using the platform's line-ending).
static BitSet