Home » Groovy-1.7.0 » org.codehaus » groovy » runtime » [javadoc | source]
org.codehaus.groovy.runtime
public class: DefaultGroovyMethods [javadoc | source]
java.lang.Object
   org.codehaus.groovy.runtime.DefaultGroovyMethodsSupport
      org.codehaus.groovy.runtime.DefaultGroovyMethods
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.
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. 
Field Summary
public static final  Class[] additionals     
static  String lineSeparator     
Method from org.codehaus.groovy.runtime.DefaultGroovyMethods Summary:
abs,   abs,   abs,   abs,   accept,   addShutdownHook,   and,   and,   and,   any,   any,   any,   append,   append,   append,   append,   asBoolean,   asBoolean,   asBoolean,   asBoolean,   asBoolean,   asBoolean,   asBoolean,   asBoolean,   asBoolean,   asBoolean,   asBoolean,   asBoolean,   asImmutable,   asImmutable,   asImmutable,   asImmutable,   asImmutable,   asImmutable,   asList,   asSynchronized,   asSynchronized,   asSynchronized,   asSynchronized,   asSynchronized,   asSynchronized,   asType,   asType,   asType,   asType,   asType,   asType,   asType,   asType,   asType,   asWritable,   asWritable,   bitwiseNegate,   bitwiseNegate,   callClosureForLine,   callClosureForMapEntry,   callClosureForMapEntryAndCounter,   center,   center,   collect,   collect,   collect,   collect,   collect,   collect,   collectAll,   collectAll,   combinations,   compareTo,   compareTo,   compareTo,   compareTo,   consumeProcessErrorStream,   consumeProcessErrorStream,   consumeProcessErrorStream,   consumeProcessOutput,   consumeProcessOutput,   consumeProcessOutput,   consumeProcessOutputStream,   consumeProcessOutputStream,   consumeProcessOutputStream,   contains,   count,   count,   count,   count,   count,   count,   count,   count,   count,   count,   count,   count,   createStringBufferWriter,   createStringWriter,   decodeBase64,   deleteDir,   denormalize,   disjoint,   div,   div,   div,   downto,   downto,   downto,   downto,   downto,   downto,   downto,   downto,   downto,   dump,   each,   each,   eachByte,   eachByte,   eachByte,   eachByte,   eachByte,   eachDir,   eachDirMatch,   eachDirRecurse,   eachFile,   eachFileMatch,   eachFileRecurse,   eachLine,   eachLine,   eachLine,   eachLine,   eachLine,   eachLine,   eachLine,   eachLine,   eachLine,   eachLine,   eachLine,   eachLine,   eachLine,   eachLine,   eachMatch,   eachMatch,   eachObject,   eachObject,   eachPermutation,   eachWithIndex,   eachWithIndex,   encodeBase64,   encodeBase64,   encodeBase64,   encodeBase64,   equals,   equals,   equals,   equals,   every,   every,   every,   execute,   execute,   execute,   execute,   execute,   filterLine,   filterLine,   filterLine,   filterLine,   filterLine,   filterLine,   find,   find,   find,   find,   find,   find,   find,   findAll,   findAll,   findAll,   findAll,   findAll,   findAll,   findAll,   findIndexOf,   findIndexOf,   findIndexValues,   findIndexValues,   findLastIndexOf,   findLastIndexOf,   first,   flatten,   flatten,   flatten,   flatten,   flatten,   flatten,   flatten,   flatten,   flatten,   flatten,   flatten,   format,   format,   get,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getAt,   getChars,   getCount,   getDateString,   getDateTimeString,   getErr,   getIn,   getMetaClass,   getMetaClass,   getMetaClass,   getMetaPropertyValues,   getOut,   getProperties,   getRootLoader,   getSubList,   getText,   getText,   getText,   getText,   getText,   getText,   getText,   getText,   getText,   getTimeString,   grep,   groupAnswer,   groupBy,   groupBy,   groupEntriesBy,   hasGroup,   hasProperty,   head,   identity,   inject,   inject,   inject,   inject,   inspect,   intdiv,   intdiv,   intdiv,   intdiv,   intersect,   invokeMethod,   is,   isBigDecimal,   isBigInteger,   isCase,   isCase,   isCase,   isCase,   isCase,   isCase,   isCase,   isDigit,   isDouble,   isFloat,   isInteger,   isLetter,   isLetterOrDigit,   isLong,   isLowerCase,   isNumber,   isUpperCase,   isWhitespace,   iterator,   iterator,   iterator,   iterator,   iterator,   iterator,   iterator,   iterator,   iterator,   iterator,   join,   join,   join,   last,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   leftShift,   matches,   max,   max,   max,   max,   max,   max,   max,   max,   max,   metaClass,   metaClass,   min,   min,   min,   min,   min,   min,   min,   min,   min,   minus,   minus,   minus,   minus,   minus,   minus,   minus,   minus,   minus,   minus,   minus,   minus,   minus,   minus,   minus,   mixin,   mixin,   mixin,   mixin,   mixin,   mixin,   mod,   multiply,   multiply,   multiply,   multiply,   multiply,   multiply,   multiply,   newDataInputStream,   newDataOutputStream,   newInputStream,   newInputStream,   newInstance,   newInstance,   newObjectInputStream,   newObjectInputStream,   newObjectInputStream,   newObjectInputStream,   newObjectOutputStream,   newObjectOutputStream,   newOutputStream,   newPrintWriter,   newPrintWriter,   newPrintWriter,   newReader,   newReader,   newReader,   newReader,   newReader,   newReader,   newWriter,   newWriter,   newWriter,   newWriter,   next,   next,   next,   next,   next,   normalize,   numberAwareCompareTo,   or,   or,   or,   or,   padLeft,   padLeft,   padRight,   padRight,   permutations,   pipeTo,   plus,   plus,   plus,   plus,   plus,   plus,   plus,   plus,   plus,   plus,   plus,   plus,   pop,   power,   previous,   previous,   previous,   previous,   previous,   primitiveArrayGet,   primitiveArrayGet,   primitiveArrayGet,   primitiveArrayPut,   print,   print,   print,   print,   print,   printf,   printf,   println,   println,   println,   println,   println,   println,   println,   push,   putAll,   putAt,   putAt,   putAt,   putAt,   putAt,   putAt,   putAt,   putAt,   putAt,   putAt,   putAt,   putAt,   putAt,   readBytes,   readLine,   readLine,   readLines,   readLines,   readLines,   readLines,   replaceAll,   replaceAll,   replaceFirst,   respondsTo,   respondsTo,   reverse,   reverse,   reverse,   reverse,   reverseEach,   reverseEach,   rightShift,   rightShiftUnsigned,   round,   round,   round,   round,   runAfter,   setIndex,   setMetaClass,   setMetaClass,   setText,   size,   size,   size,   size,   size,   size,   size,   size,   size,   size,   size,   size,   size,   size,   sort,   sort,   sort,   sort,   sort,   sort,   sort,   sort,   sort,   sort,   sort,   split,   split,   split,   split,   splitEachLine,   splitEachLine,   splitEachLine,   splitEachLine,   splitEachLine,   spread,   sprintf,   sprintf,   step,   subMap,   subsequences,   sum,   sum,   sum,   sum,   sum,   sum,   tail,   times,   toArrayString,   toBigDecimal,   toBigDecimal,   toBigInteger,   toBigInteger,   toBoolean,   toCharacter,   toDouble,   toDouble,   toFloat,   toFloat,   toInteger,   toInteger,   toList,   toList,   toList,   toList,   toList,   toList,   toList,   toList,   toList,   toList,   toList,   toList,   toList,   toListString,   toLong,   toLong,   toLowerCase,   toMapString,   toRowResult,   toShort,   toSpreadMap,   toSpreadMap,   toString,   toString,   toString,   toString,   toString,   toString,   toString,   toString,   toString,   toString,   toString,   toString,   toURI,   toURL,   toUpperCase,   tokenize,   tokenize,   transformChar,   transformLine,   transpose,   trunc,   trunc,   trunc,   trunc,   unaryMinus,   unique,   unique,   unique,   unique,   unique,   unique,   upto,   upto,   upto,   upto,   upto,   upto,   upto,   upto,   upto,   use,   use,   use,   waitForOrKill,   waitForProcessOutput,   waitForProcessOutput,   waitForProcessOutput,   with,   withDataInputStream,   withDataOutputStream,   withInputStream,   withInputStream,   withObjectInputStream,   withObjectInputStream,   withObjectInputStream,   withObjectInputStream,   withObjectOutputStream,   withObjectOutputStream,   withObjectStreams,   withOutputStream,   withOutputStream,   withPrintWriter,   withPrintWriter,   withPrintWriter,   withReader,   withReader,   withReader,   withReader,   withReader,   withReader,   withReader,   withStream,   withStream,   withStreams,   withWriter,   withWriter,   withWriter,   withWriter,   withWriter,   withWriter,   withWriterAppend,   withWriterAppend,   write,   write,   write,   writeLine,   xor,   xor,   xor
Methods from org.codehaus.groovy.runtime.DefaultGroovyMethodsSupport:
cloneSimilarCollection,   cloneSimilarMap,   closeQuietly,   closeWithWarning,   createSimilarCollection,   createSimilarCollection,   createSimilarList,   createSimilarMap,   createSimilarOrDefaultCollection,   createSimilarSet,   normaliseIndex,   sameType,   subListBorders,   subListBorders
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.codehaus.groovy.runtime.DefaultGroovyMethods Detail:
 public static int abs(Number number) 
    Get the absolute value
 public static long abs(Long number) 
    Get the absolute value
 public static float abs(Float number) 
    Get the absolute value
 public static double abs(Double number) 
    Get the absolute value
 public static Socket accept(ServerSocket serverSocket,
    Closure closure) throws IOException 
    Accepts a connection and passes the resulting Socket to the closure which runs in a new Thread.
 public static  void addShutdownHook(Object self,
    Closure closure) 
    Allows the usage of addShutdownHook without getting the runtime first.
 public static Number and(Number left,
    Number right) 
    Bitwise AND together two Numbers.
 public static BitSet and(BitSet left,
    BitSet right) 
    Bitwise AND together two BitSets.
 public static Boolean and(Boolean left,
    Boolean right) 
    Logical conjunction of two boolean operators.
 public 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. Equivalent to self.any({element -> element})
 public 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.
 public static boolean any(Map<K, V> self,
    Closure closure) 
    Iterates over the entries of a map, and checks whether a predicate is valid for at least one entry. If the closure takes one parameter then it will be passed the Map.Entry otherwise if the closure takes two parameters then it will be passed the key and the value.
 public static  void append(File file,
    Object text) throws IOException 
    Append the text at the end of the File.
 public static  void append(File file,
    byte[] bytes) throws IOException 
    Append bytes to the end of a File.
 public static  void append(File self,
    InputStream stream) throws IOException 
    Append binary data to the file. It will not be interpreted as text.
 public static  void append(File file,
    Object text,
    String charset) throws IOException 
    Append the text at the end of the File, using a specified encoding.
 public static boolean asBoolean(Object object) 
    Coerce an object instance to a boolean value. An object is coerced to true if it's not null, to false if it is null.
 public static boolean asBoolean(Boolean bool) 
    Coerce an Boolean instance to a boolean value.
 public static boolean asBoolean(Matcher matcher) 
    Coerce a Matcher instance to a boolean value.
 public static boolean asBoolean(Collection collection) 
    Coerce a collection instance to a boolean value. A collection is coerced to false if it's empty, and to true otherwise.
 public static boolean asBoolean(Map map) 
    Coerce a map instance to a boolean value. A map is coerced to false if it's empty, and to true otherwise.
 public static boolean asBoolean(Iterator iterator) 
    Coerce an iterator instance to a boolean value. An iterator is coerced to false if there are no more elements to iterate over, and to true otherwise.
 public static boolean asBoolean(Enumeration enumeration) 
    Coerce an enumeration instance to a boolean value. An enumeration is coerced to false if there are no more elements to enumerate, and to true otherwise.
 public static boolean asBoolean(CharSequence string) 
    Coerce a string (an instance of CharSequence) to a boolean value. A string is coerced to false if it is of length 0, and to true otherwise.
 public static boolean asBoolean(Object[] array) 
    Coerce an Object array to a boolean value. An Object array is false if the array is of length 0. and to true otherwise
 public static boolean asBoolean(Character character) 
    Coerce a character to a boolean value. A character is coerced to false if it's character value is equal to 0, and to true otherwise.
 public static boolean asBoolean(Number number) 
    Coerce a number to a boolean value. A number is coerced to false if its double value is equal to 0, and to true otherwise, and to true otherwise.
 public static boolean asBoolean(GroovyResultSet grs) 
    Coerce a GroovyResultSet to a boolean value. A GroovyResultSet is coerced to false if there are no more rows to iterate over, and to true otherwise.
 public static Map<K, V> asImmutable(Map<? extends K, ? extends V> self) 
    A convenience method for creating an immutable map.
 public static SortedMap<K, V> asImmutable(SortedMap<K, ? extends V> self) 
    A convenience method for creating an immutable sorted map.
 public static List<T> asImmutable(List<? extends T> self) 
    A convenience method for creating an immutable list
 public static Set<T> asImmutable(Set<? extends T> self) 
    A convenience method for creating an immutable list.
 public static SortedSet<T> asImmutable(SortedSet<T> self) 
    A convenience method for creating an immutable sorted set.
 public static Collection<T> asImmutable(Collection<? extends T> self) 
    A convenience method for creating an immutable Collection.
 public static List<T> asList(Collection<T> self) 
    Converts this collection to a List.
 public static Map<K, V> asSynchronized(Map<K, V> self) 
    A convenience method for creating a synchronized Map.
 public static SortedMap<K, V> asSynchronized(SortedMap<K, V> self) 
    A convenience method for creating a synchronized SortedMap.
 public static Collection<T> asSynchronized(Collection<T> self) 
    A convenience method for creating a synchronized Collection.
 public static List<T> asSynchronized(List<T> self) 
    A convenience method for creating a synchronized List.
 public static Set<T> asSynchronized(Set<T> self) 
    A convenience method for creating a synchronized Set.
 public static SortedSet<T> asSynchronized(SortedSet<T> self) 
    A convenience method for creating a synchronized SortedSet.
 public static Object asType(Collection col,
    Class clazz) 
    Converts the given collection to another type. A default concrete type is used for List, Set, or SortedSet. If the given type has a constructor taking a collection, that is used. Otherwise, the call is deferred to {link #asType(Object,Class)}. If this collection is already of the given type, the same instance is returned.
 public static Object asType(Object[] ary,
    Class clazz) 
    Converts the given array to either a List, Set, or SortedSet. If the given class is something else, the call is deferred to {link #asType(Object,Class)}.
 public static Object asType(Closure cl,
    Class clazz) 
    Coerces the closure to an implementation of the given class. The class is assumed to be an interface or class with a single method definition. The closure is used as the implementation of that single method.
 public 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. Typically the value would be a closure which behaves like the method implementation.
 public static Object asType(Number self,
    Class c) 
    Transform this number to a the given type, using the 'as' operator. The following types are supported in addition to the default #asType(Object,Class) :
    • BigDecimal
    • BigInteger
    • Double
    • Float
 public static Object asType(File f,
    Class c) 
 public static Object asType(GString self,
    Class c) 
 public static Object asType(String self,
    Class c) 

    Provides a method to perform custom 'dynamic' type conversion to the given class using the as operator.

    Example: '123' as Double

    By default, the following types are supported:

    • List
    • BigDecimal
    • BigInteger
    • Long
    • Integer
    • Short
    • Byte
    • Character
    • Double
    • Float
    • File
    • Subclasses of Enum (Java 5 and above)
    If any other type is given, the call is delegated to #asType(Object,Class) .
 public static Object asType(Object obj,
    Class type) 
    Converts a given object to a type. This method is used through the "as" operator and is overloadable as any other operator.
 public static File asWritable(File file) 
 public static File asWritable(File file,
    String encoding) 
    Allows a file to return a Writable implementation that can output itself to a Writer stream.
 public static Pattern bitwiseNegate(String self) 
    Turns a String into a regular expression Pattern
 public static BitSet bitwiseNegate(BitSet self) 
    Bitwise NEGATE a BitSet.
 protected static Object callClosureForLine(Closure closure,
    String line,
    int counter) 
 protected static Object callClosureForMapEntry(Closure closure,
    Entry entry) 
 protected static Object callClosureForMapEntryAndCounter(Closure closure,
    Entry entry,
    int counter) 
 public static String center(String self,
    Number numberOfChars) 
    Center a String and pad it with spaces appended around it
 public static String center(String self,
    Number numberOfChars,
    String padding) 
    Center a String and pad it with the characters appended around it
 public 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. Example:
    def list = [1, 'a', 1.23, true ]
    def types = list.collect { it.class }
    
 public 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.
 public 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.
 public 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.
 public 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.
 public 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.
 public 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. Returns a potentially nested list of transformed values.
 public 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. Returns a potentially nested collection of transformed values.
 public static List combinations(Collection self) 
    Adds GroovyCollections#combinations(Collection) as a method on collections.
 public static int compareTo(Character left,
    Number right) 
    Compare a Character and a Number. The ordinal value of the Character is used in the comparison (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static int compareTo(Number left,
    Character right) 
    Compare a Number and a Character. The ordinal value of the Character is used in the comparison (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static int compareTo(Character left,
    Character right) 
    Compare two Characters. The ordinal values of the Characters are compared (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static int compareTo(Number left,
    Number right) 
    Compare two Numbers. Equality (==) for numbers dispatches to this.
 public static Thread 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. The processed stream data is appended to the supplied StringBuffer. A new Thread is started, so this method will return immediately.
 public static Thread 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. The processed stream data is appended to the supplied OutputStream. A new Thread is started, so this method will return immediately.
 public static Thread 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. The processed stream data is appended to the supplied Writer. A new Thread is started, so this method will return immediately.
 public 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. The stream data is thrown away but blocking due to a full output buffer is avoided. Use this method if you don't care about the standard or error output and just want the process to run silently - use carefully however, because since the stream data is thrown away, it might be difficult to track down when something goes wrong. For this, two Threads are started, so this method will return immediately.
 public 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. The processed stream data is appended to the supplied StringBuffer. For this, two Threads are started, so this method will return immediately.
 public 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. The processed stream data is appended to the supplied OutputStream. For this, two Threads are started, so this method will return immediately.
 public static Thread 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. The processed stream data is appended to the supplied StringBuffer. A new Thread is started, so this method will return immediately.
 public static Thread 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. The processed stream data is appended to the supplied OutputStream. A new Thread is started, so this method will return immediately.
 public static Thread 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. The processed stream data is appended to the supplied Writer. A new Thread is started, so this method will return immediately.
 public static boolean contains(String self,
    String text) 
    Provide an implementation of contains() like Collection#contains(Object) to make Strings more polymorphic. This method is not required on JDK 1.5 onwards
 public static Number count(Iterator self,
    Object value) 
    Counts the number of occurrences of the given value from the items within this Iterator. Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) ). The iterator will become exhausted of elements after determining the count value.
 public static Number count(Collection self,
    Object value) 
    Counts the number of occurrences of the given value inside this collection. Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) ).
 public static Number count(Object[] self,
    Object value) 
    Counts the number of occurrences of the given value inside this array. Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) ).
 public static Number count(int[] self,
    Object value) 
    Counts the number of occurrences of the given value inside this array. Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) ).
 public static Number count(long[] self,
    Object value) 
    Counts the number of occurrences of the given value inside this array. Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) ).
 public static Number count(short[] self,
    Object value) 
    Counts the number of occurrences of the given value inside this array. Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) ).
 public static Number count(char[] self,
    Object value) 
    Counts the number of occurrences of the given value inside this array. Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) ).
 public static Number count(boolean[] self,
    Object value) 
    Counts the number of occurrences of the given value inside this array. Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) ).
 public static Number count(double[] self,
    Object value) 
    Counts the number of occurrences of the given value inside this array. Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) ).
 public static Number count(float[] self,
    Object value) 
    Counts the number of occurrences of the given value inside this array. Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) ).
 public static Number count(byte[] self,
    Object value) 
    Counts the number of occurrences of the given value inside this array. Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) ).
 public 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) 
 public static byte[] decodeBase64(String value) 
    Decode the String from Base64 into a byte array.
 public static boolean deleteDir(File self) 
    Deletes a directory with all contained files and subdirectories.

    The method returns

    • true, when deletion was successful
    • true, when it is called for a non existing directory
    • false, when it is called for a file which isn't a directory
    • false, when directory couldn't be deleted

 public static String denormalize(String self) 
    Return a String with lines (separated by LF, CR/LF, or CR) terminated by the platform specific line separator.
 public static boolean disjoint(Collection left,
    Collection right) 
    Returns true if the intersection of two collections is empty.
 public static Number div(Character left,
    Number right) 
    Divide a Character by a Number. The ordinal value of the Character is used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Number div(Number left,
    Character right) 
    Divide a Number by a Character. The ordinal value of the Character is used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Number div(Character left,
    Character right) 
    Divide one Character by another. The ordinal values of the Characters are used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static  void downto(Number self,
    Number to,
    Closure closure) 
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
 public static  void downto(long self,
    Number to,
    Closure closure) 
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
 public static  void downto(Long self,
    Number to,
    Closure closure) 
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
 public static  void downto(float self,
    Number to,
    Closure closure) 
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
 public static  void downto(Float self,
    Number to,
    Closure closure) 
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
 public static  void downto(double self,
    Number to,
    Closure closure) 
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
 public static  void downto(Double self,
    Number to,
    Closure closure) 
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
 public static  void downto(BigInteger self,
    Number to,
    Closure closure) 
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
 public static  void downto(BigDecimal self,
    Number to,
    Closure closure) 
    Iterates from this number down to the given number, inclusive, decrementing by one each time. Each number is passed to the closure. Example:
    10.5.downto(0) {
      println it
    }
    Prints numbers 10.5, 9.5 ... to 0.5.
 public static String dump(Object self) 
    Generates a detailed dump string of an object showing its class, hashCode and fields.
 public static T each(T self,
    Closure closure) 
    Iterates through an aggregate type or data structure, passing each item to the given closure. Custom types may utilize this method by simply providing an "iterator()" method. The items returned from the resulting iterator will be passed to the closure.
 public static Map<K, V> each(Map<K, V> self,
    Closure closure) 
    Allows a Map to be iterated through using a closure. If the closure takes one parameter then it will be passed the Map.Entry otherwise if the closure takes two parameters then it will be passed the key and the value.
 public static  void eachByte(File self,
    Closure closure) throws IOException 
    Traverse through each byte of this File
 public static  void eachByte(Byte[] self,
    Closure closure) 
    Traverse through each byte of this Byte array. Alias for each.
 public static  void eachByte(byte[] self,
    Closure closure) 
    Traverse through each byte of this byte array. Alias for each.
 public static  void eachByte(InputStream is,
    Closure closure) throws IOException 
    Traverse through each byte of the specified stream. The stream is closed after the closure returns.
 public static  void eachByte(URL url,
    Closure closure) throws IOException 
    Reads the InputStream from this URL, passing each byte to the given closure. The URL stream will be closed before this method returns.
 public static  void eachDir(File self,
    Closure closure) throws FileNotFoundException, IllegalArgumentException 
    Invokes the closure for each subdirectory in this directory, ignoring regular files.
 public static  void eachDirMatch(File self,
    Object filter,
    Closure closure) throws FileNotFoundException, IllegalArgumentException 
    Invokes the closure for each subdirectory whose name (dir.name) matches the given filter in the given directory - calling the isCase() method to determine if a match occurs. This method can be used with different kinds of filters like regular expressions, classes, ranges etc. Only subdirectories are matched; regular files are ignored.
 public static  void eachDirRecurse(File self,
    Closure closure) throws FileNotFoundException, IllegalArgumentException 
    Invokes the closure for each descendant directory of this directory. Sub-directories are recursively searched in a depth-first fashion. Only subdirectories are passed to the closure; regular files are ignored.
 public static  void eachFile(File self,
    Closure closure) throws FileNotFoundException, IllegalArgumentException 
    Invokes the closure for each 'child' file in this 'parent' folder/directory. Both regular files and subfolders/subdirectories are processed.
 public static  void eachFileMatch(File self,
    Object filter,
    Closure closure) throws FileNotFoundException, IllegalArgumentException 
    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. This method can be used with different kinds of filters like regular expressions, classes, ranges etc. Both regular files and subdirectories are matched.
 public static  void eachFileRecurse(File self,
    Closure closure) throws FileNotFoundException, IllegalArgumentException 
    Invokes the closure for each descendant file in this directory. Sub-directories are recursively searched in a depth-first fashion. Both regular files and subdirectories are passed to the closure.
 public static Object eachLine(String self,
    Closure closure) throws IOException 
    Iterates through this String line by line. Each line is passed to the given 1 or 2 arg closure. If a 2 arg closure is found the line count is passed as the second argument.
 public static Object eachLine(File self,
    Closure closure) throws IOException 
    Iterates through this file line by line. Each line is passed to the given 1 or 2 arg closure. The file is read using a reader which is closed before this method returns.
 public static Object eachLine(InputStream stream,
    Closure closure) throws IOException 
    Iterates through this stream, passing each line to the given 1 or 2 arg closure. The stream is closed before this method returns.
 public static Object eachLine(URL url,
    Closure closure) throws IOException 
    Iterates through the lines read from the URL's associated input stream passing each line to the given 1 or 2 arg closure. The stream is closed before this method returns.
 public static Object eachLine(Reader self,
    Closure closure) throws IOException 
    Iterates through the given reader line by line. Each line is passed to the given 1 or 2 arg closure. If the closure has two arguments, the line count is passed as the second argument. The Reader is closed before this method returns.
 public static Object eachLine(String self,
    int firstLine,
    Closure closure) throws IOException 
    Iterates through this String line by line. Each line is passed to the given 1 or 2 arg closure. If a 2 arg closure is found the line count is passed as the second argument.
 public static Object eachLine(File self,
    int firstLine,
    Closure closure) throws IOException 
    Iterates through this file line by line. Each line is passed to the given 1 or 2 arg closure. The file is read using a reader which is closed before this method returns.
 public static Object eachLine(InputStream stream,
    String charset,
    Closure closure) throws IOException 
    Iterates through this stream reading with the provided charset, passing each line to the given 1 or 2 arg closure. The stream is closed before this method returns.
 public static Object eachLine(InputStream stream,
    int firstLine,
    Closure closure) throws IOException 
    Iterates through this stream, passing each line to the given 1 or 2 arg closure. The stream is closed before this method returns.
 public static Object eachLine(URL url,
    int firstLine,
    Closure closure) throws IOException 
    Iterates through the lines read from the URL's associated input stream passing each line to the given 1 or 2 arg closure. The stream is closed before this method returns.
 public static Object eachLine(URL url,
    String charset,
    Closure closure) throws IOException 
    Iterates through the lines read from the URL's associated input stream passing each line to the given 1 or 2 arg closure. The stream is closed before this method returns.
 public static Object eachLine(Reader self,
    int firstLine,
    Closure closure) throws IOException 
    Iterates through the given reader line by line. Each line is passed to the given 1 or 2 arg closure. If the closure has two arguments, the line count is passed as the second argument. The Reader is closed before this method returns.
 public static Object eachLine(InputStream stream,
    String charset,
    int firstLine,
    Closure closure) throws IOException 
    Iterates through this stream reading with the provided charset, passing each line to the given 1 or 2 arg closure. The stream is closed after this method returns.
 public static Object eachLine(URL url,
    String charset,
    int firstLine,
    Closure closure) throws IOException 
    Iterates through the lines read from the URL's associated input stream passing each line to the given 1 or 2 arg closure. The stream is closed before this method returns.
 public static String eachMatch(String self,
    String regex,
    Closure closure) 
    Process each regex group matched substring of the given string. If the closure parameter takes one argument, an array with all match groups is passed to it. If the closure takes as many arguments as there are match groups, then each parameter will be one match group.
 public static String eachMatch(String self,
    Pattern pattern,
    Closure closure) 
    Process each regex group matched substring of the given pattern. If the closure parameter takes one argument, an array with all match groups is passed to it. If the closure takes as many arguments as there are match groups, then each parameter will be one match group.
 public static  void eachObject(File self,
    Closure closure) throws IOException, ClassNotFoundException 
    Iterates through the given file object by object.
 public static  void eachObject(ObjectInputStream ois,
    Closure closure) throws IOException, ClassNotFoundException 
    Iterates through the given object stream object by object. The ObjectInputStream is closed afterwards.
 public static Iterator<T> eachPermutation(Collection<T> self,
    Closure closure) 
    Iterates over all permutations of a collection, running a closure for each iteration. E.g. [1, 2, 3].eachPermutation{ println it } would print: [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 1, 2] [3, 2, 1]
 public 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.
 public static Map<K, V> eachWithIndex(Map<K, V> self,
    Closure closure) 
    Allows a Map to be iterated through using a closure. If the closure takes two parameters then it will be passed the Map.Entry and the item's index (a counter starting at zero) otherwise if the closure takes three parameters then it will be passed the key, the value, and the index.
 public static Writable encodeBase64(Byte[] data) 
    Produce a Writable object which writes the Base64 encoding of the byte array. Calling toString() on the result returns the encoding as a String. For more information on Base64 encoding and chunking see RFC 4648.
 public static Writable encodeBase64(byte[] data) 
    Produce a Writable object which writes the Base64 encoding of the byte array. Calling toString() on the result returns the encoding as a String. For more information on Base64 encoding and chunking see RFC 4648.
 public static Writable encodeBase64(Byte[] data,
    boolean chunked) 
    Produce a Writable object which writes the Base64 encoding of the byte array. Calling toString() on the result returns the encoding as a String. For more information on Base64 encoding and chunking see RFC 4648.
 public static Writable encodeBase64(byte[] data,
    boolean chunked) 
    Produce a Writable object which writes the Base64 encoding of the byte array. Calling toString() on the result returns the encoding as a String. For more information on Base64 encoding and chunking see RFC 4648.
 public static boolean equals(int[] left,
    int[] right) 
    Compare the contents of this array to the contents of the given array.
 public 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. This returns false if either collection is null.
 public 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. This returns false if either collection is null.
 public static boolean equals(List left,
    List right) 
    Compare the contents of two Lists. Order matters. If numbers exist in the Lists, then they are compared as numbers, for example 2 == 2L. If either list is null, the result is false.
 public static boolean every(Object self) 
    Iterates over every element of a collection, and checks whether all elements are true according to the Groovy Truth. Equivalent to self.every({element -> element})
 public 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). A simple example for a list:
    def list = [3,4,5]
    def greaterThanTwo = list.every { it > 2 }
    
 public static boolean every(Map<K, V> self,
    Closure closure) 
    Iterates over the entries of a map, and checks whether a predicate is valid for all entries. If the closure takes one parameter then it will be passed the Map.Entry otherwise if the closure takes two parameters then it will be passed the key and the value.
 public static Process execute(String self) throws IOException 
    Executes the given string as a command line process. For more control over the process mechanism in JDK 1.5 you can use java.lang.ProcessBuilder.
 public static Process execute(String[] commandArray) throws IOException 
    Executes the command specified by the String array that is the parameter. The first item in the array is the command the others are the parameters. For more control over the process mechanism in JDK 1.5 you can use java.lang.ProcessBuilder.
 public static Process execute(List commandList) throws IOException 
    Executes the command specified by the String list that is the parameter. The first item in the array is the command the others are the parameters. All entries must be Strings. For more control over the process mechanism in JDK 1.5 you can use java.lang.ProcessBuilder.
 public static Process execute(String self,
    String[] envp,
    File dir) throws IOException 
    Executes the command specified by the self with environments envp under the working directory dir. For more control over the process mechanism in JDK 1.5 you can use java.lang.ProcessBuilder.
 public static Process execute(String self,
    List envp,
    File dir) throws IOException 
    Executes the command specified by the self with environments envp under the working directory dir. For more control over the process mechanism in JDK 1.5 you can use java.lang.ProcessBuilder.
 public static Writable filterLine(File self,
    Closure closure) throws IOException 
    Filters the lines of a File and creates a Writeable in return to stream the filtered lines.
 public 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. The closure should return true if the line should be passed to the writer.
 public static Writable filterLine(InputStream self,
    Closure predicate) 
    Filter lines from an input stream using a closure predicate. The closure will be passed each line as a String, and it should return true if the line should be passed to the writer.
 public static  void filterLine(Reader reader,
    Writer writer,
    Closure closure) throws IOException 
    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. Both Reader and Writer are closed after the operation.
 public static  void filterLine(File self,
    Writer writer,
    Closure closure) throws IOException 
    Filter the lines from this File, and write them to the given writer based on the given closure predicate.
 public static  void filterLine(InputStream self,
    Writer writer,
    Closure predicate) throws IOException 
    Uses a closure to filter lines from this InputStream and pass them to the given writer. The closure will be passed each line as a String, and it should return true if the line should be passed to the writer.
 public static Object find(Object self,
    Closure closure) 
    Finds the first value matching the closure condition
 public static T find(Collection<T> self,
    Closure closure) 
    Finds the first value matching the closure condition. Example:
    def list = [1,2,3]
    list.find { it > 1 } // returns 2
    
 public static Entry<K, V> find(Map<K, V> self,
    Closure closure) 
    Finds the first entry matching the closure condition. If the closure takes two parameters, the entry key and value are passed. If the closure takes one parameter, the Map.Entry object is passed.
 public static String find(String self,
    String regex) 
    Finds the first occurrence of a regular expression String within a String. If the regex doesn't match, null will be returned.

    For example, if the regex doesn't match the result is null:

        assert null == "New York, NY".find(/\d{5}/)
    

    If it does match, we get the matching string back:

         assert "10292" == "New York, NY 10292-0098".find(/\d{5}/)
    

    If we have capture groups in our expression, we still get back the full match

         assert "10292-0098" == "New York, NY 10292-0098".find(/(\d{5})-?(\d{4})/)
    

 public static String find(String self,
    Pattern pattern) 
    Finds the first occurrence of a compiled regular expression Pattern within a String. If the pattern doesn't match, null will be returned.

    For example, if the pattern doesn't match the result is null:

        assert null == "New York, NY".find(~/\d{5}/)
    

    If it does match, we get the matching string back:

         assert "10292" == "New York, NY 10292-0098".find(~/\d{5}/)
    

    If we have capture groups in our expression, the groups are ignored and we get back the full match:

         assert "10292-0098" == "New York, NY 10292-0098".find(~/(\d{5})-?(\d{4})/)
    
    If you need to work with capture groups, then use the closure version of this method or use Groovy's matcher operators or use eachMatch.

 public static String find(String self,
    String regex,
    Closure closure) 
    Finds the first occurrence of a regular expression String within a String. If the regex doesn't match, the closure will not be called and find will return null.

    For example, if the regex doesn't match, the result is null:

        assert null == "New York, NY".find(~/\d{5}/) { match -> return "-$match-"}
    

    If it does match and we don't have any capture groups in our regex, there is a single parameter on the closure that the match gets passed to:

         assert "-10292-" == "New York, NY 10292-0098".find(~/\d{5}/) { match -> return "-$match-"}
    

    If we have capture groups in our expression, our closure has one parameter for the match, followed by one for each of the capture groups:

         assert "10292" == "New York, NY 10292-0098".find(~/(\d{5})-?(\d{4})/) { match, zip, plusFour ->
             assert match == "10292-0098"
             assert zip == "10292"
             assert plusFour == "0098"
             return zip
         }
    

    If we have capture groups in our expression, and our closure has one parameter, the closure will be passed an array with the first element corresponding to the whole match, followed by an element for each of the capture groups:

         assert "10292" == "New York, NY 10292-0098".find(~/(\d{5})-?(\d{4})/) { match, zip, plusFour ->
             assert array[0] == "10292-0098"
             assert array[1] == "10292"
             assert array[2] == "0098"
             return array[1]
         }
    

    If a capture group is optional, and doesn't match, then the corresponding value for that capture group passed to the closure will be null as illustrated here:

         assert "2339999" == "adsf 233-9999 adsf".find(~/(\d{3})?-?(\d{3})-(\d{4})/) { match, areaCode, exchange, stationNumber ->
             assert "233-9999" == match
             assert null == areaCode
             assert "233" == exchange
             assert "9999" == stationNumber
             return "$exchange$stationNumber"
         }
    

 public static String find(String self,
    Pattern pattern,
    Closure closure) 
    Finds the first occurrence of a compiled regular expression Pattern within a String. If the pattern doesn't match, the closure will not be called and find will return null.

    For example, if the pattern doesn't match, the result is null:

        assert null == "New York, NY".find(~/\d{5}/) { match -> return "-$match-"}
    

    If it does match and we don't have any capture groups in our regex, there is a single parameter on the closure that the match gets passed to:

         assert "-10292-" == "New York, NY 10292-0098".find(~/\d{5}/) { match -> return "-$match-"}
    

    If we have capture groups in our expression, our closure has one parameter for the match, followed by one for each of the capture groups:

         assert "10292" == "New York, NY 10292-0098".find(~/(\d{5})-?(\d{4})/) { match, zip, plusFour ->
             assert match == "10292-0098"
             assert zip == "10292"
             assert plusFour == "0098"
             return zip
         }
    

    If we have capture groups in our expression, and our closure has one parameter, the closure will be passed an array with the first element corresponding to the whole match, followed by an element for each of the capture groups:

         assert "10292" == "New York, NY 10292-0098".find(~/(\d{5})-?(\d{4})/) { match, zip, plusFour ->
             assert array[0] == "10292-0098"
             assert array[1] == "10292"
             assert array[2] == "0098"
             return array[1]
         }
    

    If a capture group is optional, and doesn't match, then the corresponding value for that capture group passed to the closure will be null as illustrated here:

         assert "2339999" == "adsf 233-9999 adsf".find(~/(\d{3})?-?(\d{3})-(\d{4})/) { match, areaCode, exchange, stationNumber ->
             assert "233-9999" == match
             assert null == areaCode
             assert "233" == exchange
             assert "9999" == stationNumber
             return "$exchange$stationNumber"
         }
    

 public static Collection<T> findAll(Collection<T> self,
    Closure closure) 
    Finds all values matching the closure condition.
 public static Collection findAll(Object self,
    Closure closure) 
    Finds all items matching the closure condition.
 public static Map<K, V> findAll(Map<K, V> self,
    Closure closure) 
    Finds all entries matching the closure condition. If the closure takes one parameter then it will be passed the Map.Entry. Otherwise if the closure should take two parameters, which will be the key and the value.

    If the self map is one of TreeMap, LinkedHashMap, Hashtable or Properties, the returned Map will preserve that type, otherwise a HashMap will be returned.

 public static List findAll(String self,
    String regex) 
    Finds all occurrences of a regular expression string within a String. A List is returned containing all full matches or an empty list if there are no matches within the string.

    For example, if the regex doesn't match, it returns an empty list:

    assert [] == "foo".findAll(/(\w*) Fish/)
    

    Any regular expression matches are returned in a list, and all regex capture groupings are ignored, only the full match is returned:

    def expected = ["One Fish", "Two Fish", "Red Fish", "Blue Fish"]
    assert expected == "One Fish, Two Fish, Red Fish, Blue Fish".findAll(/(\w*) Fish/)
    
    If you need to work with capture groups, then use the closure version of this method or use Groovy's matcher operators or use eachMatch.

 public static List findAll(String self,
    Pattern pattern) 
    Finds all occurrences of a regular expression Pattern within a String. A List is returned containing all full matches or an empty list if there are no matches within the string.

    For example, if the pattern doesn't match, it returns an empty list:

    assert [] == "foo".findAll(~/(\w*) Fish/)
    

    Any regular expression matches are returned in a list, and all regex capture groupings are ignored, only the full match is returned:

    def expected = ["One Fish", "Two Fish", "Red Fish", "Blue Fish"]
    assert expected == "One Fish, Two Fish, Red Fish, Blue Fish".findAll(~/(\w*) Fish/)
    
 public static List findAll(String self,
    String regex,
    Closure closure) 
    Finds all occurrences of a regular expression string within a String. Any matches are passed to the specified closure. The closure is expected to have the full match in the first parameter. If there are any capture groups, they will be placed in subsequent parameters.

    If there are no matches, the closure will not be called, and an empty List will be returned.

    For example, if the regex doesn't match, it returns an empty list:

    assert [] == "foo".findAll(/(\w*) Fish/) { match, firstWord -> return firstWord }
    

    Any regular expression matches are passed to the closure, if there are no capture groups, there will be one parameter for the match:

    assert ["couldn't", "wouldn't"] == "I could not, would not, with a fox.".findAll(/.ould/) { match -> "${match}n't"}
    

    If there are capture groups, the first parameter will be the match followed by one parameter for each capture group:

    def orig = "There's a Wocket in my Pocket"
    assert ["W > Wocket", "P > Pocket"] == orig.findAll(/(.)ocket/) { match, firstLetter -> "$firstLetter > $match" }
    
 public static List findAll(String self,
    Pattern pattern,
    Closure closure) 
    Finds all occurrences of a compiled regular expression Pattern within a String. Any matches are passed to the specified closure. The closure is expected to have the full match in the first parameter. If there are any capture groups, they will be placed in subsequent parameters.

    If there are no matches, the closure will not be called, and an empty List will be returned.

    For example, if the pattern doesn't match, it returns an empty list:

    assert [] == "foo".findAll(~/(\w*) Fish/) { match, firstWord -> return firstWord }
    

    Any regular expression matches are passed to the closure, if there are no capture groups, there will be one parameter for the match:

    assert ["couldn't", "wouldn't"] == "I could not, would not, with a fox.".findAll(~/.ould/) { match -> "${match}n't"}
    

    If there are capture groups, the first parameter will be the match followed by one parameter for each capture group:

    def orig = "There's a Wocket in my Pocket"
    assert ["W > Wocket", "P > Pocket"] == orig.findAll(~/(.)ocket/) { match, firstLetter -> "$firstLetter > $match" }
    
 public 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.
 public 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.
 public static List<Number> 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.
 public static List<Number> findIndexValues(Object self,
    Number 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.
 public 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.
 public 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.
 public static T first(List<T> self) 
    Returns the first item from the List.
 public static Collection flatten(Collection self) 
    Flatten a collection. This collection and any nested arrays or collections have their contents (recursively) added to the new collection.
 public static Collection flatten(Object[] self) 
    Flatten an array. This array and any nested arrays or collections have their contents (recursively) added to the new collection.
 public static Collection flatten(boolean[] self) 
    Flatten an array. This array and any nested arrays or collections have their contents (recursively) added to the new collection.
 public static Collection flatten(byte[] self) 
    Flatten an array. This array and any nested arrays or collections have their contents (recursively) added to the new collection.
 public static Collection flatten(char[] self) 
    Flatten an array. This array and any nested arrays or collections have their contents (recursively) added to the new collection.
 public static Collection flatten(short[] self) 
    Flatten an array. This array and any nested arrays or collections have their contents (recursively) added to the new collection.
 public static Collection flatten(int[] self) 
    Flatten an array. This array and any nested arrays or collections have their contents (recursively) added to the new collection.
 public static Collection flatten(long[] self) 
    Flatten an array. This array and any nested arrays or collections have their contents (recursively) added to the new collection.
 public static Collection flatten(float[] self) 
    Flatten an array. This array and any nested arrays or collections have their contents (recursively) added to the new collection.
 public static Collection flatten(double[] self) 
    Flatten an array. This array and any nested arrays or collections have their contents (recursively) added to the new collection.
 public static Collection flatten(Collection self,
    Closure flattenUsing) 
    Flatten a collection. This collection and any nested arrays or collections have their contents (recursively) added to the new collection. For any non-Array, non-Collection object which represents some sort of collective type, the supplied closure should yield the contained items; otherwise, the closure should just return any element which corresponds to a leaf.
 public static String format(Date self,
    String format) 

    Create a String representation of this date according to the given format pattern.

    For example, if the system timezone is GMT, new Date(0).format('MM/dd/yy') would return the string "01/01/70". See documentation for SimpleDateFormat for format pattern use.

    Note that a new DateFormat instance is created for every invocation of this method (for thread safety).

 public static String format(Calendar self,
    String pattern) 

    Shortcut for SimpleDateFormat to output a String representation of this calendar instance. This method respects the Calendar's assigned TimeZone , whereas calling cal.time.format('HH:mm:ss') would use the system timezone.

    Note that Calendar equivalents of date.getDateString() and variants do not exist because those methods are Locale-dependent. Although a Calendar may be assigned a Locale , that information is lost and therefore cannot be used to control the default date/time formats provided by these methods. Instead, the system Locale would always be used. The alternative is to simply call DateFormat#getDateInstance(int, Locale) and pass the same Locale that was used for the Calendar.

 public static V get(Map<K, V> map,
    K key,
    V 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.
 public static Object getAt(Object self,
    String property) 
    Allows the subscript operator to be used to lookup dynamic property values. bean[somePropertyNameExpression]. The normal property notation of groovy is neater and more concise but only works with compile-time known property names.
 public static CharSequence getAt(CharSequence text,
    int index) 
    Support the subscript operator for CharSequence.
 public static String getAt(String text,
    int index) 
    Support the subscript operator for String.
 public static CharSequence getAt(CharSequence text,
    Range range) 
    Support the range subscript operator for CharSequence
 public static CharSequence getAt(CharSequence text,
    IntRange range) 
    Support the range subscript operator for CharSequence or StringBuffer with IntRange
 public static CharSequence getAt(CharSequence text,
    EmptyRange range) 
    Support the range subscript operator for CharSequence or StringBuffer with EmptyRange
 public static String getAt(String text,
    IntRange range) 
    Support the range subscript operator for String with IntRange
 public static String getAt(String text,
    EmptyRange range) 
    Support the range subscript operator for String with EmptyRange
 public static String getAt(String text,
    Range range) 
    Support the range subscript operator for String
 public static Object getAt(Matcher matcher,
    int idx) 
    Support the subscript operator, e.g. matcher[index], for a regex Matcher.

    For an example using no group match,

       def p = /ab[d|f]/
       def m = "abcabdabeabf" =~ p
       assert 2 == m.count
       assert 2 == m.size() // synonym for m.getCount()
       assert ! m.hasGroup()
       assert 0 == m.groupCount()
       def matches = ["abd", "abf"]
       for (i in 0..<m.count) {
         assert m[i] == matches[i]
       }
    

    For an example using group matches,

       def p = /(?:ab([c|d|e|f]))/
       def m = "abcabdabeabf" =~ p
       assert 4 == m.count
       assert m.hasGroup()
       assert 1 == m.groupCount()
       def matches = [["abc", "c"], ["abd", "d"], ["abe", "e"], ["abf", "f"]]
       for (i in 0..<m.count) {
         assert m[i] == matches[i]
       }
    

    For another example using group matches,

       def m = "abcabdabeabfabxyzabx" =~ /(?:ab([d|x-z]+))/
       assert 3 == m.count
       assert m.hasGroup()
       assert 1 == m.groupCount()
       def matches = [["abd", "d"], ["abxyz", "xyz"], ["abx", "x"]]
       for (i in 0..<m.count) {
         assert m[i] == matches[i]
       }
    
 public static List<T> getAt(List<T> self,
    Range range) 
    Support the range subscript operator for a List
 public static List<T> getAt(List<T> self,
    EmptyRange range) 
    Support the range subscript operator for a List
 public static List<T> getAt(List<T> self,
    Collection indices) 
    Select a List of items from a List using a Collection to identify the indices to be selected.
 public static List<T> getAt(T[] self,
    Collection indices) 
    Select a List of items from an Object array using a Collection to identify the indices to be selected.
 public 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.
 public 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.
 public 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.
 public static List<T> getAt(T[] array,
    Range range) 
    Support the range subscript operator for an Array
 public static List<T> getAt(T[] array,
    IntRange range) 
 public static List<T> getAt(T[] array,
    EmptyRange range) 
 public static List<T> getAt(T[] array,
    ObjectRange range) 
 public static T getAt(List<T> self,
    int idx) 
    Support the subscript operator for a List.
 public static int getAt(Date self,
    int field) 
    Support the subscript operator for a Date.
 public static V getAt(Map<K, V> self,
    K key) 
    Support the subscript operator for a Map.
 public static List getAt(Collection coll,
    String property) 
    Support the subscript operator for List
 public static List<Byte> getAt(byte[] array,
    Range range) 
    Support the subscript operator with a range for a byte array
 public static List<Character> getAt(char[] array,
    Range range) 
    Support the subscript operator with a range for a char array
 public static List<Short> getAt(short[] array,
    Range range) 
    Support the subscript operator with a range for a short array
 public static List<Integer> getAt(int[] array,
    Range range) 
    Support the subscript operator with a range for an int array
 public static List<Long> getAt(long[] array,
    Range range) 
    Support the subscript operator with a range for a long array
 public static List<Float> getAt(float[] array,
    Range range) 
    Support the subscript operator with a range for a float array
 public static List<Double> getAt(double[] array,
    Range range) 
    Support the subscript operator with a range for a double array
 public static List<Boolean> getAt(boolean[] array,
    Range range) 
    Support the subscript operator with a range for a boolean array
 public static List<Byte> getAt(byte[] array,
    IntRange range) 
    Support the subscript operator with an IntRange for a byte array
 public static List<Character> getAt(char[] array,
    IntRange range) 
    Support the subscript operator with an IntRange for a char array
 public static List<Short> getAt(short[] array,
    IntRange range) 
    Support the subscript operator with an IntRange for a short array
 public static List<Integer> getAt(int[] array,
    IntRange range) 
    Support the subscript operator with an IntRange for an int array
 public static List<Long> getAt(long[] array,
    IntRange range) 
    Support the subscript operator with an IntRange for a long array
 public static List<Float> getAt(float[] array,
    IntRange range) 
    Support the subscript operator with an IntRange for a float array
 public static List<Double> getAt(double[] array,
    IntRange range) 
    Support the subscript operator with an IntRange for a double array
 public static List<Boolean> getAt(boolean[] array,
    IntRange range) 
    Support the subscript operator with an IntRange for a boolean array
 public static List<Byte> getAt(byte[] array,
    ObjectRange range) 
    Support the subscript operator with an ObjectRange for a byte array
 public static List<Character> getAt(char[] array,
    ObjectRange range) 
    Support the subscript operator with an ObjectRange for a char array
 public static List<Short> getAt(short[] array,
    ObjectRange range) 
    Support the subscript operator with an ObjectRange for a short array
 public static List<Integer> getAt(int[] array,
    ObjectRange range) 
    Support the subscript operator with an ObjectRange for an int array
 public static List<Long> getAt(long[] array,
    ObjectRange range) 
    Support the subscript operator with an ObjectRange for a long array
 public static List<Float> getAt(float[] array,
    ObjectRange range) 
    Support the subscript operator with an ObjectRange for a float array
 public static List<Double> getAt(double[] array,
    ObjectRange range) 
    Support the subscript operator with an ObjectRange for a double array
 public static List<Boolean> getAt(boolean[] array,
    ObjectRange range) 
    Support the subscript operator with an ObjectRange for a byte array
 public static List<Byte> getAt(byte[] array,
    Collection indices) 
    Support the subscript operator with a collection for a byte array
 public static List<Character> getAt(char[] array,
    Collection indices) 
    Support the subscript operator with a collection for a char array
 public static List<Short> getAt(short[] array,
    Collection indices) 
    Support the subscript operator with a collection for a short array
 public static List<Integer> getAt(int[] array,
    Collection indices) 
    Support the subscript operator with a collection for an int array
 public static List<Long> getAt(long[] array,
    Collection indices) 
    Support the subscript operator with a collection for a long array
 public static List<Float> getAt(float[] array,
    Collection indices) 
    Support the subscript operator with a collection for a float array
 public static List<Double> getAt(double[] array,
    Collection indices) 
    Support the subscript operator with a collection for a double array
 public static List<Boolean> getAt(boolean[] array,
    Collection indices) 
    Support the subscript operator with a collection for a boolean array
 public static boolean getAt(BitSet self,
    int index) 
    Support the subscript operator for a Bitset
 public static BitSet getAt(BitSet self,
    IntRange range) 
    Support retrieving a subset of a BitSet using a Range
 public static char[] getChars(String self) 
    Converts the given String into an array of characters. Alias for toCharArray.
 public static int getCount(Matcher matcher) 
    Find the number of Strings matched to the given Matcher.
 public 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. For an "en_UK" system locale, this would be dd/MM/yy.

    Note that a new DateFormat instance is created for every invocation of this method (for thread safety).

 public 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 . This method uses the DateFormat#SHORT preset for the day portion and DateFormat#MEDIUM for the time portion of the output string.

    Note that a new DateFormat instance is created for every invocation of this method (for thread safety).

 public 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.
 public 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.
 public static MetaClass getMetaClass(Class c) 
    Adds a "metaClass" property to all class objects so you can use the syntax String.metaClass.myMethod = { println "foo" }
 public 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.
 public 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.
 public static List<PropertyValue> 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'.
 public 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.
 public 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.
 public static ClassLoader getRootLoader(ClassLoader self) 
    Iterates through the classloader parents until it finds a loader with a class named "org.codehaus.groovy.tools.RootLoader". If there is no such class null will be returned. The name is used for comparison because a direct comparison using == may fail as the class may be loaded through different classloaders.
 protected static List getSubList(List self,
    List splice) 
 public static String getText(File file) throws IOException 
    Read the content of the File and returns it as a String.
 public static String getText(URL url) throws IOException 
    Read the content of this URL and returns it as a String.
 public static String getText(InputStream is) throws IOException 
    Read the content of this InputStream and return it as a String. The stream is closed before this method returns.
 public static String getText(Reader reader) throws IOException 
    Read the content of the Reader and return it as a String. The reader is closed before this method returns.
 public static String getText(BufferedReader reader) throws IOException 
    Read the content of the BufferedReader and return it as a String. The BufferedReader is closed afterwards.
 public static String getText(Process self) throws IOException 
    Read the text of the output stream of the Process.
 public static String getText(File file,
    String charset) throws IOException 
    Read the content of the File using the specified encoding and return it as a String.
 public static String getText(URL url,
    String charset) throws IOException 
    Read the data from this URL and return it as a String. The connection stream is closed before this method returns.
 public static String getText(InputStream is,
    String charset) throws IOException 
    Read the content of this InputStream using specified charset and return it as a String. The stream is closed before this method returns.
 public 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. For an "en_UK" system locale, this would be HH:MM:ss.

    Note that a new DateFormat instance is created for every invocation of this method (for thread safety).

 public 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. This method can be used with different kinds of filters like regular expressions, classes, ranges etc. Example:
    def list = ['a', 'b', 'aa', 'bc' ]
    def filtered = list.grep( ~/a+/ ) //contains 'a' and 'aa'
    
 protected static  void groupAnswer(Map<T> answer,
    T element,
    Object value) 
    Groups the current element according to the value
 public static Map<T> groupBy(Collection<T> self,
    Closure closure) 
    Sorts all collection members into groups determined by the supplied mapping closure. The closure should return the key that this item should be grouped by. The returned LinkedHashMap will have an entry for each distinct key returned from the closure, with each value being a list of items for that group.
 public static Map<K, V> groupBy(Map<K, V> self,
    Closure closure) 
    Groups the members of a map into sub maps determined by the supplied mapping closure. The closure will be passed a Map.Entry or key and value (depending on the number of parameters the closure accepts) and should return the key that each item should be grouped under. The resulting map will have an entry for each 'group' key returned by the closure, with values being the map members from the original map that belong to each group.

    If the self map is one of TreeMap, LinkedHashMap, Hashtable or Properties, the returned Map will preserve that type, otherwise a HashMap will be returned.

 public static Map<K, V> groupEntriesBy(Map<K, V> self,
    Closure closure) 
    Groups all map entries into groups determined by the supplied mapping closure. The closure will be passed a Map.Entry or key and value (depending on the number of parameters the closure accepts) and should return the key that each item should be grouped under. The resulting map will have an entry for each 'group' key returned by the closure, with values being the list of map entries that belong to each group.
 public static boolean hasGroup(Matcher matcher) 
    Check whether a Matcher contains a group or not.
 public static MetaProperty hasProperty(Object self,
    String name) 

    Returns true of the implementing MetaClass has a property of the given name

    Note that this method will only return true for realised properties and does not take into account implementation of getProperty or propertyMissing

 public static T head(List<T> self) 
    Returns the first item from the List.
 public static Object identity(Object self,
    Closure closure) 
    Allows the closure to be called for the object reference self synonym for 'with()'.
 public 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.
 public 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.
 public 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.
 public 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.
 public static String inspect(Object self) 
    Inspects returns the String that matches what would be typed into a terminal to create this object.
 public static Number intdiv(Character left,
    Number right) 
    Integer Divide a Character by a Number. The ordinal value of the Character is used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Number intdiv(Number left,
    Character right) 
    Integer Divide a Number by a Character. The ordinal value of the Character is used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Number intdiv(Character left,
    Character right) 
    Integer Divide two Characters. The ordinal values of the Characters are used in the division (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Number intdiv(Number left,
    Number right) 
    Integer Divide two Numbers.
 public static Collection<T> intersect(Collection<T> left,
    Collection<T> right) 
    Create a Collection composed of the intersection of both collections. Any elements that exist in both collections are added to the resultant collection.
 public 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.
 public static boolean is(Object self,
    Object other) 
    Identity check. Since == is overridden in Groovy with the meaning of equality we need some fallback to check for object identity. Invoke using the 'is' operator, like so: def same = (this is that)
 public static boolean isBigDecimal(String self) 
    Determine if a String can be parsed into a BigDecimal.
 public static boolean isBigInteger(String self) 
    Determine if a String can be parsed into a BigInteger.
 public static boolean isCase(Object caseValue,
    Object switchValue) 
    Method for overloading the behavior of the 'case' method in switch statements. The default implementation handles arrays types but otherwise simply delegates to Object#equals, but this may be overridden for other types. In this example:
     switch( a ) {
      case b: //some code
    }
    "some code" is called when b.isCase( a ) returns true.
 public 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. For example:
    switch( str ) {
      case 'one' :
      // etc...
    }
    Note that this returns true for the case where both the 'switch' and 'case' operand is null.
 public static boolean isCase(GString caseValue,
    Object switchValue) 
    'Case' implementation for a GString, which simply calls the equivalet method for String.
 public static boolean isCase(Class caseValue,
    Object switchValue) 
    Special 'Case' implementation for Class, which allows testing for a certain class in a switch statement. For example:
    switch( obj ) {
      case List :
        // obj is a list
        break;
      case Set :
        // etc
    }
 public 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. For example:
    switch( item ) {
      case firstList :
        // item is contained in this list
        // etc
    }
 public static boolean isCase(Pattern caseValue,
    Object switchValue) 
    'Case' implementation for the Pattern class, which allows testing a String against a number of regular expressions. For example:
    switch( str ) {
      case ~/one/ :
        // the regex 'one' matches the value of str
    }
    
    Note that this returns true for the case where both the pattern and the 'switch' values are null.
 public 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.
 public static boolean isDigit(Character self) 
    Determines if a character is a digit. Synonym for 'Character.isDigit(this)'.
 public static boolean isDouble(String self) 
    Determine if a String can be parsed into a Double.
 public static boolean isFloat(String self) 
    Determine if a String can be parsed into a Float.
 public static boolean isInteger(String self) 
    Determine if a String can be parsed into an Integer.
 public static boolean isLetter(Character self) 
    Determines if a character is a letter. Synonym for 'Character.isLetter(this)'.
 public static boolean isLetterOrDigit(Character self) 
    Determines if a character is a letter or digit. Synonym for 'Character.isLetterOrDigit(this)'.
 public static boolean isLong(String self) 
    Determine if a String can be parsed into a Long.
 public static boolean isLowerCase(Character self) 
    Determine if a Character is lowercase. Synonym for 'Character.isLowerCase(this)'.
 public static boolean isNumber(String self) 
    Determine if a String can be parsed into a Number. Synonym for 'isBigDecimal()'.
 public static boolean isUpperCase(Character self) 
    Determine if a Character is uppercase. Synonym for 'Character.isUpperCase(this)'.
 public static boolean isWhitespace(Character self) 
    Determines if a character is a whitespace character. Synonym for 'Character.isWhitespace(this)'.
 public static Iterator<T> iterator(T[] a) 
    Attempts to create an Iterator for the given object by first converting it to a Collection.
 public static Iterator iterator(Object o) 
    Attempts to create an Iterator for the given object by first converting it to a Collection.
 public static Iterator<T> iterator(Enumeration<T> enumeration) 
    Allows an Enumeration to behave like an Iterator. Note that the remove() method is unsupported since the underlying Enumeration does not provide a mechanism for removing items.
 public static Iterator<Node> iterator(NodeList nodeList) 
Deprecated! moved - to org.codehaus.groovy.runtime.XmlGroovyMethods

    Makes org.w3c.dom.NodeList iterable by returning a read-only Iterator which traverses over each Node.
 public static Iterator iterator(Matcher matcher) 
    Returns an Iterator which traverses each match.
 public static Iterator<String> iterator(Reader self) 
    Creates an iterator which will traverse through the reader a line at a time.
 public static Iterator<Byte> iterator(InputStream self) 
    Standard iterator for a input stream which iterates through the stream content in a byte-based fashion.
 public static Iterator<Byte> iterator(DataInputStream self) 
    Standard iterator for a data input stream which iterates through the stream content a Byte at a time.
 public static Iterator iterator(File self) throws IOException 
Deprecated! use - File#eachLine instead please

    Just throws a DeprecationException. DO NOT USE. It used to provide an iterator for text file content one line at a time.
 public static Iterator<T> iterator(Iterator<T> 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.
 public 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. The iterator will become exhausted of elements after determining the resulting conjoined value.
 public 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.
 public 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.
 public static T last(List<T> self) 
    Returns the last item from the List.
 public static Collection<T> leftShift(Collection<T> self,
    T value) 
    Overloads the left shift operator to provide an easy way to append objects to a Collection.
 public static Map<K, V> leftShift(Map<K, V> self,
    Entry<K, V> entry) 
    Overloads the left shift operator to provide an easy way to append Map.Entry values to a Map.
 public 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.
 public 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.
 public static Writer leftShift(Writer self,
    Object value) throws IOException 
    Overloads the left shift operator to provide a mechanism to append values to a writer.
 public static Number leftShift(Number self,
    Number operand) 
    Implementation of the left shift operator for integral types. Non integral Number types throw UnsupportedOperationException.
 public static Writer leftShift(OutputStream self,
    Object value) throws IOException 
    Overloads the leftShift operator to provide an append mechanism to add values to a stream.
 public static  void leftShift(ObjectOutputStream self,
    Object value) throws IOException 
    Overloads the leftShift operator to add objects to an ObjectOutputStream.
 public static OutputStream leftShift(OutputStream self,
    InputStream in) throws IOException 
    Pipe an InputStream into an OutputStream for efficient stream copying.
 public static OutputStream leftShift(OutputStream self,
    byte[] value) throws IOException 
    Overloads the leftShift operator to provide an append mechanism to add bytes to a stream.
 public static File leftShift(File file,
    Object text) throws IOException 
    Write the text to the File.
 public static File leftShift(File file,
    byte[] bytes) throws IOException 
    Write bytes to a File.
 public static File leftShift(File file,
    InputStream data) throws IOException 
 public static Writer leftShift(Socket self,
    Object value) throws IOException 
    Overloads the left shift operator to provide an append mechanism to add things to the output stream of a socket
 public static OutputStream leftShift(Socket self,
    byte[] value) throws IOException 
    Overloads the left shift operator to provide an append mechanism to add bytes to the output stream of a socket
 public static Writer leftShift(Process self,
    Object value) throws IOException 
    Overloads the left shift operator (<<) to provide an append mechanism to pipe data to a Process.
 public static OutputStream leftShift(Process self,
    byte[] value) throws IOException 
    Overloads the left shift operator to provide an append mechanism to pipe into a Process
 public static boolean matches(String self,
    Pattern pattern) 
    Tells whether or not self matches the given compiled regular expression Pattern.
 public static T max(Collection<T> self) 
    Adds max() method to Collection objects.
 public static T max(Iterator<T> self) 
    Adds max() method to Iterator objects. The iterator will become exhausted of elements after determining the maximum value.
 public static T max(T[] self) 
    Adds max() method to Object arrays.
 public static T max(Collection<T> self,
    Closure closure) 
    Selects the maximum value found in the collection using the closure to determine the correct ordering.

    If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.
 public static T max(Iterator<T> self,
    Closure closure) 
    Selects the maximum value found from the Iterator using the closure to determine the correct ordering. The iterator will become exhausted of elements after this operation.

    If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.
 public static T max(T[] self,
    Closure closure) 
    Selects the maximum value found from the Object array using the closure to determine the correct ordering.

    If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.
 public static T max(Collection<T> self,
    Comparator<T> comparator) 
    Selects the maximum value found in the collection using the given comparator.
 public static T max(Iterator<T> self,
    Comparator<T> comparator) 
    Selects the maximum value found from the Iterator using the given comparator.
 public static T max(T[] self,
    Comparator<T> comparator) 
    Selects the maximum value found from the Object array using the given comparator.
 public static MetaClass metaClass(Class self,
    Closure closure) 
    Sets/updates the metaclass for a given class to a closure.
 public static MetaClass metaClass(Object self,
    Closure closure) 
    Sets/updates the metaclass for a given object to a closure.
 public static T min(Collection<T> self) 
    Adds min() method to Collection objects.
 public static T min(Iterator<T> self) 
    Adds min() method to Iterator objects. The iterator will become exhausted of elements after determining the minimum value.
 public static T min(T[] self) 
    Adds min() method to Object arrays.
 public static T min(Collection<T> self,
    Comparator<T> comparator) 
    Selects the minimum value found in the collection using the given comparator.
 public static T min(Iterator<T> self,
    Comparator<T> comparator) 
    Selects the minimum value found from the Iterator using the given comparator.
 public static T min(T[] self,
    Comparator<T> comparator) 
    Selects the minimum value found from the Object array using the given comparator.
 public static T min(Collection<T> self,
    Closure closure) 
    Selects the minimum value found in the collection using the closure to determine the correct ordering.

    If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.
 public static T min(Iterator<T> self,
    Closure closure) 
    Selects the minimum value found from the Iterator using the closure to determine the correct ordering. The iterator will become exhausted of elements after this operation.

    If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.
 public static T min(T[] self,
    Closure closure) 
    Selects the minimum value found from the Object array using the closure to determine the correct ordering.

    If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.
 public static Set<T> minus(Set<T> self,
    Collection operands) 
    Create a Set composed of the elements of the first set minus the elements of the given collection.

    TODO: remove using number comparator?

 public static Set<T> minus(Set<T> self,
    Object operand) 
    Create a Set composed of the elements of the first set minus the operand.
 public static T[] minus(T[] self,
    Collection<T> removeMe) 
    Create an array composed of the elements of the first array minus the elements of the given collection.
 public static T[] minus(T[] self,
    T[] removeMe) 
    Create an array composed of the elements of the first array minus the elements of the given array.
 public static List<T> minus(List<T> self,
    Collection<T> removeMe) 
    Create a List composed of the elements of the first list minus the elements of the given collection.
 public static List<T> minus(List<T> self,
    Object operand) 
    Create a new List composed of the elements of the first list minus the operand.
 public static T[] minus(T[] self,
    Object operand) 
    Create a new object array composed of the elements of the first array minus the operand.
 public static String minus(String self,
    Object target) 
    Remove a part of a String. This replaces the first occurrence of target within self with '' and returns the result. If target is a regex Pattern, the first occurrence of that pattern will be removed (using regex matching), otherwise the first occurrence of target.toString() will be removed.
 public static Number minus(Character left,
    Number right) 
    Subtract a Number from a Character. The ordinal value of the Character is used in the subtraction (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Number minus(Number left,
    Character right) 
    Subtract a Character from a Number. The ordinal value of the Character is used in the subtraction (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Number minus(Character left,
    Character right) 
    Subtract one Character from another. The ordinal values of the Characters is used in the comparison (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Date minus(Date self,
    int days) 
    Subtract a number of days from this date and returns the new date.
 public static Date minus(Date self,
    int days) 
    Subtract a number of days from this date and returns the new date.
 public static int minus(Calendar self,
    Calendar then) 
    Subtract another date from this one and return the number of days of the difference. Date self = Date then + (Date self - Date then) IOW, if self is before then the result is a negative value.
 public static int minus(Date self,
    Date then) 
    Subtract another Date from this one and return the number of days of the difference. Date self = Date then + (Date self - Date then) IOW, if self is before then the result is a negative value.
 public static  void mixin(MetaClass self,
    List<Class> categoryClasses) 
    Extend object with category methods. All methods for given class and all super classes will be added to the object.
 public static  void mixin(Class self,
    List<Class> categoryClasses) 
    Extend class globally with category methods. All methods for given class and all super classes will be added to the class.
 public static  void mixin(Class self,
    Class categoryClass) 
    Extend class globally with category methods.
 public static  void mixin(Class self,
    Class[] categoryClass) 
    Extend class globally with category methods.
 public static  void mixin(MetaClass self,
    Class categoryClass) 
    Extend class globally with category methods.
 public static  void mixin(MetaClass self,
    Class[] categoryClass) 
    Extend class globally with category methods.
 public static Number mod(Number left,
    Number right) 
    Performs a division modulus operation. Called by the '%' operator.
 public static List<T> multiply(Collection<T> self,
    Number factor) 
    Create a List composed of the elements of this list, repeated a certain number of times. Note that for non-primitive elements, multiple references to the same instance will be added.
 public static String multiply(String self,
    Number factor) 
    Repeat a String a certain number of times.
 public static Number multiply(Character left,
    Number right) 
    Multiply a Character by a Number. The ordinal value of the Character is used in the multiplcation (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Number multiply(Number left,
    Character right) 
    Multiply a Number by a Character. The ordinal value of the Character is used in the multiplication (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Number multiply(Character left,
    Character right) 
    Multiply two Characters. The ordinal values of the Characters are used in the multiplication (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Number multiply(BigDecimal left,
    Double right) 
    Multiply a BigDecimal and a Double. Note: This method was added to enforce the Groovy rule of BigDecimal*Double == Double. Without this method, the multiply(BigDecimal) method in BigDecimal would respond and return a BigDecimal instead. Since BigDecimal is preferred over Number, the Number*Number method is not chosen as in older versions of Groovy.
 public static Number multiply(BigDecimal left,
    BigInteger right) 
    Multiply a BigDecimal and a BigInteger. Note: This method was added to enforce the Groovy rule of BigDecimal*long == long. Without this method, the multiply(BigDecimal) method in BigDecimal would respond and return a BigDecimal instead. Since BigDecimal is preferred over Number, the Number*Number method is not chosen as in older versions of Groovy. BigInteger is the fallback for all integer types in Groovy
 public static DataInputStream newDataInputStream(File file) throws FileNotFoundException 
    Create a data input stream for this file
 public static DataOutputStream newDataOutputStream(File file) throws IOException 
    Creates a new data output stream for this file.
 public static BufferedInputStream newInputStream(File file) throws FileNotFoundException 
    Creates a buffered input stream for this file.
 public static BufferedInputStream newInputStream(URL url) throws MalformedURLException, IOException 
    Creates a buffered input stream for this URL.
 public static Object newInstance(Class c) 
    Convenience method to dynamically create a new instance of this class. Calls the default constructor.
 public static Object newInstance(Class c,
    Object[] args) 
    Helper to construct a new instance from the given arguments. The constructor is called based on the number and types in the args array. Use newInstance(null) or simply newInstance() for the default (no-arg) constructor.
 public static ObjectInputStream newObjectInputStream(File file) throws IOException 
    Create an object input stream for this file.
 public static ObjectInputStream newObjectInputStream(InputStream inputStream) throws IOException 
    Create an object input stream for this input stream.
 public static ObjectInputStream newObjectInputStream(InputStream inputStream,
    ClassLoader classLoader) throws IOException 
    Create an object input stream for this input stream using the given class loader.
 public static ObjectInputStream newObjectInputStream(File file,
    ClassLoader classLoader) throws IOException 
    Create an object input stream for this file using the given class loader.
 public static ObjectOutputStream newObjectOutputStream(File file) throws IOException 
    Create an object output stream for this file.
 public static ObjectOutputStream newObjectOutputStream(OutputStream outputStream) throws IOException 
    Create an object output stream for this output stream.
 public static BufferedOutputStream newOutputStream(File file) throws IOException 
    Create a buffered output stream for this file.
 public static PrintWriter newPrintWriter(File file) throws IOException 
    Create a new PrintWriter for this file.
 public static PrintWriter newPrintWriter(Writer writer) 
    Create a new PrintWriter for this file, using specified charset.
 public static PrintWriter newPrintWriter(File file,
    String charset) throws IOException 
    Create a new PrintWriter for this file, using specified charset.
 public static BufferedReader newReader(File file) throws IOException 
    Create a buffered reader for this file.
 public static BufferedReader newReader(InputStream self) 
    Creates a reader for this input stream.
 public static BufferedReader newReader(URL url) throws MalformedURLException, IOException 
    Creates a buffered reader for this URL.
 public static BufferedReader newReader(File file,
    String charset) throws FileNotFoundException, UnsupportedEncodingException 
    Create a buffered reader for this file, using the specified charset as the encoding.
 public static BufferedReader newReader(InputStream self,
    String charset) throws UnsupportedEncodingException 
    Creates a reader for this input stream, using the specified charset as the encoding.
 public static BufferedReader newReader(URL url,
    String charset) throws MalformedURLException, IOException 
    Creates a buffered reader for this URL using the given encoding.
 public static BufferedWriter newWriter(File file) throws IOException 
    Create a buffered writer for this file.
 public static BufferedWriter newWriter(File file,
    boolean append) throws IOException 
    Creates a buffered writer for this file, optionally appending to the existing file content.
 public static BufferedWriter newWriter(File file,
    String charset) throws IOException 
    Creates a buffered writer for this file, writing data using the given encoding.
 public static BufferedWriter newWriter(File file,
    String charset,
    boolean append) throws IOException 
    Helper method to create a buffered writer for a file. If the given charset is "UTF-16BE" or "UTF-16LE", the requisite byte order mark is written to the stream before the writer is returned.
 public static String next(String self) 
    This method is called by the ++ operator for the class String. It increments the last character in the given string. If the character in the string is Character.MAX_VALUE a Character.MIN_VALUE will be appended. The empty string is incremented to a string consisting of the character Character.MIN_VALUE.
 public static Character next(Character self) 
    Increment a Character by one.
 public static Number next(Number self) 
    Increment a Number by one.
 public static Date next(Date self) 
    Increment a Date by one day.
 public static Date next(Date self) 
    Increment a java.sql.Date by one day.
 public static String normalize(String self) 
    Return a String with linefeeds and carriage returns normalized to linefeeds.
 public static int numberAwareCompareTo(Comparable self,
    Comparable other) 
    Provides a method that compares two comparables using Groovy's default number aware comparator.
 public static Number or(Number left,
    Number right) 
    Bitwise OR together two numbers.
 public static BitSet or(BitSet left,
    BitSet right) 
    Bitwise OR together two BitSets. Called when the '|' operator is used between two bit sets.
 public static Boolean or(Boolean left,
    Boolean right) 
    Logical disjunction of two boolean operators
 public static Process or(Process left,
    Process right) throws IOException 
    Overrides the or operator to allow one Process to asynchronously pipe data to another Process.
 public static String padLeft(String self,
    Number numberOfChars) 
    Pad a String with the spaces appended to the left
 public static String padLeft(String self,
    Number numberOfChars,
    String padding) 
    Pad a String with the characters appended to the left
 public static String padRight(String self,
    Number numberOfChars) 
    Pad a String with the spaces appended to the right
 public static String padRight(String self,
    Number numberOfChars,
    String padding) 
    Pad a String with the characters appended to the right
 public static Set<T> permutations(List<T> self) 
    Finds all permutations of a collection. E.g. [1, 2, 3].permutations() would be: [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
 public static Process pipeTo(Process left,
    Process right) throws IOException 
    Allows one Process to asynchronously pipe data to another Process.
 public static Map<K, V> plus(Map<K, V> left,
    Map<K, V> right) 
    Returns a new Map containing all entries from left and right, giving precedence to right. Any keys appearing in both Maps will appear in the resultant map with values from the right operand. If the left map is one of TreeMap, LinkedHashMap, Hashtable or Properties, the returned Map will preserve that type, otherwise a HashMap will be returned.

    Roughly equivalent to Map m = new HashMap(); m.putAll(left); m.putAll(right); return m; but with some additional logic to preserve the left Map type for common cases as described above.

 public static Map<K, V> plus(Map<K, V> self,
    Collection<K, V> entries) 
    Returns a new Map containing all entries from self and entries, giving precedence to entries. Any keys appearing in both Maps will appear in the resultant map with values from the entries operand. If self map is one of TreeMap, LinkedHashMap, Hashtable or Properties, the returned Map will preserve that type, otherwise a HashMap will be returned.

 public static Collection<T> plus(Collection<T> left,
    Collection<T> right) 
    Create a Collection as a union of two collections. If the left collection is a Set, then the returned collection will be a Set otherwise a List. This operation will always create a new object for the result, while the operands remain unchanged.
 public static Collection<T> plus(Collection<T> left,
    T right) 
    Create a collection as a union of a Collection and an Object. If the collection is a Set, then the returned collection will be a Set otherwise a List. This operation will always create a new object for the result, while the operands remain unchanged.
 public static String plus(String left,
    Object value) 
    Appends the String representation of the given operand to this string.
 public static String plus(Number value,
    String right) 
    Appends a String to the string representation of this number.
 public static String plus(StringBuffer left,
    String value) 
    Appends a String to this StringBuffer.
 public static Number plus(Character left,
    Number right) 
    Add a Character and a Number. The ordinal value of the Character is used in the addition (the ordinal value is the unicode value which for simple character sets is the ASCII value). This operation will always create a new object for the result, while the operands remain unchanged.
 public static Number plus(Number left,
    Character right) 
    Add a Number and a Character. The ordinal value of the Character is used in the addition (the ordinal value is the unicode value which for simple character sets is the ASCII value).
 public static Number plus(Character left,
    Character right) 
    Add one Character to another. The ordinal values of the Characters are used in the addition (the ordinal value is the unicode value which for simple character sets is the ASCII value). This operation will always create a new object for the result, while the operands remain unchanged.
 public static Date plus(Date self,
    int days) 
    Add a number of days to this date and returns the new date.
 public static Date plus(Date self,
    int days) 
    Add a number of days to this date and returns the new date.
 public static T pop(List<T> self) 
    Removes the last item from the List. Using add() and pop() is similar to push and pop on a Stack.
 public static Number power(Number self,
    Number exponent) 
    Power of a Number to a certain exponent. Called by the '**' operator.
 public static String previous(String self) 
    This method is called by the -- operator for the class String. It decrements the last character in the given string. If the character in the string is Character.MIN_VALUE it will be deleted. The empty string can't be decremented.
 public static Character previous(Character self) 
    Decrement a Character by one.
 public static Number previous(Number self) 
    Decrement a Number by one.
 public static Date previous(Date self) 
    Decrement a Date by one day.
 public static Date previous(Date self) 
    Decrement a java.sql.Date by one day.
 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 List primitiveArrayGet(Object self,
    Collection indices) 
    Implements the getAt(Collection) method for primitve type arrays. Each value in the collection argument is assumed to be a valid array index. The value at each index is then added to a list which is returned.
 protected static Object primitiveArrayPut(Object self,
    int idx,
    Object newValue) 
    Implements the setAt(int idx) method for primitve type arrays.
 public 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.
 public static  void print(PrintWriter self,
    Object value) 
    Print a value formatted Groovy style to the print writer.
 public static  void print(PrintStream self,
    Object value) 
    Print a value formatted Groovy style to the print stream.
 public static  void print(Closure self,
    Object value) 
    Print a value to the standard output stream. This method delegates to the owner to execute the method.
 public static  void print(Object self,
    PrintWriter out) 
    Print to a console in interactive format.
 public static  void printf(Object self,
    String format,
    Object[] values) 
    Printf to a console (Only works with JDK1.5 or later).
 public static  void printf(Object self,
    String format,
    Object arg) 
    Prints a formatted string using the specified format string and arguments.

    For examples,

        printf ( "Hello, %s!\n" , [ "world" ] as String[] )
        printf ( "Hello, %s!\n" , [ "Groovy" ])
        printf ( "%d + %d = %d\n" , [ 1 , 2 , 1+2 ] as Integer[] )
        printf ( "%d + %d = %d\n" , [ 3 , 3 , 3+3 ])
    

    ( 1..5 ).each { printf ( "-- %d\n" , [ it ] as Integer[] ) } ( 1..5 ).each { printf ( "-- %d\n" , [ it ] as int[] ) } ( 0x41..0x45 ).each { printf ( "-- %c\n" , [ it ] as char[] ) } ( 07..011 ).each { printf ( "-- %d\n" , [ it ] as byte[] ) } ( 7..11 ).each { printf ( "-- %d\n" , [ it ] as short[] ) } ( 7..11 ).each { printf ( "-- %d\n" , [ it ] as long[] ) } ( 7..11 ).each { printf ( "-- %5.2f\n" , [ it ] as float[] ) } ( 7..11 ).each { printf ( "-- %5.2g\n" , [ it ] as double[] ) }

 public static  void println(Object self) 
    Print a linebreak to the standard output stream.
 public static  void println(Closure self) 
    Print a linebreak to the standard output stream. This method delegates to the owner to execute the method.
 public 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.
 public static  void println(PrintWriter self,
    Object value) 
    Print a value formatted Groovy style (followed by a newline) to the print writer.
 public static  void println(PrintStream self,
    Object value) 
    Print a value formatted Groovy style (followed by a newline) to the print stream.
 public static  void println(Closure self,
    Object value) 
    Print a value (followed by a newline) to the standard output stream. This method delegates to the owner to execute the method.
 public static  void println(Object self,
    PrintWriter out) 
    Print to a console in interactive format.
 public static boolean push(List<T> self,
    T value) 
    Appends an item to the List. Synonym for add().
 public static Map<K, V> putAll(Map<K, V> self,
    Collection<K, V> entries) 
    Provides an easy way to append multiple Map.Entry values to a Map.
 public static  void putAt(Object self,
    String property,
    Object newValue) 
    Allows the subscript operator to be used to set dynamically named property values. bean[somePropertyNameExpression] = foo. The normal property notation of groovy is neater and more concise but only works with property names which are known at compile time.
 public static  void putAt(List<T> self,
    int idx,
    T value) 
    A helper method to allow lists to work with subscript operators.
 public static  void putAt(StringBuffer self,
    IntRange range,
    Object value) 
    Support the range subscript operator for StringBuffer. Index values are treated as characters within the buffer.
 public static  void putAt(StringBuffer self,
    EmptyRange range,
    Object value) 
    Support the range subscript operator for StringBuffer.
 public static  void putAt(List self,
    EmptyRange range,
    Object value) 
    A helper method to allow lists to work with subscript operators.
 public static  void putAt(List self,
    EmptyRange range,
    Collection value) 
    A helper method to allow lists to work with subscript operators.
 public 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. Example: myList[3..5] = anotherList. Items in the given range are relaced with items from the collection.
 public static  void putAt(List self,
    IntRange range,
    Object value) 
    List subscript assignment operator when given a range as the index. Example: myList[3..5] = newItem. Items in the given range are relaced with the operand. The value operand is always treated as a single value.
 public static  void putAt(List self,
    List splice,
    List values) 
    A helper method to allow lists to work with subscript operators.
 public static  void putAt(List self,
    List splice,
    Object value) 
    A helper method to allow lists to work with subscript operators.
 public static V putAt(Map<K, V> self,
    K key,
    V value) 
    A helper method to allow lists to work with subscript operators
 public static  void putAt(BitSet self,
    IntRange range,
    boolean value) 
    Support assigning a range of values with a single assignment statement.
 public static  void putAt(BitSet self,
    int index,
    boolean value) 
    Support subscript-style assignment for a BitSet.
 public static byte[] readBytes(File file) throws IOException 
    Reads the content of the file into a byte array.
 public static String readLine(Reader self) throws IOException 
    Read a single, whole line from the given Reader.
 public static String readLine(InputStream stream) throws IOException 
Deprecated! use - Reader#readLine instead please

    Just throws a DeprecationException. DO NOT USE. It used to read a single, whole line from the given InputStream.
 public static List<String> readLines(String self) throws IOException 
    Return the lines of a String as a List of Strings.
 public static List readLines(File file) throws IOException 
    Reads the file into a list of Strings, with one item for each line.
 public static List<String> readLines(Reader reader) throws IOException 
    Reads the reader into a list of Strings, with one entry for each line. The reader is closed before this method returns.
 public static List readLines(InputStream stream) throws IOException 
    Reads the stream into a list, with one element for each line.
 public static String replaceAll(String self,
    Pattern pattern,
    String replacement) 
    Replaces all substrings of a String that match the given compiled regular expression with the given replacement.

    Note that backslashes (\) and dollar signs ($) in the replacement string may cause the results to be different than if it were being treated as a literal replacement string; see java.util.regex.Matcher#replaceAll . Use java.util.regex.Matcher#quoteReplacement to suppress the special meaning of these characters, if desired.

 public static String replaceAll(String self,
    String regex,
    Closure closure) 
    Replaces all occurrences of a captured group by the result of a closure on that text.

    For examples,

        assert "FOOBAR-FOOBAR-" == "foobar-FooBar-".replaceAll("(([fF][oO]{2})[bB]ar)", { Object[] it -> it[0].toUpperCase() })
    

    Here, it[0] is the global string of the matched group it[1] is the first string in the matched group it[2] is the second string in the matched group

    assert "FOO-FOO-" == "foobar-FooBar-".replaceAll("(([fF][oO]{2})[bB]ar)", { x, y, z -> z.toUpperCase() })

    Here, x is the global string of the matched group y is the first string in the matched group z is the second string in the matched group

    Note that unlike String.replaceAll(String regex, String replacement), where the replacement string treats '$' and '\' specially (for group substitution), the result of the closure is converted to a string and that value is used literally for the replacement.

 public static String replaceFirst(String self,
    Pattern pattern,
    String replacement) 
    Replaces the first substring of a String that matches the given compiled regular expression with the given replacement.

    Note that backslashes (\) and dollar signs ($) in the replacement string may cause the results to be different than if it were being treated as a literal replacement string; see java.util.regex.Matcher#replaceFirst . Use java.util.regex.Matcher#quoteReplacement to suppress the special meaning of these characters, if desired.

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

    Note that this method's return value is based on realised methods and does not take into account objects or classes that implement invokeMethod or methodMissing

    This method is "safe" in that it will always return a value and never throw an exception

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

    Note that this method's return value is based on realised methods and does not take into account objects or classes that implement invokeMethod or methodMissing

    This method is "safe" in that it will always return a value and never throw an exception

 public static T[] reverse(T[] self) 
    Reverse the items in an Object array.
 public static String reverse(String self) 
    Creates a new string which is the reverse (backwards) of this string
 public static List<T> reverse(List<T> self) 
    Reverses the list. The result is a new List with the identical contents in reverse order.
 public static Iterator<T> reverse(Iterator<T> self) 
    Reverses the iterator. The original iterator will become exhausted of elements after determining the reversed values. A new iterator for iterating through the reversed values is returned.
 public static List<T> reverseEach(List<T> self,
    Closure closure) 
    Iterate over each element of the list in the reverse order.
 public static T[] reverseEach(T[] self,
    Closure closure) 
    Iterate over each element of the array in the reverse order.
 public static Number rightShift(Number self,
    Number operand) 
    Implementation of the right shift operator for integral types. Non integral Number types throw UnsupportedOperationException.
 public static Number rightShiftUnsigned(Number self,
    Number operand) 
    Implementation of the right shift (unsigned) operator for integral types. Non integral Number types throw UnsupportedOperationException.
 public static int round(Float number) 
    Round the value
 public static long round(Double number) 
    Round the value
 public static float round(Float number,
    int precision) 
    Round the value
 public static double round(Double number,
    int precision) 
    Round the value
 public static TimerTask runAfter(Timer timer,
    int delay,
    Closure closure) 
    Allows a simple syntax for using timers. This timer will execute the given closure after the given delay.
 public static  void setIndex(Matcher matcher,
    int idx) 
    Set the position of the given Matcher to the given index.
 public static  void setMetaClass(Class self,
    MetaClass metaClass) 
    Sets the metaclass for a given class.
 public static  void setMetaClass(Object self,
    MetaClass metaClass) 
    Set the metaclass for an object
 public static  void setText(File file,
    String text) throws IOException 
    Synonym for write(text) allowing file.text = 'foo'.
 public static int size(Iterator self) 
    Provide the standard Groovy size() method for Iterator. The iterator will become exhausted of elements after determining the size value.
 public static int size(String text) 
    Provide the standard Groovy size() method for String.
 public static int size(StringBuffer buffer) 
    Provide the standard Groovy size() method for StringBuffer.
 public static long size(File self) 
    Provide the standard Groovy size() method for File.
 public static long size(Matcher self) 
    Provide the standard Groovy size() method for Matcher.
 public static int size(Object[] self) 
    Provide the standard Groovy size() method for an array.
 public static int size(boolean[] array) 
    Allows arrays to behave similar to collections.
 public static int size(byte[] array) 
    Allows arrays to behave similar to collections.
 public static int size(char[] array) 
    Allows arrays to behave similar to collections.
 public static int size(short[] array) 
    Allows arrays to behave similar to collections.
 public static int size(int[] array) 
    Allows arrays to behave similar to collections.
 public static int size(long[] array) 
    Allows arrays to behave similar to collections.
 public static int size(float[] array) 
    Allows arrays to behave similar to collections.
 public static int size(double[] array) 
    Allows arrays to behave similar to collections.
 public static List<T> sort(Collection<T> self) 
    Sorts the given collection into a sorted list. The collection items are assumed to be comparable.
 public static T[] sort(T[] self) 
    Sorts the given Object array into sorted order. The array items are assumed to be comparable.
 public static Iterator<T> sort(Iterator<T> self) 
    Sorts the given iterator items into a sorted iterator. The items are assumed to be comparable. The original iterator will become exhausted of elements after completing this method call. A new iterator is produced that traverses the items in sorted order.
 public static SortedSet<T> sort(SortedSet<T> self) 
    Avoids doing unnecessary work when sorting an already sorted set.
 public static Map<K, V> sort(Map<K, V> self,
    Closure closure) 
    Sorts the given map into a sorted map using the closure as a comparator.
 public static Iterator<T> sort(Iterator<T> self,
    Comparator<T> comparator) 
    Sorts the given iterator items into a sorted iterator using the comparator.
 public static List<T> sort(Collection<T> self,
    Comparator<T> comparator) 
    Sorts the Collection using the given comparator. The elements are sorted into a new list, and the existing collection is unchanged.
 public static T[] sort(T[] self,
    Comparator<T> comparator) 
    Sorts the given Object array into sorted order using the given comparator.
 public static Iterator<T> sort(Iterator<T> self,
    Closure closure) 
    Sorts the given iterator items into a sorted iterator using the Closure to determine the correct ordering. The original iterator will be fully processed after the method call.

    If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.
 public static T[] sort(T[] self,
    Closure closure) 
    Sorts the given Object array into a newly created array using the Closure to determine the correct ordering.

    If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.
 public static List<T> sort(Collection<T> self,
    Closure closure) 
    Sorts this Collection using the closure to determine the correct ordering.

    If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first parameter is less than, equal to, or greater than the second respectively. Otherwise, the Closure is assumed to take a single parameter and return a Comparable (typically an Integer) which is then used for further comparison.
 public 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
 public static String[] split(GString self) 
    Convenience method to split a GString (with whitespace as delimiter).
 public static Collection split(Object self,
    Closure closure) 
    Splits all items into two lists based on the closure condition. The first list contains all items matching the closure expression. The second list all those that don't.
 public static Collection<T> split(Collection<T> self,
    Closure closure) 
    Splits all items into two collections based on the closure condition. The first list contains all items which match the closure expression. The second list all those that don't.
 public static Object splitEachLine(File self,
    String regex,
    Closure closure) throws IOException 
    Iterates through this file line by line, splitting each line using the given regex separator. For each line, the given closure is called with a single parameter being the list of strings computed by splitting the line around matches of the given regular expression. Finally the resources used for processing the file are closed.
 public static Object splitEachLine(Reader self,
    String regex,
    Closure closure) throws IOException 
    Iterates through the given reader line by line, splitting each line using the given regex separator. For each line, the given closure is called with a single parameter being the list of strings computed by splitting the line around matches of the given regular expression. The Reader is closed afterwards.

    Here is an example:

    def s = 'The 3 quick\nbrown 4 fox'
    def result = ''
    new StringReader(s).splitEachLine(/\d/){ parts ->
        result += "${parts[0]}_${parts[1]}|"
    }
    assert result == 'The _ quick|brown _ fox|'
    
 public static Object splitEachLine(InputStream stream,
    String sep,
    Closure closure) throws IOException 
    Iterates through the given InputStream line by line, splitting each line using the given separator. The list of tokens for each line is then passed to the given closure. The stream is closed before the method returns.
 public static Object splitEachLine(String self,
    String sep,
    Closure closure) throws IOException 
    Iterates through the given String line by line, splitting each line using the given separator. The list of tokens for each line is then passed to the given closure.
 public static Object splitEachLine(InputStream stream,
    String sep,
    String charset,
    Closure closure) throws IOException 
    Iterates through the given InputStream line by line using the specified encoding, splitting each line using the given separator. The list of tokens for each line is then passed to the given closure. Finally, the stream is closed.
 public static SpreadMap spread(Map self) 
 public static String sprintf(Object self,
    String format,
    Object[] values) 
    Sprintf to a string (Only works with JDK1.5 or later).
 public static String sprintf(Object self,
    String format,
    Object arg) 
    Returns a formatted string using the specified format string and arguments.

 public static  void step(Number self,
    Number to,
    Number stepNumber,
    Closure closure) 
    Iterates from this number up to the given number using a step increment. Each intermediate number is passed to the given closure. Example:
    0.step( 10, 2 ) {
      println it
    }
    Prints even numbers 0 through 8.
 public static Map<K, V> subMap(Map<K, V> map,
    Collection<K> keys) 
    Creates a sub-Map containing the given keys. This method is similar to List.subList() but uses keys rather than index ranges.
 public static Set<T> subsequences(List<T> self) 
    Finds all non-null subsequences of a list. E.g. [1, 2, 3].subsequences() would be: [[1, 2, 3], [1, 3], [2, 3], [1, 2], [1], [2], [3]]
 public static Object sum(Collection self) 
    Sums the items in a collection. This is equivalent to invoking the "plus" method on all items in the collection.
 public static Object sum(Iterator self) 
    Sums the items from an Iterator. This is equivalent to invoking the "plus" method on all items from the Iterator. The iterator will become exhausted of elements after determining the sum value.
 public static Object sum(Collection self,
    Object initialValue) 
    Sums the items in a collection, adding the result to some initial value.
 public static Object sum(Iterator self,
    Object initialValue) 
    Sums the items from an Iterator. This is equivalent to invoking the "plus" method on all items from the Iterator.
 public static Object sum(Collection self,
    Closure closure) 
    Sums the result of apply a closure to each item of a collection. coll.sum(closure) is equivalent to: coll.collect(closure).sum().
 public 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. coll.sum(closure) is equivalent to: coll.collect(closure).sum().
 public static List<T> tail(List<T> self) 
    Returns the items from the List excluding the first item.
 public static  void times(Number self,
    Closure closure) 
    Executes the closure this many times, starting from zero. The current index is passed to the closure each time. Example:
    10.times {
      println it
    }
    Prints the numbers 0 through 9.
 public static String toArrayString(Object[] self) 
    Returns the string representation of the given array. The string displays the contents of the array, similar to an array literal, i.e. {1, 2, "a"}.
 public static BigDecimal toBigDecimal(String self) 
    Parse a String into a BigDecimal
 public static BigDecimal toBigDecimal(Number self) 
    Transform a Number into a BigDecimal
 public static BigInteger toBigInteger(String self) 
    Parse a String into a BigInteger
 public static BigInteger toBigInteger(Number self) 
    Transform this Number into a BigInteger.
 public static Boolean toBoolean(String self) 
    Converts the given string into a Boolean object. If the trimmed string is "true", "y" or "1" (ignoring case) then the result is true othewrwise it is false.
 public static Character toCharacter(String self) 
    Converts the given string into a Character object using the first character in the string.
 public static Double toDouble(String self) 
    Parse a String into a Double
 public static Double toDouble(Number self) 
    Transform a Number into a Double
 public static Float toFloat(String self) 
    Parse a String into a Float
 public static Float toFloat(Number self) 
    Transform a Number into a Float
 public static Integer toInteger(String self) 
    Parse a String into an Integer
 public static Integer toInteger(Number self) 
    Transform a Number into an Integer
 public static List<T> toList(Collection<T> self) 
    Convert a collection to a List.
 public static List<T> toList(Iterator<T> self) 
    Convert an iterator to a List. The iterator will become exhausted of elements after making this conversion.
 public static List<T> toList(Enumeration<T> self) 
    Convert an enumeration to a List.
 public static List<T> toList(T[] array) 
    Allows conversion of arrays into a mutable List.
 public static List<Byte> toList(byte[] array) 
    Converts this array to a List of the same size, with each element added to the list.
 public static List<Boolean> toList(boolean[] array) 
    Converts this array to a List of the same size, with each element added to the list.
 public static List<Character> toList(char[] array) 
    Converts this array to a List of the same size, with each element added to the list.
 public static List<Short> toList(short[] array) 
    Converts this array to a List of the same size, with each element added to the list.
 public static List<Integer> toList(int[] array) 
    Converts this array to a List of the same size, with each element added to the list.
 public static List<Long> toList(long[] array) 
    Converts this array to a List of the same size, with each element added to the list.
 public static List<Float> toList(float[] array) 
    Converts this array to a List of the same size, with each element added to the list.
 public static List<Double> toList(double[] array) 
    Converts this array to a List of the same size, with each element added to the list.
 public static List<String> toList(String self) 
    Converts the given String into a List of strings of one character.
 public static String toListString(Collection self) 
    Returns the string representation of the given list. The string displays the contents of the list, similar to a list literal, i.e. [1, 2, a].
 public static Long toLong(String self) 
    Parse a String into a Long
 public static Long toLong(Number self) 
    Transform a Number into a Long
 public static char toLowerCase(Character self) 
    Converts the character to lowercase. Synonym for 'Character.toLowerCase(this)'.
 public static String toMapString(Map self) 
    Returns the string representation of this map. The string displays the contents of the map, i.e. [one:1, two:2, three:3].
 public static GroovyRowResult toRowResult(ResultSet rs) throws SQLException 
Deprecated! moved - to org.codehaus.groovy.runtime.SqlGroovyMethods#toRowResult(java.sql.ResultSet)

    Returns a GroovyRowResult given a ResultSet.
 public static Short toShort(String self) 
    Parse a String into a Short
 public static SpreadMap toSpreadMap(Map self) 
    Returns a new SpreadMap from this map.

    For examples, if there is defined a function like as

        def fn(a, b, c, d) { return a + b + c + d }
    
    , then all of the following three have the same meaning.
        println fn(a:1, [b:2, c:3].toSpreadMap(), d:4)
        println fn(a:1, *:[b:2, c:3], d:4)
        println fn(a:1, b:2, c:3, d:4)
    

 public static SpreadMap toSpreadMap(Object[] self) 
    Creates a spreadable map from this array.
 public static String toString(boolean[] self) 
    Returns the string representation of the given array.
 public static String toString(byte[] self) 
    Returns the string representation of the given array.
 public static String toString(char[] self) 
    Returns the string representation of the given array.
 public static String toString(short[] self) 
    Returns the string representation of the given array.
 public static String toString(int[] self) 
    Returns the string representation of the given array.
 public static String toString(long[] self) 
    Returns the string representation of the given array.
 public static String toString(float[] self) 
    Returns the string representation of the given array.
 public static String toString(double[] self) 
    Returns the string representation of the given array.
 public static String toString(AbstractMap self) 
    Returns the string representation of the given map.
 public static String toString(AbstractCollection self) 
    Returns the string representation of the given collection. The string displays the contents of the collection, i.e. [1, 2, a].
 public static String toString(Object[] self) 
    Returns the string representation of this array's contents.
 public static String toString(Object value) 
    Create a String representation of this object.
 public static URI toURI(String self) throws URISyntaxException 
    Transforms a String representing a URI into a URI object.
 public static URL toURL(String self) throws MalformedURLException 
    Transforms a String representing a URL into a URL object.
 public static char toUpperCase(Character self) 
    Converts the character to uppercase. Synonym for 'Character.toUpperCase(this)'.
 public static List tokenize(String self) 
    Tokenize a String (with a whitespace as the delimiter).
 public static List tokenize(String self,
    String token) 
    Tokenize a String based on the given string delimiter.
 public static  void transformChar(Reader self,
    Writer writer,
    Closure closure) throws IOException 
    Transforms each character from this reader by passing it to the given closure. The Closure should return each transformed character, which will be passed to the Writer. The reader and writer will be both be closed before this method returns.
 public static  void transformLine(Reader reader,
    Writer writer,
    Closure closure) throws IOException 
    Transforms the lines from a reader with a Closure and write them to a writer. Both Reader and Writer are closed after the operation.
 public static List transpose(List self) 
    Adds GroovyCollections#transpose(List) as a method on lists.
 public static float trunc(Float number) 
    Truncate the value
 public static double trunc(Double number) 
    Truncate the value
 public static float trunc(Float number,
    int precision) 
    Truncate the value
 public static double trunc(Double number,
    int precision) 
    Truncate the value
 public static Number unaryMinus(Number left) 
    Negates the number. Equivalent to the '-' operator when it preceeds a single operand, i.e. -10
 public static Iterator<T> unique(Iterator<T> self) 
    Returns an iterator equivalent to this iterator all duplicated items removed by using the default comparator. The original iterator will become exhausted of elements after determining the unique values. A new iterator for the unique values will be returned.
 public static Collection<T> unique(Collection<T> self) 
    Modifies this collection to remove all duplicated items, using the default comparator.
 public static Iterator<T> unique(Iterator<T> self,
    Closure closure) 
    Returns an iterator equivalent to this iterator but with all duplicated items removed by using a Closure to determine duplicate (equal) items. The original iterator will be fully processed after the call.

    If the closure takes a single parameter, the argument passed will be each element, and the closure should return a value used for comparison (either using Comparable#compareTo(Object) or Object#equals(Object) ). If the closure takes two parameters, two items from the Iterator will be passed as arguments, and the closure should return an int value (with 0 indicating the items are not unique).
 public static Collection<T> unique(Collection<T> self,
    Closure closure) 
    A convenience method for making a collection unique using a Closure to determine duplicate (equal) items.

    If the closure takes a single parameter, the argument passed will be each element, and the closure should return a value used for comparison (either using Comparable#compareTo(Object) or Object#equals(Object) ). If the closure takes two parameters, two items from the collection will be passed as arguments, and the closure should return an int value (with 0 indicating the items are not unique).
 public static Iterator<T> unique(Iterator<T> self,
    Comparator<T> comparator) 
    Returns an iterator equivalent to this iterator with all duplicated items removed by using the supplied comparator.
 public static Collection<T> unique(Collection<T> self,
    Comparator<T> comparator) 
    Remove all duplicates from a given Collection. Works on the receiver object and returns it. The order of members in the Collection are compared by the given Comparator. For each duplicate, the first member which is returned by the given Collection's iterator is retained, but all other ones are removed. The given Collection's original order is preserved.

        class Person {
            def fname, lname
            public String toString() {
                return fname + " " + lname
            }
        }
    

    class PersonComparator implements Comparator { public int compare(Object o1, Object o2) { Person p1 = (Person) o1 Person p2 = (Person) o2 if (p1.lname != p2.lname) return p1.lname.compareTo(p2.lname) else return p1.fname.compareTo(p2.fname) }

    public boolean equals(Object obj) { return this.equals(obj) } }

    Person a = new Person(fname:"John", lname:"Taylor") Person b = new Person(fname:"Clark", lname:"Taylor") Person c = new Person(fname:"Tom", lname:"Cruz") Person d = new Person(fname:"Clark", lname:"Taylor")

    def list = [a, b, c, d] List list2 = list.unique(new PersonComparator()) assert( list2 == list && list == [a, b, c] )

 public static  void upto(Number self,
    Number to,
    Closure closure) 
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
 public static  void upto(long self,
    Number to,
    Closure closure) 
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
 public static  void upto(Long self,
    Number to,
    Closure closure) 
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
 public static  void upto(float self,
    Number to,
    Closure closure) 
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
 public static  void upto(Float self,
    Number to,
    Closure closure) 
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
 public static  void upto(double self,
    Number to,
    Closure closure) 
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
 public static  void upto(Double self,
    Number to,
    Closure closure) 
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
 public static  void upto(BigInteger self,
    Number to,
    Closure closure) 
    Iterates from this number up to the given number, inclusive, incrementing by one each time. Example:
    0.upto( 10 ) {
      println it
    }
    Prints numbers 0 to 10
 public static  void upto(BigDecimal self,
    Number to,
    Closure closure) 
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
    0.1.upto( 10 ) {
      println it
    }
    Prints numbers 0.1, 1.1, 2.1... to 9.1
 public static Object use(Object self,
    Object[] array) 
    Allows you to use a list of categories, specifying the list as varargs. use(CategoryClass1, CategoryClass2) { ... } This method saves having to wrap the the category classes in a list.
 public static Object use(Object self,
    Class categoryClass,
    Closure closure) 
    Scoped use method
 public static Object use(Object self,
    List<Class> categoryClassList,
    Closure closure) 
    Scoped use method with list of categories.
 public static  void waitForOrKill(Process self,
    long numberOfMillis) 
    Wait for the process to finish during a certain amount of time, otherwise stops the process.
 public static  void waitForProcessOutput(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. The stream data is thrown away but blocking due to a full output buffer is avoided. Use this method if you don't care about the standard or error output and just want the process to run silently - use carefully however, because since the stream data is thrown away, it might be difficult to track down when something goes wrong. For this, two Threads are started, but join()ed, so we wait.
 public static  void waitForProcessOutput(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. The processed stream data is appended to the supplied StringBuffer. For this, two Threads are started, but join()ed, so we wait.
 public static  void waitForProcessOutput(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. The processed stream data is appended to the supplied OutputStream. For this, two Threads are started, but join()ed, so we wait.
 public static Object with(Object self,
    Closure closure) 
    Allows the closure to be called for the object reference self
 public static Object withDataInputStream(File file,
    Closure closure) throws IOException 
    Create a new DataInputStream for this file and passes it into the closure. This method ensures the stream is closed after the closure returns.
 public static Object withDataOutputStream(File file,
    Closure closure) throws IOException 
    Create a new DataOutputStream for this file and passes it into the closure. This method ensures the stream is closed after the closure returns.
 public static Object withInputStream(File file,
    Closure closure) throws IOException 
    Create a new InputStream for this file and passes it into the closure. This method ensures the stream is closed after the closure returns.
 public static Object withInputStream(URL url,
    Closure closure) throws IOException 
    Creates a new InputStream for this URL and passes it into the closure. This method ensures the stream is closed after the closure returns.
 public static Object withObjectInputStream(File file,
    Closure closure) throws IOException 
    Create a new ObjectInputStream for this file and pass it to the closure. This method ensures the stream is closed after the closure returns.
 public static Object withObjectInputStream(InputStream inputStream,
    Closure closure) throws IOException 
    Create a new ObjectInputStream for this file and pass it to the closure. This method ensures the stream is closed after the closure returns.
 public static Object withObjectInputStream(File file,
    ClassLoader classLoader,
    Closure closure) throws IOException 
    Create a new ObjectInputStream for this file associated with the given class loader and pass it to the closure. This method ensures the stream is closed after the closure returns.
 public static Object withObjectInputStream(InputStream inputStream,
    ClassLoader classLoader,
    Closure closure) throws IOException 
    Create a new ObjectInputStream for this file and pass it to the closure. This method ensures the stream is closed after the closure returns.
 public static Object withObjectOutputStream(File file,
    Closure closure) throws IOException 
    Create a new ObjectOutputStream for this file and then pass it to the closure. This method ensures the stream is closed after the closure returns.
 public static Object withObjectOutputStream(OutputStream outputStream,
    Closure closure) throws IOException 
    Create a new ObjectOutputStream for this output stream and then pass it to the closure. This method ensures the stream is closed after the closure returns.
 public static Object withObjectStreams(Socket socket,
    Closure closure) throws IOException 
    Creates an InputObjectStream and an OutputObjectStream from a Socket, and passes them to the closure. The streams will be closed after the closure returns, even if an exception is thrown.
 public static Object withOutputStream(File file,
    Closure closure) throws IOException 
    Creates a new OutputStream for this file and passes it into the closure. This method ensures the stream is closed after the closure returns.
 public 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. A new Thread is started, so this method will return immediately.
 public static Object withPrintWriter(File file,
    Closure closure) throws IOException 
    Create a new PrintWriter for this file which is then passed it into the given closure. This method ensures its the writer is closed after the closure returns.
 public static Object withPrintWriter(Writer writer,
    Closure closure) throws IOException 
    Create a new PrintWriter with a specified charset for this file. The writer is passed to the closure, and will be closed before this method returns.
 public static Object withPrintWriter(File file,
    String charset,
    Closure closure) throws IOException 
    Create a new PrintWriter with a specified charset for this file. The writer is passed to the closure, and will be closed before this method returns.
 public static Object withReader(File file,
    Closure closure) throws IOException 
    Create a new BufferedReader for this file and then passes it into the closure, ensuring the reader is closed after the closure returns.
 public static Object withReader(Reader reader,
    Closure closure) throws IOException 
    Allows this reader to be used within the closure, ensuring that it is closed before this method returns.
 public static Object withReader(URL url,
    Closure closure) throws IOException 
    Helper method to create a new BufferedReader for a URL and then passes it to the closure. The reader is closed after the closure returns.
 public static Object withReader(InputStream in,
    Closure closure) throws IOException 
    Helper method to create a new Reader for a stream and then passes it into the closure. The reader (and this stream) is closed after the closure returns.
 public static Object withReader(File file,
    String charset,
    Closure closure) throws IOException 
    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.
 public static Object withReader(URL url,
    String charset,
    Closure closure) throws IOException 
    Helper method to create a new Reader for a URL and then passes it to the closure. The reader is closed after the closure returns.
 public static Object withReader(InputStream in,
    String charset,
    Closure closure) throws IOException 
    Helper method to create a new Reader for a stream and then passes it into the closure. The reader (and this stream) is closed after the closure returns.
 public static Object withStream(InputStream stream,
    Closure closure) throws IOException 
    Allows this input stream to be used within the closure, ensuring that it is flushed and closed before this method returns.
 public static Object withStream(OutputStream os,
    Closure closure) throws IOException 
    Passes this OutputStream to the closure, ensuring that the stream is closed after the closure returns, regardless of errors.
 public static Object withStreams(Socket socket,
    Closure closure) throws IOException 
    Passes the Socket's InputStream and OutputStream to the closure. The streams will be closed after the closure returns, even if an exception is thrown.
 public static Object withWriter(File file,
    Closure closure) throws IOException 
    Creates a new BufferedWriter for this file, passes it to the closure, and ensures the stream is flushed and closed after the closure returns.
 public static Object withWriter(Writer writer,
    Closure closure) throws IOException 
    Allows this writer to be used within the closure, ensuring that it is flushed and closed before this method returns.
 public static Object withWriter(OutputStream stream,
    Closure closure) throws IOException 
    Creates a writer from this stream, passing it to the given closure. This method ensures the stream is closed after the closure returns.
 public 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. A new Thread is started, so this method will return immediately.
 public static Object withWriter(File file,
    String charset,
    Closure closure) throws IOException 
    Creates a new BufferedWriter for this file, passes it to the closure, and ensures the stream is flushed and closed after the closure returns. The writer will use the given charset encoding.
 public static Object withWriter(OutputStream stream,
    String charset,
    Closure closure) throws IOException 
    Creates a writer from this stream, passing it to the given closure. This method ensures the stream is closed after the closure returns.
 public static Object withWriterAppend(File file,
    Closure closure) throws IOException 
    Create a new BufferedWriter for this file in append mode. The writer is passed to the closure and is closed after the closure returns.
 public static Object withWriterAppend(File file,
    String charset,
    Closure closure) throws IOException 
    Create a new BufferedWriter which will append to this file. The writer is passed to the closure and will be closed before this method returns.
 public static  void write(Writer self,
    Writable writable) throws IOException 
    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.
 public static  void write(File file,
    String text) throws IOException 
    Write the text to the File.
 public static  void write(File file,
    String text,
    String charset) throws IOException 
    Write the text to the File, using the specified encoding.
 public static  void writeLine(BufferedWriter writer,
    String line) throws IOException 
    Write the text and append a newline (using the platform's line-ending).
 public static BitSet xor(BitSet left,
    BitSet right) 
    Bitwise XOR together two BitSets. Called when the '^' operator is used between two bit sets.
 public static Number xor(Number left,
    Number right) 
    Bitwise XOR together two Numbers. Called when the '|' operator is used.
 public static Boolean xor(Boolean left,
    Boolean right) 
    Exclusive disjunction of two boolean operators