Groovy Documentation

org.codehaus.groovy.runtime
[Java] Class DefaultGroovyMethods

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

public class DefaultGroovyMethods
extends DefaultGroovyMethodsSupport

This class defines new groovy methods which appear on normal JDK classes inside the Groovy environment. Static methods are used with the first parameter being the destination class, i.e. public static String reverse(String self) provides a reverse() method for String.

NOTE: While this class contains many 'public' static methods, it is primarily regarded as an internal class (its internal package name suggests this also). We value backwards compatibility of these methods when used within Groovy but value less backwards compatibility at the Java method call level. I.e. future versions of Groovy may remove or move a method call in this file but would normally aim to keep the method available from within Groovy.

Authors:
James Strachan
Jeremy Rayner
Sam Pullara
Rod Cope
Guillaume Laforge
John Wilson
Hein Meling
Dierk Koenig
Pilho Kim
Marc Guillemot
Russel Winder
bing ran
Jochen Theodorou
Paul King
Michael Baehr
Joachim Baumann
Alex Tkachman
Ted Naleid
Brad Long
Jim Jagielski
Rodolfo Velasco
jeremi Joslin
Hamlet D'Arcy
Cedric Champeau
Tim Yates
Dinko Srkoc
Andre Steingress


Field Summary
static java.lang.Class[] DGM_LIKE_CLASSES

static java.lang.Class[] additionals

 
Method Summary
static int abs(java.lang.Number number)

Truncate the value

static long abs(java.lang.Long number)

Truncate the value

static float abs(java.lang.Float number)

Determine if a Character is uppercase.

static double abs(java.lang.Double number)

static java.net.Socket accept(java.net.ServerSocket serverSocket, Closure closure)

static java.net.Socket accept(java.net.ServerSocket serverSocket, boolean runInANewThread, Closure closure)

static boolean addAll(java.util.Collection self, java.lang.Object[] items)

static boolean addAll(java.util.List self, int index, java.lang.Object[] items)

Splits all items into two lists based on the closure condition.

static void addShutdownHook(java.lang.Object self, Closure closure)

static java.lang.Number and(java.lang.Number left, java.lang.Number right)

static java.util.BitSet and(java.util.BitSet left, java.util.BitSet right)

static java.lang.Boolean and(java.lang.Boolean left, java.lang.Boolean right)

Iterates over the elements of an iterable collection of items, starting from a specified startIndex, and returns the index of the first item that matches the condition specified in the closure.

static boolean any(java.lang.Object self, Closure closure)

static boolean any(java.util.Map self, Closure closure)

static boolean any(java.lang.Object self)

static void append(java.io.File file, java.lang.Object text)

static void append(java.io.File file, byte[] bytes)

static void append(java.io.File self, java.io.InputStream stream)

static void append(java.io.File file, java.lang.Object text, java.lang.String charset)

static boolean asBoolean(java.lang.Object object)

Coerce a collection instance to a boolean value.

static boolean asBoolean(java.lang.Boolean bool)

static boolean asBoolean(java.util.Collection collection)

Coerce an iterator instance to a boolean value.

static boolean asBoolean(java.util.Map map)

Coerce an enumeration instance to a boolean value.

static boolean asBoolean(java.util.Iterator iterator)

Coerce an Object array to a boolean value.

static boolean asBoolean(java.util.Enumeration enumeration)

Coerces a byte array to a boolean value.

static boolean asBoolean(java.lang.Object[] array)

Coerces a short array to a boolean value.

static boolean asBoolean(byte[] array)

Coerces an int array to a boolean value.

static boolean asBoolean(short[] array)

Coerces a long array to a boolean value.

static boolean asBoolean(int[] array)

Coerces a float array to a boolean value.

static boolean asBoolean(long[] array)

Coerces a double array to a boolean value.

static boolean asBoolean(float[] array)

Coerces a boolean array to a boolean value.

static boolean asBoolean(double[] array)

Coerces a char array to a boolean value.

static boolean asBoolean(boolean[] array)

Coerce a character to a boolean value.

static boolean asBoolean(char[] array)

Coerce a number to a boolean value.

static boolean asBoolean(java.lang.Character character)

static boolean asBoolean(java.lang.Number number)

static boolean asBoolean(java.lang.CharSequence string)

static boolean asBoolean(java.util.regex.Matcher matcher)

static java.util.Map asImmutable(java.util.Map self)

A convenience method for creating an immutable sorted map.

static java.util.SortedMap asImmutable(java.util.SortedMap self)

static java.util.List asImmutable(java.util.List self)

static java.util.Set asImmutable(java.util.Set self)

static java.util.SortedSet asImmutable(java.util.SortedSet self)

static java.util.Collection asImmutable(java.util.Collection self)

A convenience method for creating a synchronized SortedMap.

static java.util.List asList(java.util.Collection self)

Coerce an object instance to a boolean value.

static java.util.Map asSynchronized(java.util.Map self)

static java.util.SortedMap asSynchronized(java.util.SortedMap self)

static java.util.Collection asSynchronized(java.util.Collection self)

static java.util.List asSynchronized(java.util.List self)

static java.util.Set asSynchronized(java.util.Set self)

static java.util.SortedSet asSynchronized(java.util.SortedSet self)

static java.lang.Object asType(java.util.Collection col, java.lang.Class clazz)

static java.lang.Object asType(java.lang.Object[] ary, java.lang.Class clazz)

Converts the given array to either a List, Set, or SortedSet.

static java.lang.Object asType(Closure cl, java.lang.Class clazz)

Coerces this map to the given type, using the map's keys as the public method names, and values as the implementation.

static java.lang.Object asType(java.util.Map map, java.lang.Class clazz)

static java.lang.Object asType(java.lang.Number self, java.lang.Class c)

Traverse through each byte of this Byte array.

static java.lang.Object asType(java.lang.Object obj, java.lang.Class type)

Adds a "metaClass" property to all class objects so you can use the syntax String.metaClass.myMethod = { println "foo" }

static java.lang.Object asType(java.lang.CharSequence self, java.lang.Class c)

static java.lang.Object asType(GString self, java.lang.Class c)

static java.lang.Object asType(java.lang.String self, java.lang.Class c)

static java.lang.Object asType(java.io.File f, java.lang.Class c)

static java.io.File asWritable(java.io.File file)

static java.io.File asWritable(java.io.File file, java.lang.String encoding)

static java.util.BitSet bitwiseNegate(java.util.BitSet self)

Iterates from this number up to the given number, inclusive, incrementing by one each time.

static java.util.regex.Pattern bitwiseNegate(java.lang.CharSequence self)

static java.util.regex.Pattern bitwiseNegate(java.lang.String self)

protected static java.lang.Object callClosureForLine(Closure closure, java.lang.String line, int counter)

protected static java.lang.Object callClosureForMapEntry(Closure closure, java.util.Map$Entry entry)

protected static java.lang.Object callClosureForMapEntryAndCounter(Closure closure, java.util.Map$Entry entry, int counter)

static java.lang.CharSequence capitalize(java.lang.CharSequence self)

static java.lang.String capitalize(java.lang.String self)

static java.lang.CharSequence center(java.lang.CharSequence self, java.lang.Number numberOfChars)

static java.lang.CharSequence center(java.lang.CharSequence self, java.lang.Number numberOfChars, java.lang.CharSequence padding)

static java.lang.String center(java.lang.String self, java.lang.Number numberOfChars)

static java.lang.String center(java.lang.String self, java.lang.Number numberOfChars, java.lang.String padding)

static java.util.List collate(java.util.List self, int size)

static java.util.List collate(java.util.List self, int size, int step)

static java.util.List collate(java.util.List self, int size, boolean keepRemainder)

static java.util.List collate(java.util.List self, int size, int step, boolean keepRemainder)

static java.util.List collect(java.lang.Object self, Closure transform)

Iterates through this aggregate Object transforming each item into a new value using the transform closure, returning a list of transformed values.

static java.util.Collection collect(java.lang.Object self)

Iterates through this aggregate Object transforming each item into a new value using the transform closure and adding it to the supplied collector.

static java.util.Collection collect(java.lang.Object self, java.util.Collection collector, Closure transform)

static java.util.List collect(java.util.Collection self, Closure transform)

Iterates through this collection transforming each entry into a new value using Closure.IDENTITY as a transformer, basically returning a list of items copied from the original collection.

static java.util.List collect(java.util.Collection self)

Iterates through this collection transforming each value into a new value using the transform closure and adding it to the supplied collector.

static java.util.Collection collect(java.util.Collection self, java.util.Collection collector, Closure transform)

static java.util.Collection collect(java.util.Map self, java.util.Collection collector, Closure transform)

static java.util.List collect(java.util.Map self, Closure transform)

static java.util.List collectAll(java.util.Collection self, Closure transform)

static java.util.Collection collectAll(java.util.Collection self, java.util.Collection collector, Closure transform)

static java.util.Map collectEntries(java.util.Map self, java.util.Map collector, Closure transform)

static java.util.Map collectEntries(java.util.Map self, Closure transform)

static java.util.Map collectEntries(java.util.Collection self, Closure transform)

A variant of collectEntries for Iterators.

static java.util.Map collectEntries(java.util.Iterator self, Closure transform)

A variant of collectEntries for Iterables.

static java.util.Map collectEntries(java.lang.Iterable self, Closure transform)

static java.util.Map collectEntries(java.util.Collection self)

A variant of collectEntries for Iterators using the identity closure as the transform.

static java.util.Map collectEntries(java.util.Iterator self)

A variant of collectEntries for Iterables using the identity closure as the transform.

static java.util.Map collectEntries(java.lang.Iterable self)

static java.util.Map collectEntries(java.util.Collection self, java.util.Map collector, Closure transform)

static java.util.Map collectEntries(java.util.Iterator self, java.util.Map collector, Closure transform)

A variant of collectEntries for Iterables using a supplied map as the destination of transformed entries.

static java.util.Map collectEntries(java.lang.Iterable self, java.util.Map collector, Closure transform)

A variant of collectEntries for Collections using the identity closure as the transform and a supplied map as the destination of transformed entries.

static java.util.Map collectEntries(java.util.Collection self, java.util.Map collector)

A variant of collectEntries for Iterators using the identity closure as the transform and a supplied map as the destination of transformed entries.

static java.util.Map collectEntries(java.util.Iterator self, java.util.Map collector)

A variant of collectEntries for Iterables using the identity closure as the transform and a supplied map as the destination of transformed entries.

static java.util.Map collectEntries(java.lang.Iterable self, java.util.Map collector)

static java.util.Map collectEntries(java.lang.Object[] self, java.util.Map collector, Closure transform)

A variant of collectEntries using the identity closure as the transform.

static java.util.Map collectEntries(java.lang.Object[] self, java.util.Map collector)

static java.util.Map collectEntries(java.lang.Object[] self, Closure transform)

A variant of collectEntries using the identity closure as the transform.

static java.util.Map collectEntries(java.lang.Object[] self)

static java.util.List collectMany(java.util.Collection self, Closure projection)

Projects each item from a source collection to a collection and concatenates (flattens) the resulting collections into a single list.

static java.util.Collection collectMany(java.util.Collection self, java.util.Collection collector, Closure projection)

static java.util.List collectMany(java.lang.Object[] self, Closure projection)

static java.util.List collectMany(java.util.Iterator self, Closure projection)

static java.util.List collectNested(java.util.Collection self, Closure transform)

Deprecated alias for collectNested

static java.util.Collection collectNested(java.util.Collection self, java.util.Collection collector, Closure transform)

static java.util.List combinations(java.util.Collection self)

Finds all non-null subsequences of a list.

static int compareTo(java.lang.Character left, java.lang.Number right)

static int compareTo(java.lang.Number left, java.lang.Character right)

static int compareTo(java.lang.Character left, java.lang.Character right)

static int compareTo(java.lang.Number left, java.lang.Number right)

static boolean contains(int[] self, java.lang.Object value)

Checks whether the array contains the given value.

static boolean contains(long[] self, java.lang.Object value)

Checks whether the array contains the given value.

static boolean contains(short[] self, java.lang.Object value)

Returns the string representation of the given array.

static boolean contains(char[] self, java.lang.Object value)

Returns the string representation of the given array.

static boolean contains(boolean[] self, java.lang.Object value)

Returns the string representation of the given array.

static boolean contains(double[] self, java.lang.Object value)

Returns the string representation of the given array.

static boolean contains(float[] self, java.lang.Object value)

static boolean contains(byte[] self, java.lang.Object value)

Returns the string representation of the given array.

static boolean contains(java.lang.Object[] self, java.lang.Object value)

Returns the string representation of the given map.

static boolean contains(java.lang.CharSequence self, java.lang.CharSequence text)

static boolean contains(java.lang.String self, java.lang.String text)

static boolean containsAll(java.util.Collection self, java.lang.Object[] items)

Modifies this collection by removing its elements that are contained within the specified object array.

static java.lang.Number count(java.util.Iterator self, java.lang.Object value)

static java.lang.Number count(java.util.Iterator self, Closure closure)

Counts the number of occurrences which satisfy the given closure from the items within this Iterator.

static java.lang.Number count(java.util.Collection self, java.lang.Object value)

static java.lang.Number count(java.util.Collection self, Closure closure)

static java.lang.Number count(java.util.Map self, Closure closure)

static java.lang.Number count(java.lang.Object[] self, java.lang.Object value)

Counts the number of occurrences which satisfy the given closure from inside this array.

static java.lang.Number count(java.lang.Object[] self, Closure closure)

Counts the number of occurrences of the given value inside this array.

static java.lang.Number count(int[] self, java.lang.Object value)

Counts the number of occurrences of the given value inside this array.

static java.lang.Number count(long[] self, java.lang.Object value)

Counts the number of occurrences of the given value inside this array.

static java.lang.Number count(short[] self, java.lang.Object value)

Counts the number of occurrences of the given value inside this array.

static java.lang.Number count(char[] self, java.lang.Object value)

Counts the number of occurrences of the given value inside this array.

static java.lang.Number count(boolean[] self, java.lang.Object value)

Counts the number of occurrences of the given value inside this array.

static java.lang.Number count(double[] self, java.lang.Object value)

Counts the number of occurrences of the given value inside this array.

static java.lang.Number count(float[] self, java.lang.Object value)

Counts the number of occurrences of the given value inside this array.

static java.lang.Number count(byte[] self, java.lang.Object value)

static int count(java.lang.CharSequence self, java.lang.CharSequence text)

static int count(java.lang.String self, java.lang.String text)

static java.util.Map countBy(java.util.Collection self, Closure closure)

Sorts all array members into groups determined by the supplied mapping closure and counts the group size.

static java.util.Map countBy(java.lang.Object[] self, Closure closure)

Sorts all iterator items into groups determined by the supplied mapping closure and counts the group size.

static java.util.Map countBy(java.util.Iterator self, Closure closure)

static java.util.Map countBy(java.util.Map self, Closure closure)

Groups the current element according to the value

protected static StringBufferWriter createStringBufferWriter(java.lang.StringBuffer self)

protected static java.io.StringWriter createStringWriter(java.lang.String self)

static boolean deleteDir(java.io.File self)

static java.lang.CharSequence denormalize(java.lang.CharSequence self)

static java.lang.String denormalize(java.lang.String self)

static boolean disjoint(java.util.Collection left, java.util.Collection right)

Compare the contents of this array to the contents of the given array.

static java.lang.Number div(java.lang.Character left, java.lang.Number right)

Bitwise AND together two Numbers.

static java.lang.Number div(java.lang.Number left, java.lang.Character right)

Bitwise AND together two BitSets.

static java.lang.Number div(java.lang.Character left, java.lang.Character right)

Bitwise XOR together two BitSets.

static void downto(java.lang.Number self, java.lang.Number to, Closure closure)

Iterates from this number down to the given number, inclusive, decrementing by one each time.

static void downto(long self, java.lang.Number to, Closure closure)

static void downto(java.lang.Long self, java.lang.Number to, Closure closure)

static void downto(float self, java.lang.Number to, Closure closure)

static void downto(java.lang.Float self, java.lang.Number to, Closure closure)

static void downto(double self, java.lang.Number to, Closure closure)

static void downto(java.lang.Double self, java.lang.Number to, Closure closure)

Iterates from this number up to the given number using a step increment.

static void downto(java.math.BigInteger self, java.lang.Number to, Closure closure)

static void downto(java.math.BigDecimal self, java.lang.Number to, Closure closure)

Get the absolute value

static java.util.List drop(java.util.List self, int num)

static java.util.List drop(java.lang.Iterable self, int num)

Drops the given number of elements from the head of this array if they are available.

static java.lang.Object[] drop(java.lang.Object[] self, int num)

static java.util.Map drop(java.util.Map self, int num)

static java.util.Iterator drop(java.util.Iterator self, int num)

Returns the longest prefix of this list where each element passed to the given closure condition evaluates to true.

static java.lang.CharSequence drop(java.lang.CharSequence self, int num)

static java.util.List dropWhile(java.util.List self, Closure condition)

Returns a suffix of this Iterable where elements are dropped from the front while the given closure evaluates to true.

static java.util.List dropWhile(java.lang.Iterable self, Closure condition)

Create a suffix of the given Map by dropping as many entries as possible from the front of the original Map such that calling the given closure condition evaluates to true when passed each of the dropped entries (or key/value pairs).

static java.util.Map dropWhile(java.util.Map self, Closure condition)

static java.lang.Object[] dropWhile(java.lang.Object[] self, Closure condition)

static java.util.Iterator dropWhile(java.util.Iterator self, Closure condition)

static java.lang.String dump(java.lang.Object self)

static java.lang.Object each(java.lang.Object self, Closure closure)

Iterates through an aggregate type or data structure, passing each item to the given closure.

static java.util.Map each(java.util.Map self, Closure closure)

static void eachByte(java.lang.Byte[] self, Closure closure)

static void eachByte(byte[] self, Closure closure)

static void eachByte(java.io.File self, Closure closure)

static void eachByte(java.io.File self, int bufferLen, Closure closure)

static void eachByte(java.io.InputStream is, Closure closure)

static void eachByte(java.io.InputStream is, int bufferLen, Closure closure)

static void eachByte(java.net.URL url, Closure closure)

static void eachByte(java.net.URL url, int bufferLen, Closure closure)

static void eachDir(java.io.File self, Closure closure)

static void eachDirMatch(java.io.File self, java.lang.Object nameFilter, Closure closure)

static void eachDirRecurse(java.io.File self, Closure closure)

static void eachFile(java.io.File self, FileType fileType, Closure closure)

static void eachFile(java.io.File self, Closure closure)

static void eachFileMatch(java.io.File self, FileType fileType, java.lang.Object nameFilter, Closure closure)

static void eachFileMatch(java.io.File self, java.lang.Object nameFilter, Closure closure)

static void eachFileRecurse(java.io.File self, FileType fileType, Closure closure)

static void eachFileRecurse(java.io.File self, Closure closure)

static java.lang.Object eachLine(java.lang.CharSequence self, Closure closure)

static java.lang.Object eachLine(java.lang.CharSequence self, int firstLine, Closure closure)

static java.lang.Object eachLine(java.lang.String self, Closure closure)

static java.lang.Object eachLine(java.lang.String self, int firstLine, Closure closure)

static java.lang.Object eachLine(java.io.File self, Closure closure)

static java.lang.Object eachLine(java.io.File self, java.lang.String charset, Closure closure)

static java.lang.Object eachLine(java.io.File self, int firstLine, Closure closure)

static java.lang.Object eachLine(java.io.File self, java.lang.String charset, int firstLine, Closure closure)

static java.lang.Object eachLine(java.io.InputStream stream, java.lang.String charset, Closure closure)

static java.lang.Object eachLine(java.io.InputStream stream, java.lang.String charset, int firstLine, Closure closure)

static java.lang.Object eachLine(java.io.InputStream stream, Closure closure)

static java.lang.Object eachLine(java.io.InputStream stream, int firstLine, Closure closure)

static java.lang.Object eachLine(java.net.URL url, Closure closure)

static java.lang.Object eachLine(java.net.URL url, int firstLine, Closure closure)

static java.lang.Object eachLine(java.net.URL url, java.lang.String charset, Closure closure)

static java.lang.Object eachLine(java.net.URL url, java.lang.String charset, int firstLine, Closure closure)

static java.lang.Object eachLine(java.io.Reader self, Closure closure)

static java.lang.Object eachLine(java.io.Reader self, int firstLine, Closure closure)

static java.lang.String eachMatch(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)

static java.lang.String eachMatch(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.String eachMatch(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.String eachMatch(java.lang.String self, java.lang.String regex, Closure closure)

static void eachObject(java.io.File self, Closure closure)

static void eachObject(java.io.ObjectInputStream ois, Closure closure)

static java.util.Iterator eachPermutation(java.util.Collection self, Closure closure)

static java.lang.Object eachWithIndex(java.lang.Object self, Closure closure)

static java.util.Map eachWithIndex(java.util.Map self, Closure closure)

static boolean equals(int[] left, int[] right)

Determines if the contents of this array are equal to the contents of the given list, in the same order.

static boolean equals(java.lang.Object[] left, java.util.List right)

static boolean equals(java.util.List left, java.lang.Object[] right)

static boolean equals(java.util.List left, java.util.List right)

static boolean equals(java.util.Set self, java.util.Set other)

static boolean equals(java.util.Map self, java.util.Map other)

Create a Set composed of the elements of the first Set minus the elements of the given Collection.

static boolean every(java.lang.Object self, Closure closure)

static boolean every(java.util.Map self, Closure closure)

static boolean every(java.lang.Object self)

static java.lang.Process execute(java.lang.String self)

static java.lang.Process execute(java.lang.String self, java.lang.String[] envp, java.io.File dir)

static java.lang.Process execute(java.lang.String self, java.util.List envp, java.io.File dir)

static java.lang.Process execute(java.lang.String[] commandArray)

static java.lang.Process execute(java.lang.String[] commandArray, java.lang.String[] envp, java.io.File dir)

static java.lang.Process execute(java.lang.String[] commandArray, java.util.List envp, java.io.File dir)

static java.lang.Process execute(java.util.List commands)

static java.lang.Process execute(java.util.List commands, java.lang.String[] envp, java.io.File dir)

static java.lang.Process execute(java.util.List commands, java.util.List envp, java.io.File dir)

static java.lang.CharSequence expand(java.lang.CharSequence self)

static java.lang.CharSequence expand(java.lang.CharSequence self, int tabStop)

static java.lang.String expand(java.lang.String self)

static java.lang.String expand(java.lang.String self, int tabStop)

static java.lang.CharSequence expandLine(java.lang.CharSequence self, int tabStop)

static java.lang.String expandLine(java.lang.String self, int tabStop)

static void filterLine(java.io.Reader reader, java.io.Writer writer, Closure closure)

static Writable filterLine(java.io.File self, Closure closure)

static Writable filterLine(java.io.File self, java.lang.String charset, Closure closure)

static void filterLine(java.io.File self, java.io.Writer writer, Closure closure)

static void filterLine(java.io.File self, java.io.Writer writer, java.lang.String charset, Closure closure)

static Writable filterLine(java.io.Reader reader, Closure closure)

static Writable filterLine(java.io.InputStream self, Closure predicate)

static Writable filterLine(java.io.InputStream self, java.lang.String charset, Closure predicate)

static void filterLine(java.io.InputStream self, java.io.Writer writer, Closure predicate)

static void filterLine(java.io.InputStream self, java.io.Writer writer, java.lang.String charset, Closure predicate)

static Writable filterLine(java.net.URL self, Closure predicate)

static Writable filterLine(java.net.URL self, java.lang.String charset, Closure predicate)

static void filterLine(java.net.URL self, java.io.Writer writer, Closure predicate)

static void filterLine(java.net.URL self, java.io.Writer writer, java.lang.String charset, Closure predicate)

static java.lang.Object find(java.lang.Object self, Closure closure)

static java.lang.Object find(java.lang.Object self)

Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns the defaultResult.

static java.lang.Object find(java.util.Collection self, Closure closure)

static java.lang.Object find(java.lang.Object[] self, Closure condition)

static java.lang.Object find(java.util.Collection self)

static java.util.Map$Entry find(java.util.Map self, Closure closure)

static java.lang.CharSequence find(java.lang.CharSequence self, java.lang.CharSequence regex)

static java.lang.CharSequence find(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)

static java.lang.CharSequence find(java.lang.CharSequence self, java.util.regex.Pattern pattern)

static java.lang.CharSequence find(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.String find(java.lang.String self, java.util.regex.Pattern pattern)

static java.lang.String find(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.String find(java.lang.String self, java.lang.String regex)

static java.lang.String find(java.lang.String self, java.lang.String regex, Closure closure)

static java.util.Collection findAll(java.util.Collection self, Closure closure)

Finds all elements of the array matching the given Closure condition.

static java.util.Collection findAll(java.lang.Object[] self, Closure condition)

static java.util.Collection findAll(java.util.Collection self)

Finds the elements of the array matching the IDENTITY Closure (i.e.

static java.util.Collection findAll(java.lang.Object[] self)

Finds all items matching the closure condition.

static java.util.Collection findAll(java.lang.Object self, Closure closure)

static java.util.Collection findAll(java.lang.Object self)

static java.util.Map findAll(java.util.Map self, Closure closure)

static java.util.List findAll(java.lang.CharSequence self, java.lang.CharSequence regex)

static java.util.List findAll(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)

static java.util.List findAll(java.lang.CharSequence self, java.util.regex.Pattern pattern)

static java.util.List findAll(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)

static java.util.List findAll(java.lang.String self, java.util.regex.Pattern pattern)

static java.util.List findAll(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)

static java.util.List findAll(java.lang.String self, java.lang.String regex)

static java.util.List findAll(java.lang.String self, java.lang.String regex, Closure closure)

static int findIndexOf(java.lang.Object self, Closure closure)

static int findIndexOf(java.lang.Object self, int startIndex, Closure closure)

static java.util.List findIndexValues(java.lang.Object self, Closure closure)

static java.util.List findIndexValues(java.lang.Object self, java.lang.Number startIndex, Closure closure)

static int findLastIndexOf(java.lang.Object self, Closure closure)

static int findLastIndexOf(java.lang.Object self, int startIndex, Closure closure)

static java.lang.Object findResult(java.lang.Object self, java.lang.Object defaultResult, Closure closure)

Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns null.

static java.lang.Object findResult(java.lang.Object self, Closure closure)

static java.lang.Object findResult(java.util.Collection self, java.lang.Object defaultResult, Closure closure)

static java.lang.Object findResult(java.util.Collection self, Closure closure)

static java.lang.Object findResult(java.util.Map self, java.lang.Object defaultResult, Closure closure)

static java.lang.Object findResult(java.util.Map self, Closure closure)

static java.util.Collection findResults(java.util.Collection self, Closure filteringTransform)

static java.util.Collection findResults(java.util.Map self, Closure filteringTransform)

static java.lang.Object first(java.util.List self)

static java.lang.Object first(java.lang.Iterable self)

Returns the first item from the array.

static java.lang.Object first(java.lang.Object[] self)

static java.util.Collection flatten(java.util.Collection self)

Flatten an array.

static java.util.Collection flatten(java.lang.Object[] self)

static java.util.Collection flatten(boolean[] self)

static java.util.Collection flatten(byte[] self)

static java.util.Collection flatten(char[] self)

static java.util.Collection flatten(short[] self)

static java.util.Collection flatten(int[] self)

static java.util.Collection flatten(long[] self)

static java.util.Collection flatten(float[] self)

Flatten a collection.

static java.util.Collection flatten(double[] self)

static java.util.Collection flatten(java.util.Collection self, Closure flattenUsing)

Overloads the left shift operator to provide an easy way to append objects to a Collection.

static java.lang.Object get(java.util.Map map, java.lang.Object key, java.lang.Object defaultValue)

Support the range subscript operator for an Array

static java.lang.Object getAt(java.lang.Object self, java.lang.String property)

Allows the subscript operator to be used to lookup dynamic property values.

static java.util.List getAt(java.util.List self, Range range)

Support the range subscript operator for a List.

static java.util.List getAt(java.util.List self, EmptyRange range)

Select a List of items from a List using a Collection to identify the indices to be selected.

static java.util.List getAt(java.util.List self, java.util.Collection indices)

Select a List of items from an Object array using a Collection to identify the indices to be selected.

static java.util.List getAt(java.lang.Object[] self, java.util.Collection indices)

Creates a sub-Map containing the given keys.

static java.util.List getAt(java.lang.Object[] array, Range range)

@param array an Array of Objects

static java.util.List getAt(java.lang.Object[] array, IntRange range)

@param array an Array of Objects

static java.util.List getAt(java.lang.Object[] array, EmptyRange range)

static java.util.List getAt(java.lang.Object[] array, ObjectRange range)

static java.lang.Object getAt(java.util.List self, int idx)

static java.lang.Object getAt(java.util.Iterator self, int idx)

static java.lang.Object getAt(java.util.Map self, java.lang.Object key)

Support the subscript operator for a Map.

static java.util.List getAt(java.util.Collection coll, java.lang.String property)

A convenience method for creating an immutable map.

static java.util.List getAt(byte[] array, Range range)

Support the subscript operator with a range for an int array

static java.util.List getAt(char[] array, Range range)

static java.util.List getAt(short[] array, Range range)

static java.util.List getAt(int[] array, Range range)

static java.util.List getAt(long[] array, Range range)

static java.util.List getAt(float[] array, Range range)

static java.util.List getAt(double[] array, Range range)

static java.util.List getAt(boolean[] array, Range range)

static java.util.List getAt(byte[] array, IntRange range)

static java.util.List getAt(char[] array, IntRange range)

static java.util.List getAt(short[] array, IntRange range)

static java.util.List getAt(int[] array, IntRange range)

static java.util.List getAt(long[] array, IntRange range)

static java.util.List getAt(float[] array, IntRange range)

static java.util.List getAt(double[] array, IntRange range)

static java.util.List getAt(boolean[] array, IntRange range)

static java.util.List getAt(byte[] array, ObjectRange range)

static java.util.List getAt(char[] array, ObjectRange range)

static java.util.List getAt(short[] array, ObjectRange range)

static java.util.List getAt(int[] array, ObjectRange range)

static java.util.List getAt(long[] array, ObjectRange range)

static java.util.List getAt(float[] array, ObjectRange range)

static java.util.List getAt(double[] array, ObjectRange range)

static java.util.List getAt(boolean[] array, ObjectRange range)

static java.util.List getAt(byte[] array, java.util.Collection indices)

static java.util.List getAt(char[] array, java.util.Collection indices)

static java.util.List getAt(short[] array, java.util.Collection indices)

static java.util.List getAt(int[] array, java.util.Collection indices)

static java.util.List getAt(long[] array, java.util.Collection indices)

static java.util.List getAt(float[] array, java.util.Collection indices)

static java.util.List getAt(double[] array, java.util.Collection indices)

static java.util.List getAt(boolean[] array, java.util.Collection indices)

static boolean getAt(java.util.BitSet self, int index)

static java.util.BitSet getAt(java.util.BitSet self, IntRange range)

static java.lang.CharSequence getAt(java.lang.CharSequence self, java.util.Collection indices)

static java.lang.CharSequence getAt(java.lang.CharSequence text, EmptyRange range)

static java.lang.CharSequence getAt(java.lang.CharSequence text, int index)

static java.lang.CharSequence getAt(java.lang.CharSequence text, IntRange range)

static java.lang.CharSequence getAt(java.lang.CharSequence text, Range range)

static java.util.List getAt(java.util.regex.Matcher self, java.util.Collection indices)

static java.lang.Object getAt(java.util.regex.Matcher matcher, int idx)

static java.lang.String getAt(java.lang.String self, java.util.Collection indices)

static java.lang.String getAt(java.lang.String text, EmptyRange range)

static java.lang.String getAt(java.lang.String text, int index)

static java.lang.String getAt(java.lang.String text, IntRange range)

static java.lang.String getAt(java.lang.String text, Range range)

static byte[] getBytes(java.io.File file)

static byte[] getBytes(java.net.URL url)

static byte[] getBytes(java.io.InputStream is)

static char[] getChars(java.lang.CharSequence self)

static char[] getChars(java.lang.String self)

static int getCount(java.util.regex.Matcher matcher)

static MetaClass getMetaClass(java.lang.Class c)

static MetaClass getMetaClass(java.lang.Object obj)

static MetaClass getMetaClass(GroovyObject obj)

Sets/updates the metaclass for a given object to a closure.

static java.util.List getMetaPropertyValues(java.lang.Object self)

Retrieves the list of MetaProperty objects for 'self' and wraps it in a list of PropertyValue objects that additionally provide the value for each property of 'self'.

static java.util.Map getProperties(java.lang.Object self)

Convenience method that calls getMetaPropertyValues(java.lang.Object)(self) and provides the data in form of simple key/value pairs, i.e.

static java.lang.ClassLoader getRootLoader(java.lang.ClassLoader self)

Convenience method to dynamically create a new instance of this class.

protected static java.util.List getSubList(java.util.List self, java.util.List splice)

static java.lang.String getText(java.io.File file, java.lang.String charset)

static java.lang.String getText(java.io.File file)

static java.lang.String getText(java.net.URL url)

static java.lang.String getText(java.net.URL url, java.util.Map parameters)

static java.lang.String getText(java.net.URL url, java.lang.String charset)

static java.lang.String getText(java.net.URL url, java.util.Map parameters, java.lang.String charset)

static java.lang.String getText(java.io.InputStream is)

static java.lang.String getText(java.io.InputStream is, java.lang.String charset)

static java.lang.String getText(java.io.Reader reader)

static java.lang.String getText(java.io.BufferedReader reader)

static java.util.Collection grep(java.lang.Object self, java.lang.Object filter)

static java.util.Collection grep(java.util.Collection self, java.lang.Object filter)

Iterates over the collection of items and returns each item that matches the given filter - calling the isCase(java.lang.Object, java.lang.Object) method used by switch statements.

static java.util.Collection grep(java.lang.Object[] self, java.lang.Object filter)

static java.util.Collection grep(java.lang.Object self)

static java.util.Collection grep(java.util.Collection self)

static java.util.Collection grep(java.lang.Object[] self)

protected static void groupAnswer(java.util.Map answer, java.lang.Object element, java.lang.Object value)

static java.util.Map groupBy(java.util.Collection self, Closure closure)

static java.util.Map groupBy(java.util.Collection self, java.lang.Object... closures)

static java.util.Map groupBy(java.util.Collection self, java.util.List closures)

Sorts all collection members into (sub)groups determined by the supplied mapping closures.

static java.util.Map groupBy(java.util.Map self, Closure closure)

static java.util.Map groupBy(java.util.Map self, java.lang.Object... closures)

static java.util.Map groupBy(java.util.Map self, java.util.List closures)

Groups the members of a map into sub maps determined by the supplied mapping closures.

static java.util.Map groupEntriesBy(java.util.Map self, Closure closure)

static boolean hasGroup(java.util.regex.Matcher matcher)

static MetaProperty hasProperty(java.lang.Object self, java.lang.String name)

static java.lang.Object head(java.util.List self)

Returns the items from the List excluding the first item.

static java.lang.Object head(java.lang.Object[] self)

static java.lang.Object identity(java.lang.Object self, Closure closure)

static java.lang.Boolean implies(java.lang.Boolean left, java.lang.Boolean right)

static java.lang.Object inject(java.util.Collection self, Closure closure)

static java.lang.Object inject(java.util.Collection self, java.lang.Object initialValue, Closure closure)

static java.lang.Object inject(java.util.Map self, java.lang.Object initialValue, Closure closure)

static java.lang.Object inject(java.util.Iterator self, java.lang.Object initialValue, Closure closure)

static java.lang.Object inject(java.lang.Object self, Closure closure)

Iterates through the given Object, passing in the initial value to the closure along with the first item.

static java.lang.Object inject(java.lang.Object self, java.lang.Object initialValue, Closure closure)

Iterates through the given array as with inject(Object[],initialValue,closure), but using the first element of the array as the initialValue, and then iterating the remaining elements of the array.

static java.lang.Object inject(java.lang.Object[] self, Closure closure)

static java.lang.Object inject(java.lang.Object[] self, java.lang.Object initialValue, Closure closure)

Sums the items in a collection.

static java.lang.String inspect(java.lang.Object self)

Inspects returns the String that matches what would be typed into a terminal to create this object.

static java.lang.Number intdiv(java.lang.Character left, java.lang.Number right)

Bitwise NEGATE a BitSet.

static java.lang.Number intdiv(java.lang.Number left, java.lang.Character right)

Bitwise OR together two BitSets.

static java.lang.Number intdiv(java.lang.Character left, java.lang.Character right)

Bitwise XOR together two Numbers.

static java.lang.Number intdiv(java.lang.Number left, java.lang.Number right)

static java.util.Collection intersect(java.util.Collection left, java.util.Collection right)

static java.util.Map intersect(java.util.Map left, java.util.Map right)

Returns true if the intersection of two collections is empty.

static java.lang.Object invokeMethod(java.lang.Object object, java.lang.String method, java.lang.Object arguments)

static boolean is(java.lang.Object self, java.lang.Object other)

Identity check.

static boolean isAllWhitespace(java.lang.CharSequence self)

static boolean isAllWhitespace(java.lang.String self)

static boolean isBigDecimal(java.lang.CharSequence self)

static boolean isBigDecimal(java.lang.String self)

static boolean isBigInteger(java.lang.CharSequence self)

static boolean isBigInteger(java.lang.String self)

static boolean isCase(java.lang.Object caseValue, java.lang.Object switchValue)

static boolean isCase(java.lang.Class caseValue, java.lang.Object switchValue)

static boolean isCase(java.util.Collection caseValue, java.lang.Object switchValue)

static boolean isCase(java.util.Map caseValue, java.lang.Object switchValue)

static boolean isCase(java.lang.Number caseValue, java.lang.Number switchValue)

static boolean isCase(java.lang.CharSequence caseValue, java.lang.Object switchValue)

static boolean isCase(GString caseValue, java.lang.Object switchValue)

static boolean isCase(java.util.regex.Pattern caseValue, java.lang.Object switchValue)

static boolean isCase(java.lang.String caseValue, java.lang.Object switchValue)

static boolean isDigit(java.lang.Character self)

static boolean isDouble(java.lang.CharSequence self)

static boolean isDouble(java.lang.String self)

static boolean isFloat(java.lang.CharSequence self)

static boolean isFloat(java.lang.String self)

static boolean isInteger(java.lang.CharSequence self)

static boolean isInteger(java.lang.String self)

static boolean isLetter(java.lang.Character self)

Transform a Number into a Double

static boolean isLetterOrDigit(java.lang.Character self)

Transform a Number into a BigDecimal

static boolean isLong(java.lang.CharSequence self)

static boolean isLong(java.lang.String self)

static boolean isLowerCase(java.lang.Character self)

Transform a Number into a Float

static boolean isNumber(java.lang.CharSequence self)

static boolean isNumber(java.lang.String self)

static boolean isUpperCase(java.lang.Character self)

static boolean isWhitespace(java.lang.Character self)

static java.util.Iterator iterator(java.lang.Object[] a)

static java.util.Iterator iterator(java.lang.Object o)

static java.util.Iterator iterator(java.util.Enumeration enumeration)

static java.util.Iterator iterator(java.util.Iterator self)

static java.util.Iterator iterator(java.util.regex.Matcher matcher)

static java.util.Iterator iterator(java.io.Reader self)

static java.util.Iterator iterator(java.io.InputStream self)

static java.util.Iterator iterator(java.io.DataInputStream self)

static java.lang.String join(java.util.Iterator self, java.lang.String separator)

Concatenates the toString() representation of each item in this collection, with the given String as a separator between each item.

static java.lang.String join(java.util.Collection self, java.lang.String separator)

static java.lang.String join(java.lang.Object[] self, java.lang.String separator)

static java.lang.Object last(java.util.List self)

static java.lang.Object last(java.lang.Iterable self)

Returns the last item from the array.

static java.lang.Object last(java.lang.Object[] self)

Returns the first item from the List.

static java.util.Collection leftShift(java.util.Collection self, java.lang.Object value)

Overloads the left shift operator to provide an easy way to append Map.Entry values to a Map.

static java.util.concurrent.BlockingQueue leftShift(java.util.concurrent.BlockingQueue self, java.lang.Object value)

static java.util.Map leftShift(java.util.Map self, java.util.Map$Entry entry)

static java.util.Map leftShift(java.util.Map self, java.util.Map other)

Implementation of the right shift (unsigned) operator for integral types.

static java.lang.Number leftShift(java.lang.Number self, java.lang.Number operand)

Support the subscript operator with a range for a byte array

static java.lang.StringBuilder leftShift(java.lang.CharSequence self, java.lang.Object value)

static java.lang.StringBuffer leftShift(java.lang.String self, java.lang.Object value)

static java.lang.StringBuffer leftShift(java.lang.StringBuffer self, java.lang.Object value)

static java.lang.StringBuilder leftShift(java.lang.StringBuilder self, java.lang.Object value)

static java.io.Writer leftShift(java.net.Socket self, java.lang.Object value)

static java.io.OutputStream leftShift(java.net.Socket self, byte[] value)

static java.io.Writer leftShift(java.io.Writer self, java.lang.Object value)

static java.io.Writer leftShift(java.io.OutputStream self, java.lang.Object value)

static void leftShift(java.io.ObjectOutputStream self, java.lang.Object value)

static java.io.OutputStream leftShift(java.io.OutputStream self, java.io.InputStream in)

static java.io.OutputStream leftShift(java.io.OutputStream self, byte[] value)

static java.io.File leftShift(java.io.File file, java.lang.Object text)

static java.io.File leftShift(java.io.File file, byte[] bytes)

static java.io.File leftShift(java.io.File file, java.io.InputStream data)

static boolean matches(java.lang.CharSequence self, java.util.regex.Pattern pattern)

static boolean matches(java.lang.String self, java.util.regex.Pattern pattern)

static java.util.Map$Entry max(java.util.Map self, Closure closure)

static java.lang.Object max(java.util.Collection self)

static java.lang.Object max(java.util.Iterator self)

static java.lang.Object max(java.lang.Object[] self)

static java.lang.Object max(java.util.Collection self, Closure closure)

static java.lang.Object max(java.util.Iterator self, Closure closure)

Selects the maximum value found from the Object array using the closure to determine the correct ordering.

static java.lang.Object max(java.lang.Object[] self, Closure closure)

Selects the maximum value found in the collection using the given comparator.

static java.lang.Object max(java.util.Collection self, java.util.Comparator comparator)

static java.lang.Object max(java.util.Iterator self, java.util.Comparator comparator)

Provide the standard Groovy size() method for Iterator.

static java.lang.Object max(java.lang.Object[] self, java.util.Comparator comparator)

static MetaClass metaClass(java.lang.Class self, Closure closure)

Allows an Enumeration to behave like an Iterator.

static MetaClass metaClass(java.lang.Object self, Closure closure)

An identity function for iterators, supporting 'duck-typing' when trying to get an iterator for each object within a collection, some of which may already be iterators.

static java.lang.Object min(java.util.Collection self)

Adds min() method to Iterator objects.

static java.lang.Object min(java.util.Iterator self)

static java.lang.Object min(java.lang.Object[] self)

static java.lang.Object min(java.util.Collection self, java.util.Comparator comparator)

static java.lang.Object min(java.util.Iterator self, java.util.Comparator comparator)

static java.lang.Object min(java.lang.Object[] self, java.util.Comparator comparator)

static java.lang.Object min(java.util.Collection self, Closure closure)

static java.util.Map$Entry min(java.util.Map self, Closure closure)

static java.lang.Object min(java.util.Iterator self, Closure closure)

Selects the minimum value found from the Object array using the closure to determine the correct ordering.

static java.lang.Object min(java.lang.Object[] self, Closure closure)

Adds max() method to Collection objects.

static java.util.Set minus(java.util.Set self, java.util.Collection removeMe)

Create a Set composed of the elements of the first Set minus the elements from the given Iterable.

static java.util.Set minus(java.util.Set self, java.lang.Iterable removeMe)

Create an array composed of the elements of the first array minus the elements of the given Iterable.

static java.util.Set minus(java.util.Set self, java.lang.Object removeMe)

Create an array composed of the elements of the first array minus the elements of the given array.

static java.lang.Object[] minus(java.lang.Object[] self, java.lang.Iterable removeMe)

Create a List composed of the elements of the first list minus every occurrence of elements of the given Collection.

static java.lang.Object[] minus(java.lang.Object[] self, java.lang.Object[] removeMe)

static java.util.List minus(java.util.List self, java.util.Collection removeMe)

static java.util.List minus(java.util.List self, java.lang.Iterable removeMe)

Create a List composed of the elements of the first list minus every occurrence of elements of the given Iterable.

static java.util.List minus(java.util.List self, java.lang.Object removeMe)

static java.lang.Object[] minus(java.lang.Object[] self, java.lang.Object removeMe)

Flatten a collection.

static java.util.Map minus(java.util.Map self, java.util.Map removeMe)

Flatten an array.

static java.lang.Number minus(java.lang.Character left, java.lang.Number right)

static java.lang.Number minus(java.lang.Number left, java.lang.Character right)

Power of a Number to a certain exponent.

static java.lang.Number minus(java.lang.Character left, java.lang.Character right)

static java.lang.CharSequence minus(java.lang.CharSequence self, java.lang.Object target)

static java.lang.String minus(java.lang.String self, java.lang.Object target)

static void mixin(MetaClass self, java.util.List categoryClasses)

static void mixin(java.lang.Class self, java.util.List categoryClasses)

static void mixin(java.lang.Class self, java.lang.Class categoryClass)

static void mixin(java.lang.Class self, java.lang.Class[] categoryClass)

static void mixin(MetaClass self, java.lang.Class categoryClass)

static void mixin(MetaClass self, java.lang.Class[] categoryClass)

static java.lang.Number mod(java.lang.Number left, java.lang.Number right)

static java.util.List multiply(java.util.Collection self, java.lang.Number factor)

static java.lang.Number multiply(java.lang.Character left, java.lang.Number right)

static java.lang.Number multiply(java.lang.Number left, java.lang.Character right)

static java.lang.Number multiply(java.lang.Character left, java.lang.Character right)

Power of an integer to an integer certain exponent.

static java.lang.Number multiply(java.math.BigDecimal left, java.lang.Double right)

static java.lang.Number multiply(java.math.BigDecimal left, java.math.BigInteger right)

static java.lang.CharSequence multiply(java.lang.CharSequence self, java.lang.Number factor)

static java.lang.String multiply(java.lang.String self, java.lang.Number factor)

static java.io.DataInputStream newDataInputStream(java.io.File file)

static java.io.DataOutputStream newDataOutputStream(java.io.File file)

static java.io.BufferedInputStream newInputStream(java.io.File file)

static java.io.BufferedInputStream newInputStream(java.net.URL url)

static java.io.BufferedInputStream newInputStream(java.net.URL url, java.util.Map parameters)

static java.lang.Object newInstance(java.lang.Class c)

Sets the metaclass for a given class.

static java.lang.Object newInstance(java.lang.Class c, java.lang.Object[] args)

Sets/updates the metaclass for a given class to a closure.

static java.io.ObjectInputStream newObjectInputStream(java.io.File file)

static java.io.ObjectInputStream newObjectInputStream(java.io.InputStream inputStream)

static java.io.ObjectInputStream newObjectInputStream(java.io.InputStream inputStream, java.lang.ClassLoader classLoader)

static java.io.ObjectInputStream newObjectInputStream(java.io.File file, java.lang.ClassLoader classLoader)

static java.io.ObjectOutputStream newObjectOutputStream(java.io.File file)

static java.io.ObjectOutputStream newObjectOutputStream(java.io.OutputStream outputStream)

static java.io.BufferedOutputStream newOutputStream(java.io.File file)

static java.io.PrintWriter newPrintWriter(java.io.File file)

static java.io.PrintWriter newPrintWriter(java.io.File file, java.lang.String charset)

static java.io.PrintWriter newPrintWriter(java.io.Writer writer)

static java.io.BufferedReader newReader(java.io.File file)

static java.io.BufferedReader newReader(java.io.File file, java.lang.String charset)

static java.io.BufferedReader newReader(java.io.InputStream self)

static java.io.BufferedReader newReader(java.io.InputStream self, java.lang.String charset)

static java.io.BufferedReader newReader(java.net.URL url)

static java.io.BufferedReader newReader(java.net.URL url, java.util.Map parameters)

static java.io.BufferedReader newReader(java.net.URL url, java.lang.String charset)

static java.io.BufferedReader newReader(java.net.URL url, java.util.Map parameters, java.lang.String charset)

static java.io.BufferedWriter newWriter(java.io.File file)

static java.io.BufferedWriter newWriter(java.io.File file, boolean append)

static java.io.BufferedWriter newWriter(java.io.File file, java.lang.String charset, boolean append)

static java.io.BufferedWriter newWriter(java.io.File file, java.lang.String charset)

static java.lang.Character next(java.lang.Character self)

Compare a Number and a Character.

static java.lang.Number next(java.lang.Number self)

static java.lang.CharSequence next(java.lang.CharSequence self)

static java.lang.String next(java.lang.String self)

static java.lang.CharSequence normalize(java.lang.CharSequence self)

static java.lang.String normalize(java.lang.String self)

static int numberAwareCompareTo(java.lang.Comparable self, java.lang.Comparable other)

Provides a method that compares two comparables using Groovy's default number aware comparator.

static java.lang.Number or(java.lang.Number left, java.lang.Number right)

static java.util.BitSet or(java.util.BitSet left, java.util.BitSet right)

static java.lang.Boolean or(java.lang.Boolean left, java.lang.Boolean right)

Iterates over the elements of an iterable collection of items and returns the index of the last item that matches the condition specified in the closure.

static java.lang.CharSequence padLeft(java.lang.CharSequence self, java.lang.Number numberOfChars)

static java.lang.CharSequence padLeft(java.lang.CharSequence self, java.lang.Number numberOfChars, java.lang.CharSequence padding)

static java.lang.String padLeft(java.lang.String self, java.lang.Number numberOfChars)

static java.lang.String padLeft(java.lang.String self, java.lang.Number numberOfChars, java.lang.String padding)

static java.lang.CharSequence padRight(java.lang.CharSequence self, java.lang.Number numberOfChars)

static java.lang.CharSequence padRight(java.lang.CharSequence self, java.lang.Number numberOfChars, java.lang.CharSequence padding)

static java.lang.String padRight(java.lang.String self, java.lang.Number numberOfChars)

static java.lang.String padRight(java.lang.String self, java.lang.Number numberOfChars, java.lang.String padding)

static java.util.Set permutations(java.util.List self)

static java.util.Map plus(java.util.Map left, java.util.Map right)

A helper method to allow maps to work with subscript operators

static java.util.Map plus(java.util.Map self, java.util.Collection entries)

static java.lang.Object[] plus(java.lang.Object[] left, java.lang.Object[] right)

static java.lang.Object[] plus(java.lang.Object[] left, java.lang.Object right)

static java.lang.Object[] plus(java.lang.Object[] left, java.util.Collection right)

static java.lang.Object[] plus(java.lang.Object[] left, java.lang.Iterable right)

static java.util.Collection plus(java.util.Collection left, java.util.Collection right)

static java.util.Collection plus(java.util.Collection left, java.lang.Iterable right)

static java.util.List plus(java.util.List self, int index, java.lang.Object[] items)

Creates a new List by inserting all of the elements in the given additions List to the elements from the original List at the specified index.

static java.util.List plus(java.util.List self, int index, java.util.List additions)

Creates a new List by inserting all of the elements in the given Iterable to the elements from this List at the specified index.

static java.util.List plus(java.util.List self, int index, java.lang.Iterable additions)

static java.util.Collection plus(java.util.Collection left, java.lang.Object right)

static java.lang.Number plus(java.lang.Character left, java.lang.Number right)

static java.lang.Number plus(java.lang.Number left, java.lang.Character right)

static java.lang.Number plus(java.lang.Character left, java.lang.Character right)

static java.lang.CharSequence plus(java.lang.CharSequence left, java.lang.Object value)

static java.lang.String plus(java.lang.Number value, java.lang.String right)

static java.lang.String plus(java.lang.String left, java.lang.Object value)

static java.lang.String plus(java.lang.StringBuffer left, java.lang.String value)

static java.lang.Object pop(java.util.List self)

static java.lang.Number power(java.lang.Number self, java.lang.Number exponent)

static java.lang.Number power(java.math.BigDecimal self, java.lang.Integer exponent)

Divide one Character by another.

static java.lang.Number power(java.math.BigInteger self, java.lang.Integer exponent)

Integer Divide a Character by a Number.

static java.lang.Number power(java.lang.Integer self, java.lang.Integer exponent)

Integer Divide a Number by a Character.

static java.lang.Number power(java.lang.Long self, java.lang.Integer exponent)

Integer Divide two Numbers.

static java.lang.Character previous(java.lang.Character self)

static java.lang.Number previous(java.lang.Number self)

@todo maybe a double dispatch thing to handle new large numbers?

static java.lang.CharSequence previous(java.lang.CharSequence self)

static java.lang.String previous(java.lang.String self)

protected static java.lang.Object primitiveArrayGet(java.lang.Object self, int idx)

protected static java.util.List primitiveArrayGet(java.lang.Object self, Range range)

protected static java.util.List primitiveArrayGet(java.lang.Object self, java.util.Collection indices)

Checks whether the array contains the given value.

protected static java.lang.Object primitiveArrayPut(java.lang.Object self, int idx, java.lang.Object newValue)

Checks whether the array contains the given value.

static void print(java.lang.Object self, java.lang.Object value)

Print a value formatted Groovy style to self if it is a Writer, otherwise to the standard output stream.

static void print(java.io.PrintWriter self, java.lang.Object value)

Print a value formatted Groovy style to the print writer.

static void print(java.io.PrintStream self, java.lang.Object value)

static void print(Closure self, java.lang.Object value)

static void print(java.lang.Object self, java.io.PrintWriter out)

static void printf(java.lang.Object self, java.lang.String format, java.lang.Object[] values)

static void printf(java.lang.Object self, java.lang.String format, java.lang.Object arg)

static void println(java.lang.Object self)

static void println(Closure self)

Print a linebreak to the standard output stream.

static void println(java.lang.Object self, java.lang.Object value)

Print a value formatted Groovy style (followed by a newline) to self if it is a Writer, otherwise to the standard output stream.

static void println(java.io.PrintWriter self, java.lang.Object value)

Print a value formatted Groovy style (followed by a newline) to the print writer.

static void println(java.io.PrintStream self, java.lang.Object value)

static void println(Closure self, java.lang.Object value)

static void println(java.lang.Object self, java.io.PrintWriter out)

static boolean push(java.util.List self, java.lang.Object value)

static java.util.Map putAll(java.util.Map self, java.util.Collection entries)

static void putAt(java.lang.Object self, java.lang.String property, java.lang.Object newValue)

static void putAt(java.util.List self, int idx, java.lang.Object value)

A helper method to allow lists to work with subscript operators.

static void putAt(java.util.List self, EmptyRange range, java.lang.Object value)

A helper method to allow lists to work with subscript operators.

static void putAt(java.util.List self, EmptyRange range, java.util.Collection value)

static void putAt(java.util.List self, IntRange range, java.util.Collection col)

List subscript assignment operator when given a range as the index.

static void putAt(java.util.List self, IntRange range, java.lang.Object value)

static void putAt(java.util.List self, java.util.List splice, java.util.List values)

static void putAt(java.util.List self, java.util.List splice, java.lang.Object value)

static java.lang.Object putAt(java.util.Map self, java.lang.Object key, java.lang.Object value)

static void putAt(java.util.BitSet self, IntRange range, boolean value)

Support assigning a range of values with a single assignment statement.

static void putAt(java.util.BitSet self, int index, boolean value)

Converts this array to a List of the same size, with each element added to the list.

static void putAt(java.lang.StringBuffer self, EmptyRange range, java.lang.Object value)

static void putAt(java.lang.StringBuffer self, IntRange range, java.lang.Object value)

static byte[] readBytes(java.io.File file)

static java.lang.String readLine(java.io.Reader self)

static java.util.List readLines(java.lang.CharSequence self)

static java.util.List readLines(java.lang.String self)

static java.util.List readLines(java.io.File file)

static java.util.List readLines(java.io.File file, java.lang.String charset)

static java.util.List readLines(java.io.InputStream stream)

static java.util.List readLines(java.io.InputStream stream, java.lang.String charset)

static java.util.List readLines(java.net.URL self)

static java.util.List readLines(java.net.URL self, java.lang.String charset)

static java.util.List readLines(java.io.Reader reader)

static boolean removeAll(java.util.Collection self, java.lang.Object[] items)

Modifies this collection so that it retains only its elements that are contained in the specified array.

static boolean removeAll(java.util.Collection self, Closure condition)

static boolean renameTo(java.io.File self, java.lang.String newPathName)

static java.lang.CharSequence replaceAll(java.lang.CharSequence self, java.lang.CharSequence regex, java.lang.CharSequence replacement)

static java.lang.CharSequence replaceAll(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)

static java.lang.CharSequence replaceAll(java.lang.CharSequence self, java.util.regex.Pattern pattern, java.lang.CharSequence replacement)

static java.lang.String replaceAll(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.String replaceAll(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.String replaceAll(java.lang.String self, java.util.regex.Pattern pattern, java.lang.String replacement)

static java.lang.String replaceAll(java.lang.String self, java.lang.String regex, Closure closure)

static java.lang.String replaceFirst(java.lang.CharSequence self, java.lang.CharSequence regex, java.lang.CharSequence replacement)

static java.lang.String replaceFirst(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)

static java.lang.CharSequence replaceFirst(java.lang.CharSequence self, java.util.regex.Pattern pattern, java.lang.CharSequence replacement)

static java.lang.String replaceFirst(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.String replaceFirst(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.String replaceFirst(java.lang.String self, java.util.regex.Pattern pattern, java.lang.String replacement)

static java.lang.String replaceFirst(java.lang.String self, java.lang.String regex, Closure closure)

static java.util.List respondsTo(java.lang.Object self, java.lang.String name, java.lang.Object[] argTypes)

static java.util.List respondsTo(java.lang.Object self, java.lang.String name)

static boolean retainAll(java.util.Collection self, java.lang.Object[] items)

Modifies this collection so that it retains only its elements that are matched according to the specified closure condition.

static boolean retainAll(java.util.Collection self, Closure condition)

static java.util.List reverse(java.util.List self)

Reverses the elements in a list.

static java.util.List reverse(java.util.List self, boolean mutate)

Creates a new array containing items which are the same as this array but in reverse order.

static java.lang.Object[] reverse(java.lang.Object[] self)

static java.lang.Object[] reverse(java.lang.Object[] self, boolean mutate)

static java.util.Iterator reverse(java.util.Iterator self)

static java.lang.CharSequence reverse(java.lang.CharSequence self)

static java.lang.String reverse(java.lang.String self)

static java.util.Map reverseEach(java.util.Map self, Closure closure)

static java.util.List reverseEach(java.util.List self, Closure closure)

static java.lang.Object[] reverseEach(java.lang.Object[] self, Closure closure)

static java.lang.Number rightShift(java.lang.Number self, java.lang.Number operand)

Support the subscript operator with a range for a char array

static java.lang.Number rightShiftUnsigned(java.lang.Number self, java.lang.Number operand)

Support the subscript operator with a range for a short array

static int round(java.lang.Float number)

static float round(java.lang.Float number, int precision)

static long round(java.lang.Double number)

static double round(java.lang.Double number, int precision)

Converts the character to uppercase.

static java.util.TimerTask runAfter(java.util.Timer timer, int delay, Closure closure)

Iterates over the elements of an iterable collection of items and returns the index values of the items that match the condition specified in the closure.

static void setBytes(java.io.File file, byte[] bytes)

static void setBytes(java.io.OutputStream os, byte[] bytes)

static void setIndex(java.util.regex.Matcher matcher, int idx)

static void setMetaClass(java.lang.Class self, MetaClass metaClass)

static void setMetaClass(java.lang.Object self, MetaClass metaClass)

static void setMetaClass(GroovyObject self, MetaClass metaClass)

static void setText(java.io.File file, java.lang.String text)

static void setText(java.io.File file, java.lang.String text, java.lang.String charset)

static int size(java.util.Iterator self)

static int size(java.lang.Object[] self)

static int size(boolean[] array)

static int size(byte[] array)

static int size(char[] array)

Converts this array to a List of the same size, with each element added to the list.

static int size(short[] array)

Converts this array to a List of the same size, with each element added to the list.

static int size(int[] array)

static int size(long[] array)

static int size(float[] array)

static int size(double[] array)

static int size(java.lang.CharSequence text)

static long size(java.util.regex.Matcher self)

static int size(java.lang.String text)

static int size(java.lang.StringBuffer buffer)

static long size(java.io.File self)

static java.util.List sort(java.util.Collection self)

static java.util.List sort(java.util.Collection self, boolean mutate)

Sorts the elements from the given map into a new ordered map using the closure as a comparator to determine the ordering.

static java.util.Map sort(java.util.Map self, Closure closure)

static java.util.Map sort(java.util.Map self, java.util.Comparator comparator)

static java.util.Map sort(java.util.Map self)

static java.lang.Object[] sort(java.lang.Object[] self)

static java.lang.Object[] sort(java.lang.Object[] self, boolean mutate)

Sorts the given iterator items into a sorted iterator.

static java.util.Iterator sort(java.util.Iterator self)

static java.util.Iterator sort(java.util.Iterator self, java.util.Comparator comparator)

static java.util.List sort(java.util.Collection self, java.util.Comparator comparator)

static java.util.List sort(java.util.Collection self, boolean mutate, java.util.Comparator comparator)

Sorts the given array into sorted order using the given comparator.

static java.lang.Object[] sort(java.lang.Object[] self, java.util.Comparator comparator)

static java.lang.Object[] sort(java.lang.Object[] self, boolean mutate, java.util.Comparator comparator)

Sorts the given iterator items into a sorted iterator using the Closure to determine the correct ordering.

static java.util.Iterator sort(java.util.Iterator self, Closure closure)

static java.lang.Object[] sort(java.lang.Object[] self, Closure closure)

static java.lang.Object[] sort(java.lang.Object[] self, boolean mutate, Closure closure)

static java.util.List sort(java.util.Collection self, Closure closure)

static java.util.List sort(java.util.Collection self, boolean mutate, Closure closure)

Avoids doing unnecessary work when sorting an already sorted set (i.e. an identity function for an already sorted set).

static java.util.SortedSet sort(java.util.SortedSet self)

Removes the last item from the List.

static java.util.SortedMap sort(java.util.SortedMap self)

static java.util.Collection split(java.lang.Object self, Closure closure)

static java.util.Collection split(java.util.Collection self, Closure closure)

static java.lang.CharSequence[] split(java.lang.CharSequence self)

static java.lang.String[] split(GString self)

static java.lang.String[] split(java.lang.String self)

static java.lang.Object splitEachLine(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)

static java.lang.Object splitEachLine(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.Object splitEachLine(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.Object splitEachLine(java.lang.String self, java.lang.String regex, Closure closure)

static java.lang.Object splitEachLine(java.io.File self, java.lang.String regex, Closure closure)

static java.lang.Object splitEachLine(java.io.File self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.Object splitEachLine(java.io.File self, java.lang.String regex, java.lang.String charset, Closure closure)

static java.lang.Object splitEachLine(java.io.File self, java.util.regex.Pattern pattern, java.lang.String charset, Closure closure)

static java.lang.Object splitEachLine(java.net.URL self, java.lang.String regex, Closure closure)

static java.lang.Object splitEachLine(java.net.URL self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.Object splitEachLine(java.net.URL self, java.lang.String regex, java.lang.String charset, Closure closure)

static java.lang.Object splitEachLine(java.net.URL self, java.util.regex.Pattern pattern, java.lang.String charset, Closure closure)

static java.lang.Object splitEachLine(java.io.Reader self, java.lang.String regex, Closure closure)

static java.lang.Object splitEachLine(java.io.Reader self, java.util.regex.Pattern pattern, Closure closure)

static java.lang.Object splitEachLine(java.io.InputStream stream, java.lang.String regex, java.lang.String charset, Closure closure)

static java.lang.Object splitEachLine(java.io.InputStream stream, java.util.regex.Pattern pattern, java.lang.String charset, Closure closure)

static java.lang.Object splitEachLine(java.io.InputStream stream, java.lang.String regex, Closure closure)

static java.lang.Object splitEachLine(java.io.InputStream stream, java.util.regex.Pattern pattern, Closure closure)

static SpreadMap spread(java.util.Map self)

static java.lang.String sprintf(java.lang.Object self, java.lang.String format, java.lang.Object[] values)

static java.lang.String sprintf(java.lang.Object self, java.lang.String format, java.lang.Object arg)

static void step(java.lang.Number self, java.lang.Number to, java.lang.Number stepNumber, Closure closure)

Get the absolute value

static java.lang.CharSequence stripIndent(java.lang.CharSequence self)

static java.lang.CharSequence stripIndent(java.lang.CharSequence self, int numChars)

static java.lang.String stripIndent(java.lang.String self)

static java.lang.String stripIndent(java.lang.String self, int numChars)

static java.lang.CharSequence stripMargin(java.lang.CharSequence self)

static java.lang.CharSequence stripMargin(java.lang.CharSequence self, char marginChar)

static java.lang.String stripMargin(java.lang.CharSequence self, java.lang.CharSequence marginChar)

static java.lang.String stripMargin(java.lang.String self)

static java.lang.String stripMargin(java.lang.String self, char marginChar)

static java.lang.String stripMargin(java.lang.String self, java.lang.String marginChar)

static java.util.Map subMap(java.util.Map map, java.util.Collection keys)

Looks up an item in a Map for the given key and returns the value - unless there is no entry for the given key in which case add the default value to the map and return that.

static java.util.Set subsequences(java.util.List self)

Finds all permutations of a collection.

static java.lang.Object sum(java.util.Collection self)

Sums the items in an array.

static java.lang.Object sum(java.lang.Object[] self)

static java.lang.Object sum(java.util.Iterator self)

static java.lang.Object sum(java.util.Collection self, java.lang.Object initialValue)

static java.lang.Object sum(java.lang.Object[] self, java.lang.Object initialValue)

static java.lang.Object sum(java.util.Iterator self, java.lang.Object initialValue)

static java.lang.Object sum(java.util.Collection self, Closure closure)

Sums the result of apply a closure to each item of an array.

static java.lang.Object sum(java.lang.Object[] self, Closure closure)

static java.lang.Object sum(java.util.Iterator self, Closure closure)

static java.lang.Object sum(java.util.Collection self, java.lang.Object initialValue, Closure closure)

static java.lang.Object sum(java.lang.Object[] self, java.lang.Object initialValue, Closure closure)

static java.lang.Object sum(java.util.Iterator self, java.lang.Object initialValue, Closure closure)

static java.util.List tail(java.util.List self)

static java.lang.Object[] tail(java.lang.Object[] self)

Returns the first num elements from the head of this list.

static java.util.List take(java.util.List self, int num)

Returns the first num elements from the head of this array.

static java.lang.Object[] take(java.lang.Object[] self, int num)

static java.util.List take(java.lang.Iterable self, int num)

Returns a new map containing the first num elements from the head of this map.

static java.util.Map take(java.util.Map self, int num)

static java.util.Iterator take(java.util.Iterator self, int num)

static java.lang.CharSequence take(java.lang.CharSequence self, int num)

static java.util.List takeWhile(java.util.List self, Closure condition)

static java.util.List takeWhile(java.lang.Iterable self, Closure condition)

Returns the longest prefix of this Map where each entry (or key/value pair) when passed to the given closure evaluates to true.

static java.util.Map takeWhile(java.util.Map self, Closure condition)

Returns the longest prefix of this array where each element passed to the given closure evaluates to true.

static java.lang.Object[] takeWhile(java.lang.Object[] self, Closure condition)

static java.util.Iterator takeWhile(java.util.Iterator self, Closure condition)

static void times(java.lang.Number self, Closure closure)

static java.lang.String toArrayString(java.lang.Object[] self)

static java.math.BigDecimal toBigDecimal(java.lang.Number self)

Logical implication of two boolean operators

static java.math.BigDecimal toBigDecimal(java.lang.CharSequence self)

static java.math.BigDecimal toBigDecimal(java.lang.String self)

static java.math.BigInteger toBigInteger(java.lang.Number self)

Iterates over the elements of an iterable collection of items and returns the index of the first item that matches the condition specified in the closure.

static java.math.BigInteger toBigInteger(java.lang.CharSequence self)

static java.math.BigInteger toBigInteger(java.lang.String self)

static java.lang.Boolean toBoolean(java.lang.Boolean self)

static java.lang.Boolean toBoolean(java.lang.String self)

static java.lang.Character toCharacter(java.lang.String self)

static java.lang.Double toDouble(java.lang.Number self)

Logical disjunction of two boolean operators

static java.lang.Double toDouble(java.lang.CharSequence self)

static java.lang.Double toDouble(java.lang.String self)

static java.lang.Float toFloat(java.lang.Number self)

Logical conjunction of two boolean operators.

static java.lang.Float toFloat(java.lang.CharSequence self)

static java.lang.Float toFloat(java.lang.String self)

static java.lang.Integer toInteger(java.lang.Number self)

static java.lang.Integer toInteger(java.lang.CharSequence self)

static java.lang.Integer toInteger(java.lang.String self)

static java.util.List toList(java.util.Collection self)

Convert an iterator to a List.

static java.util.List toList(java.util.Iterator self)

static java.util.List toList(java.lang.Iterable self)

Convert an enumeration to a List.

static java.util.List toList(java.util.Enumeration self)

static java.util.List toList(java.lang.Object[] array)

static java.util.List toList(byte[] array)

Converts this array to a Set, with each unique element added to the set.

static java.util.List toList(boolean[] array)

Converts this array to a Set, with each unique element added to the set.

static java.util.List toList(char[] array)

Converts this array to a Set, with each unique element added to the set.

static java.util.List toList(short[] array)

Converts this array to a Set, with each unique element added to the set.

static java.util.List toList(int[] array)

Converts this array to a Set, with each unique element added to the set.

static java.util.List toList(long[] array)

Converts this array to a Set, with each unique element added to the set.

static java.util.List toList(float[] array)

Converts this array to a Set, with each unique element added to the set.

static java.util.List toList(double[] array)

Converts this array to a Set, with each unique element added to the set.

static java.util.List toList(java.lang.CharSequence self)

static java.util.List toList(java.lang.String self)

static java.lang.String toListString(java.util.Collection self)

static java.lang.String toListString(java.util.Collection self, int maxSize)

static java.lang.Long toLong(java.lang.Number self)

static java.lang.Long toLong(java.lang.CharSequence self)

static java.lang.Long toLong(java.lang.String self)

static char toLowerCase(java.lang.Character self)

static java.lang.String toMapString(java.util.Map self)

Increment a Character by one.

static java.lang.String toMapString(java.util.Map self, int maxSize)

static java.util.Set toSet(byte[] array)

static java.util.Set toSet(boolean[] array)

static java.util.Set toSet(char[] array)

static java.util.Set toSet(short[] array)

static java.util.Set toSet(int[] array)

Implements the getAt(int) method for primitive type arrays.

static java.util.Set toSet(long[] array)

Implements the getAt(Range) method for primitive type arrays.

static java.util.Set toSet(float[] array)

static java.util.Set toSet(double[] array)

static java.util.Set toSet(java.util.Collection self)

Implements the setAt(int idx) method for primitive type arrays.

static java.util.Set toSet(java.util.Iterator self)

static java.util.Set toSet(java.util.Enumeration self)

static java.util.Set toSet(java.lang.CharSequence self)

static java.util.Set toSet(java.lang.String self)

static java.lang.Short toShort(java.lang.CharSequence self)

static java.lang.Short toShort(java.lang.String self)

static SpreadMap toSpreadMap(java.util.Map self)

Creates a spreadable map from this array.

static SpreadMap toSpreadMap(java.lang.Object[] self)

static SpreadMap toSpreadMap(java.util.List self)

static java.lang.String toString(boolean[] self)

static java.lang.String toString(byte[] self)

static java.lang.String toString(char[] self)

static java.lang.String toString(short[] self)

Returns the string representation of the given list.

static java.lang.String toString(int[] self)

static java.lang.String toString(long[] self)

static java.lang.String toString(float[] self)

static java.lang.String toString(double[] self)

static java.lang.String toString(java.util.AbstractMap self)

static java.lang.String toString(java.util.AbstractCollection self)

static java.lang.String toString(java.lang.Object[] self)

static java.lang.String toString(java.lang.Object value)

static java.net.URI toURI(java.lang.CharSequence self)

static java.net.URI toURI(java.lang.String self)

static java.net.URL toURL(java.lang.CharSequence self)

static java.net.URL toURL(java.lang.String self)

static char toUpperCase(java.lang.Character self)

static java.util.List tokenize(java.lang.CharSequence self)

static java.util.List tokenize(java.lang.CharSequence self, java.lang.Character token)

static java.util.List tokenize(java.lang.CharSequence self, java.lang.CharSequence token)

static java.util.List tokenize(java.lang.String self)

static java.util.List tokenize(java.lang.String self, java.lang.Character token)

static java.util.List tokenize(java.lang.String self, java.lang.String token)

static java.lang.CharSequence tr(java.lang.CharSequence self, java.lang.CharSequence sourceSet, java.lang.CharSequence replacementSet)

static java.lang.String tr(java.lang.String self, java.lang.String sourceSet, java.lang.String replacementSet)

static void transformChar(java.io.Reader self, java.io.Writer writer, Closure closure)

static void transformLine(java.io.Reader reader, java.io.Writer writer, Closure closure)

static java.util.List transpose(java.util.List self)

static void traverse(java.io.File self, java.util.Map options, Closure closure)

static void traverse(java.io.File self, Closure closure)

static void traverse(java.io.File self, java.util.Map options)

static float trunc(java.lang.Float number, int precision)

static float trunc(java.lang.Float number)

static double trunc(java.lang.Double number)

static double trunc(java.lang.Double number, int precision)

static java.lang.Number unaryMinus(java.lang.Number left)

static java.lang.CharSequence unexpand(java.lang.CharSequence self)

static java.lang.CharSequence unexpand(java.lang.CharSequence self, int tabStop)

static java.lang.String unexpand(java.lang.String self)

static java.lang.String unexpand(java.lang.String self, int tabStop)

static java.lang.CharSequence unexpandLine(java.lang.CharSequence self, int tabStop)

static java.lang.String unexpandLine(java.lang.String self, int tabStop)

static java.util.Iterator unique(java.util.Iterator self)

static java.util.Collection unique(java.util.Collection self)

static java.util.Collection unique(java.util.Collection self, boolean mutate)

static java.util.Iterator unique(java.util.Iterator self, Closure closure)

static java.util.Collection unique(java.util.Collection self, Closure closure)

static java.util.Collection unique(java.util.Collection self, boolean mutate, Closure closure)

static java.util.Iterator unique(java.util.Iterator self, java.util.Comparator comparator)

Returns an iterator equivalent to this iterator with all duplicated items removed by using the supplied comparator.

static java.util.Collection unique(java.util.Collection self, java.util.Comparator comparator)

static java.util.Collection unique(java.util.Collection self, boolean mutate, java.util.Comparator comparator)

static void upto(java.lang.Number self, java.lang.Number to, Closure closure)

static void upto(long self, java.lang.Number to, Closure closure)

static void upto(java.lang.Long self, java.lang.Number to, Closure closure)

static void upto(float self, java.lang.Number to, Closure closure)

static void upto(java.lang.Float self, java.lang.Number to, Closure closure)

Iterates from this number up to the given number, inclusive, incrementing by one each time.

static void upto(double self, java.lang.Number to, Closure closure)

static void upto(java.lang.Double self, java.lang.Number to, Closure closure)

Iterates from this number down to the given number, inclusive, decrementing by one each time.

static void upto(java.math.BigInteger self, java.lang.Number to, Closure closure)

Iterates from this number down to the given number, inclusive, decrementing by one each time.

static void upto(java.math.BigDecimal self, java.lang.Number to, Closure closure)

Iterates from this number down to the given number, inclusive, decrementing by one each time.

static java.lang.Object use(java.lang.Object self, java.lang.Class categoryClass, Closure closure)

Scoped use method

static java.lang.Object use(java.lang.Object self, java.util.List categoryClassList, Closure closure)

static java.lang.Object use(java.lang.Object self, java.lang.Object[] array)

static java.lang.Object with(java.lang.Object self, Closure closure)

static java.lang.Object withDataInputStream(java.io.File file, Closure closure)

static java.lang.Object withDataOutputStream(java.io.File file, Closure closure)

static java.util.Map withDefault(java.util.Map self, Closure init)

An alias for withLazyDefault which decorates a list allowing it to grow when called with index values outside the normal list bounds.

static java.util.List withDefault(java.util.List self, Closure init)

static java.util.List withEagerDefault(java.util.List self, Closure init)

Sorts the Collection.

static java.lang.Object withInputStream(java.io.File file, Closure closure)

static java.lang.Object withInputStream(java.net.URL url, Closure closure)

static java.util.List withLazyDefault(java.util.List self, Closure init)

static java.lang.Object withObjectInputStream(java.io.File file, Closure closure)

static java.lang.Object withObjectInputStream(java.io.File file, java.lang.ClassLoader classLoader, Closure closure)

static java.lang.Object withObjectInputStream(java.io.InputStream inputStream, Closure closure)

static java.lang.Object withObjectInputStream(java.io.InputStream inputStream, java.lang.ClassLoader classLoader, Closure closure)

static java.lang.Object withObjectOutputStream(java.io.File file, Closure closure)

static java.lang.Object withObjectOutputStream(java.io.OutputStream outputStream, Closure closure)

static java.lang.Object withObjectStreams(java.net.Socket socket, Closure closure)

static java.lang.Object withOutputStream(java.io.File file, Closure closure)

static java.lang.Object withPrintWriter(java.io.File file, Closure closure)

static java.lang.Object withPrintWriter(java.io.File file, java.lang.String charset, Closure closure)

static java.lang.Object withPrintWriter(java.io.Writer writer, Closure closure)

static java.lang.Object withReader(java.io.File file, Closure closure)

static java.lang.Object withReader(java.io.File file, java.lang.String charset, Closure closure)

static java.lang.Object withReader(java.io.Reader reader, Closure closure)

static java.lang.Object withReader(java.net.URL url, Closure closure)

static java.lang.Object withReader(java.net.URL url, java.lang.String charset, Closure closure)

static java.lang.Object withReader(java.io.InputStream in, Closure closure)

static java.lang.Object withReader(java.io.InputStream in, java.lang.String charset, Closure closure)

static java.lang.Object withStream(java.io.InputStream stream, Closure closure)

static java.lang.Object withStream(java.io.OutputStream os, Closure closure)

static java.lang.Object withStreams(java.net.Socket socket, Closure closure)

static java.lang.Object withWriter(java.io.File file, Closure closure)

static java.lang.Object withWriter(java.io.File file, java.lang.String charset, Closure closure)

static java.lang.Object withWriter(java.io.Writer writer, Closure closure)

static java.lang.Object withWriter(java.io.OutputStream stream, Closure closure)

static java.lang.Object withWriter(java.io.OutputStream stream, java.lang.String charset, Closure closure)

static java.lang.Object withWriterAppend(java.io.File file, java.lang.String charset, Closure closure)

static java.lang.Object withWriterAppend(java.io.File file, Closure closure)

static void write(java.io.Writer self, Writable writable)

static void write(java.io.File file, java.lang.String text)

static void write(java.io.File file, java.lang.String text, java.lang.String charset)

static void writeLine(java.io.BufferedWriter writer, java.lang.String line)

static java.util.BitSet xor(java.util.BitSet left, java.util.BitSet right)

static java.lang.Number xor(java.lang.Number left, java.lang.Number right)

static java.lang.Boolean xor(java.lang.Boolean left, java.lang.Boolean right)

 
Methods inherited from class DefaultGroovyMethodsSupport
cloneSimilarCollection, cloneSimilarMap, closeQuietly, closeWithWarning, createSimilarArray, createSimilarCollection, createSimilarCollection, createSimilarList, createSimilarMap, createSimilarOrDefaultCollection, createSimilarSet, normaliseIndex, sameType, subListBorders, subListBorders
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

DGM_LIKE_CLASSES

public static final java.lang.Class[] DGM_LIKE_CLASSES


additionals

public static final java.lang.Class[] additionals


 
Method Detail

abs

public static int abs(java.lang.Number number)
Truncate the value
Parameters:
number - a Float
precision - the number of decimal places to keep
Returns:
the Float truncated to the number of decimal places specified by precision
Since:
1.6.0


abs

public static long abs(java.lang.Long number)
Truncate the value
Parameters:
number - a Double
precision - the number of decimal places to keep
Returns:
the Double truncated to the number of decimal places specified by precision
Since:
1.6.4


abs

public static float abs(java.lang.Float number)
Determine if a Character is uppercase. Synonym for 'Character.isUpperCase(this)'.
Parameters:
self - a Character
Returns:
true if the character is uppercase
See Also:
java.lang.Character#isUpperCase(char)
Since:
1.5.7


abs

public static double abs(java.lang.Double number)


accept

public static java.net.Socket accept(java.net.ServerSocket serverSocket, Closure closure)


accept

public static java.net.Socket accept(java.net.ServerSocket serverSocket, boolean runInANewThread, Closure closure)


addAll

public static boolean addAll(java.util.Collection self, java.lang.Object[] items)


addAll

public static boolean addAll(java.util.List self, int index, java.lang.Object[] items)
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.
Parameters:
self - an Object with an Iterator returning its values
closure - a closure condition
Returns:
a List whose first item is the accepted values and whose second item is the rejected values
Since:
1.6.0


addShutdownHook

public static void addShutdownHook(java.lang.Object self, Closure closure)


and

public static java.lang.Number and(java.lang.Number left, java.lang.Number right)


and

public static java.util.BitSet and(java.util.BitSet left, java.util.BitSet right)


and

public static java.lang.Boolean and(java.lang.Boolean left, java.lang.Boolean right)
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.
Parameters:
self - the iteration object over which to iterate
startIndex - start matching from this index
closure - the filter to perform a match on the collection
Returns:
an integer that is the index of the first matched object or -1 if no match was found
Since:
1.5.0


any

public static boolean any(java.lang.Object self, Closure closure)


any

public static boolean any(java.util.Map self, Closure closure)


any

public static boolean any(java.lang.Object self)


append

}
public static void append(java.io.File file, java.lang.Object text)


append

}
public static void append(java.io.File file, byte[] bytes)


append

}
public static void append(java.io.File self, java.io.InputStream stream)


append

}
public static void append(java.io.File file, java.lang.Object text, java.lang.String charset)


asBoolean

public static boolean asBoolean(java.lang.Object object)
Coerce a collection instance to a boolean value. A collection is coerced to false if it's empty, and to true otherwise.
assert [1,2].asBoolean() == true
assert [].asBoolean() == false
Parameters:
collection - the collection
Returns:
the boolean value
Since:
1.7.0


asBoolean

public static boolean asBoolean(java.lang.Boolean bool)


asBoolean

public static boolean asBoolean(java.util.Collection collection)
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.
Parameters:
iterator - the iterator
Returns:
the boolean value
Since:
1.7.0


asBoolean

public static boolean asBoolean(java.util.Map map)
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.
Parameters:
enumeration - the enumeration
Returns:
the boolean value
Since:
1.7.0


asBoolean

public static boolean asBoolean(java.util.Iterator iterator)
Coerce an Object array to a boolean value. An Object array is false if the array is of length 0. and to true otherwise
Parameters:
array - the array
Returns:
the boolean value
Since:
1.7.0


asBoolean

public static boolean asBoolean(java.util.Enumeration enumeration)
Coerces a byte array to a boolean value. A byte array is false if the array is of length 0, and true otherwise.
Parameters:
array - an array
Returns:
the array's boolean value
Since:
1.7.4


asBoolean

public static boolean asBoolean(java.lang.Object[] array)
Coerces a short array to a boolean value. A short array is false if the array is of length 0, and true otherwise.
Parameters:
array - an array
Returns:
the array's boolean value
Since:
1.7.4


asBoolean

public static boolean asBoolean(byte[] array)
Coerces an int array to a boolean value. An int array is false if the array is of length 0, and true otherwise.
Parameters:
array - an array
Returns:
the array's boolean value
Since:
1.7.4


asBoolean

public static boolean asBoolean(short[] array)
Coerces a long array to a boolean value. A long array is false if the array is of length 0, and true otherwise.
Parameters:
array - an array
Returns:
the array's boolean value
Since:
1.7.4


asBoolean

public static boolean asBoolean(int[] array)
Coerces a float array to a boolean value. A float array is false if the array is of length 0, and true otherwise.
Parameters:
array - an array
Returns:
the array's boolean value
Since:
1.7.4


asBoolean

public static boolean asBoolean(long[] array)
Coerces a double array to a boolean value. A double array is false if the array is of length 0, and true otherwise.
Parameters:
array - an array
Returns:
the array's boolean value
Since:
1.7.4


asBoolean

public static boolean asBoolean(float[] array)
Coerces a boolean array to a boolean value. A boolean array is false if the array is of length 0, and true otherwise.
Parameters:
array - an array
Returns:
the array's boolean value
Since:
1.7.4


asBoolean

public static boolean asBoolean(double[] array)
Coerces a char array to a boolean value. A char array is false if the array is of length 0, and true otherwise.
Parameters:
array - an array
Returns:
the array's boolean value
Since:
1.7.4


asBoolean

public static boolean asBoolean(boolean[] array)
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.
Parameters:
character - the character
Returns:
the boolean value
Since:
1.7.0


asBoolean

public static boolean asBoolean(char[] array)
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.
Parameters:
number - the number
Returns:
the boolean value
Since:
1.7.0


asBoolean

public static boolean asBoolean(java.lang.Character character)


asBoolean

public static boolean asBoolean(java.lang.Number number)


asBoolean

@Deprecated
public static boolean asBoolean(java.lang.CharSequence string)


asBoolean

@Deprecated
public static boolean asBoolean(java.util.regex.Matcher matcher)


asImmutable

public static java.util.Map asImmutable(java.util.Map self)
A convenience method for creating an immutable sorted map.
Parameters:
self - a SortedMap
Returns:
an immutable SortedMap
See Also:
java.util.Collections#unmodifiableSortedMap(java.util.SortedMap)
Since:
1.0


asImmutable

public static java.util.SortedMap asImmutable(java.util.SortedMap self)


asImmutable

public static java.util.List asImmutable(java.util.List self)


asImmutable

public static java.util.Set asImmutable(java.util.Set self)


asImmutable

public static java.util.SortedSet asImmutable(java.util.SortedSet self)


asImmutable

public static java.util.Collection asImmutable(java.util.Collection self)
A convenience method for creating a synchronized SortedMap.
Parameters:
self - a SortedMap
Returns:
a synchronized SortedMap
See Also:
java.util.Collections#synchronizedSortedMap(java.util.SortedMap)
Since:
1.0


asList

public static java.util.List asList(java.util.Collection self)
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.
Parameters:
object - the object to coerce
Returns:
the boolean value
Since:
1.7.0


asSynchronized

public static java.util.Map asSynchronized(java.util.Map self)


asSynchronized

public static java.util.SortedMap asSynchronized(java.util.SortedMap self)


asSynchronized

public static java.util.Collection asSynchronized(java.util.Collection self)


asSynchronized

public static java.util.List asSynchronized(java.util.List self)


asSynchronized

public static java.util.Set asSynchronized(java.util.Set self)


asSynchronized

public static java.util.SortedSet asSynchronized(java.util.SortedSet self)


asType

} catch (GroovyCastException e) {
public static java.lang.Object asType(java.util.Collection col, java.lang.Class clazz)


asType

}
public static java.lang.Object asType(java.lang.Object[] ary, java.lang.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)}.
Parameters:
ary - an array
clazz - the desired class
Returns:
the object resulting from this type conversion
See Also:
asType(java.lang.Object, java.lang.Class)
Since:
1.5.1


asType

if (!(clazz.isInstance(map)) && clazz.isInterface()) {
public static java.lang.Object asType(Closure cl, java.lang.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.
Parameters:
map - this map
clazz - the target type
Returns:
a Proxy of the given type, which defers calls to this map's elements.
Since:
1.0


asType

* @since 1.0
public static java.lang.Object asType(java.util.Map map, java.lang.Class clazz)


asType

* Traverse through each byte of this byte array. Alias for each.
public static java.lang.Object asType(java.lang.Number self, java.lang.Class c)
Traverse through each byte of this Byte array. Alias for each.
Parameters:
self - a Byte array
closure - a closure
See Also:
each(java.lang.Object, groovy.lang.Closure)
Since:
1.5.5


asType

if (mc instanceof ExpandoMetaClass
public static java.lang.Object asType(java.lang.Object obj, java.lang.Class type)
Adds a "metaClass" property to all class objects so you can use the syntax String.metaClass.myMethod = { println "foo" }
Parameters:
c - The java.lang.Class instance
Returns:
An MetaClass instance
Since:
1.5.0


asType

@Deprecated
public static java.lang.Object asType(java.lang.CharSequence self, java.lang.Class c)


asType

@Deprecated
public static String eachMatch(String self, String regex, Closure closure) {
public static java.lang.Object asType(GString self, java.lang.Class c)


asType

public static CharSequence expand(CharSequence self) {
return StringGroovyMethods.expand(self);
public static java.lang.Object asType(java.lang.String self, java.lang.Class c)


asType

public static java.lang.Object asType(java.io.File f, java.lang.Class c)


asWritable

public static java.io.File asWritable(java.io.File file)


asWritable

public static java.io.File asWritable(java.io.File file, java.lang.String encoding)


bitwiseNegate

public static java.util.BitSet bitwiseNegate(java.util.BitSet self)
Iterates from this number up to the given number, inclusive, incrementing by one each time.
Parameters:
self - a long
to - the end number
closure - the code to execute for each number
Since:
1.0


bitwiseNegate

return StringGroovyMethods.expand(self, tabStop);
public static java.util.regex.Pattern bitwiseNegate(java.lang.CharSequence self)


bitwiseNegate

return StringGroovyMethods.expand(self);
public static java.util.regex.Pattern bitwiseNegate(java.lang.String self)


callClosureForLine

protected static java.lang.Object callClosureForLine(Closure closure, java.lang.String line, int counter)


callClosureForMapEntry

protected static java.lang.Object callClosureForMapEntry(Closure closure, java.util.Map$Entry entry)


callClosureForMapEntryAndCounter

protected static java.lang.Object callClosureForMapEntryAndCounter(Closure closure, java.util.Map$Entry entry, int counter)


capitalize

return StringGroovyMethods.expand(self, tabStop);
public static java.lang.CharSequence capitalize(java.lang.CharSequence self)


capitalize

return StringGroovyMethods.expandLine(self, tabStop);
public static java.lang.String capitalize(java.lang.String self)


center

return StringGroovyMethods.expandLine(self, tabStop);
public static java.lang.CharSequence center(java.lang.CharSequence self, java.lang.Number numberOfChars)


center

return StringGroovyMethods.find(self, regex);
public static java.lang.CharSequence center(java.lang.CharSequence self, java.lang.Number numberOfChars, java.lang.CharSequence padding)


center

return StringGroovyMethods.find(self, regex, closure);
public static java.lang.String center(java.lang.String self, java.lang.Number numberOfChars)


center

return StringGroovyMethods.find(self, pattern);
public static java.lang.String center(java.lang.String self, java.lang.Number numberOfChars, java.lang.String padding)


collate

public static java.util.List collate(java.util.List self, int size)


collate

public static java.util.List collate(java.util.List self, int size, int step)


collate

public static java.util.List collate(java.util.List self, int size, boolean keepRemainder)


collate

public static java.util.List collate(java.util.List self, int size, int step, boolean keepRemainder)


collect

public static java.util.List collect(java.lang.Object self, Closure transform)
Iterates through this aggregate Object transforming each item into a new value using the transform closure, returning a list of transformed values. Example:
def list = [1, 'a', 1.23, true ]
 def types = list.collect { it.class }
 assert types == [Integer, String, BigDecimal, Boolean]
Parameters:
self - an aggregate Object with an Iterator returning its items
transform - the closure used to transform each item of the aggregate object
Returns:
a List of the transformed values
Since:
1.0


collect

public static java.util.Collection collect(java.lang.Object self)
Iterates through this aggregate Object transforming each item into a new value using the transform closure and adding it to the supplied collector.
Parameters:
self - an aggregate Object with an Iterator returning its items
collector - the Collection to which the transformed values are added
transform - the closure used to transform each item of the aggregate object
Returns:
the collector with all transformed values added to it
Since:
1.0


collect

public static java.util.Collection collect(java.lang.Object self, java.util.Collection collector, Closure transform)


collect

public static java.util.List collect(java.util.Collection self, Closure transform)
Iterates through this collection transforming each entry into a new value using Closure.IDENTITY as a transformer, basically returning a list of items copied from the original collection.
assert [1,2,3] == [1,2,3].collect()
Parameters:
self - a collection
Returns:
a List of the transformed values
See Also:
Closure.IDENTITY
Since:
1.8.5


collect

public static java.util.List collect(java.util.Collection self)
Iterates through this collection transforming each value into a new value using the transform closure and adding it to the supplied collector.
assert [1,2,3] as HashSet == [2,4,5,6].collect(new HashSet()) { (int)(it / 2) }
Parameters:
self - a collection
collector - the Collection to which the transformed values are added
transform - the closure used to transform each item of the collection
Returns:
the collector with all transformed values added to it
Since:
1.0


collect

public static java.util.Collection collect(java.util.Collection self, java.util.Collection collector, Closure transform)


collect

public static java.util.Collection collect(java.util.Map self, java.util.Collection collector, Closure transform)


collect

public static java.util.List collect(java.util.Map self, Closure transform)


collectAll

public static java.util.List collectAll(java.util.Collection self, Closure transform)


collectAll

public static java.util.Collection collectAll(java.util.Collection self, java.util.Collection collector, Closure transform)


collectEntries

public static java.util.Map collectEntries(java.util.Map self, java.util.Map collector, Closure transform)


collectEntries

public static java.util.Map collectEntries(java.util.Map self, Closure transform)


collectEntries

public static java.util.Map collectEntries(java.util.Collection self, Closure transform)
A variant of collectEntries for Iterators.
Parameters:
self - an Iterator
transform - the closure used for transforming, which has an item from self as the parameter and should return a Map.Entry, a Map or a two-element list containing the resulting key and value
Returns:
a Map of the transformed entries
See Also:
collectEntries(Collection, Closure)
Since:
1.8.7


collectEntries

public static java.util.Map collectEntries(java.util.Iterator self, Closure transform)
A variant of collectEntries for Iterables.
Parameters:
self - an Iterable
transform - the closure used for transforming, which has an item from self as the parameter and should return a Map.Entry, a Map or a two-element list containing the resulting key and value
Returns:
a Map of the transformed entries
See Also:
collectEntries(Iterator, Closure)
Since:
1.8.7


collectEntries

public static java.util.Map collectEntries(java.lang.Iterable self, Closure transform)


collectEntries

public static java.util.Map collectEntries(java.util.Collection self)
A variant of collectEntries for Iterators using the identity closure as the transform.
Parameters:
self - an Iterator
Returns:
a Map of the transformed entries
See Also:
collectEntries(Collection)
Since:
1.8.7


collectEntries

public static java.util.Map collectEntries(java.util.Iterator self)
A variant of collectEntries for Iterables using the identity closure as the transform.
Parameters:
self - an Iterable
Returns:
a Map of the transformed entries
See Also:
collectEntries(Iterator)
Since:
1.8.7


collectEntries

public static java.util.Map collectEntries(java.lang.Iterable self)


collectEntries

public static java.util.Map collectEntries(java.util.Collection self, java.util.Map collector, Closure transform)


collectEntries

public static java.util.Map collectEntries(java.util.Iterator self, java.util.Map collector, Closure transform)
A variant of collectEntries for Iterables using a supplied map as the destination of transformed entries.
Parameters:
self - an Iterable
collector - the Map into which the transformed entries are put
transform - the closure used for transforming, which has an item from self as the parameter and should return a Map.Entry, a Map or a two-element list containing the resulting key and value
Returns:
the collector with all transformed values added to it
See Also:
collectEntries(Iterator, Map, Closure)
Since:
1.8.7


collectEntries

public static java.util.Map collectEntries(java.lang.Iterable self, java.util.Map collector, Closure transform)
A variant of collectEntries for Collections using the identity closure as the transform and a supplied map as the destination of transformed entries.
Parameters:
self - a Collection
collector - the Map into which the transformed entries are put
Returns:
the collector with all transformed values added to it
See Also:
collectEntries(Collection, Map, Closure)
Since:
1.8.5


collectEntries

public static java.util.Map collectEntries(java.util.Collection self, java.util.Map collector)
A variant of collectEntries for Iterators using the identity closure as the transform and a supplied map as the destination of transformed entries.
Parameters:
self - an Iterator
collector - the Map into which the transformed entries are put
Returns:
the collector with all transformed values added to it
See Also:
collectEntries(Collection, Map)
Since:
1.8.7


collectEntries

public static java.util.Map collectEntries(java.util.Iterator self, java.util.Map collector)
A variant of collectEntries for Iterables using the identity closure as the transform and a supplied map as the destination of transformed entries.
Parameters:
self - an Iterable
collector - the Map into which the transformed entries are put
Returns:
the collector with all transformed values added to it
See Also:
collectEntries(Iterator, Map)
Since:
1.8.7


collectEntries

public static java.util.Map collectEntries(java.lang.Iterable self, java.util.Map collector)


collectEntries

public static java.util.Map collectEntries(java.lang.Object[] self, java.util.Map collector, Closure transform)
A variant of collectEntries using the identity closure as the transform.
Parameters:
self - an Object array
collector - the Map into which the transformed entries are put
Returns:
the collector with all transformed values added to it
See Also:
collectEntries(Object[], Map, Closure)
Since:
1.8.5


collectEntries

public static java.util.Map collectEntries(java.lang.Object[] self, java.util.Map collector)


collectEntries

public static java.util.Map collectEntries(java.lang.Object[] self, Closure transform)
A variant of collectEntries using the identity closure as the transform.
Parameters:
self - an Object array
Returns:
the collector with all transformed values added to it
See Also:
collectEntries(Object[], Closure)
Since:
1.8.5


collectEntries

public static java.util.Map collectEntries(java.lang.Object[] self)


collectMany

public static java.util.List collectMany(java.util.Collection self, Closure projection)
Projects each item from a source collection to a collection and concatenates (flattens) the resulting collections into a single list.

 def nums = 1..10
 def squaresAndCubesOfEvens = nums.collectMany{ it % 2 ? [] : [it**2, it**3] }
 assert squaresAndCubesOfEvens == [4, 8, 16, 64, 36, 216, 64, 512, 100, 1000]

 def animals = ['CAT', 'DOG', 'ELEPHANT'] as Set
 def smallAnimals = animals.collectMany{ it.size() > 3 ? [] : [it.toLowerCase()] }
 assert smallAnimals == ['cat', 'dog']

 def orig = nums as Set
 def origPlusIncrements = orig.collectMany{ [it, it+1] }
 assert origPlusIncrements.size() == orig.size() * 2
 assert origPlusIncrements.unique().size() == orig.size() + 1
 
Parameters:
self - a collection
projection - a projecting Closure returning a collection of items
Returns:
a list created from the projected collections concatenated (flattened) together
See Also:
sum(java.util.Collection, groovy.lang.Closure)
Since:
1.8.1


collectMany

public static java.util.Collection collectMany(java.util.Collection self, java.util.Collection collector, Closure projection)


collectMany

public static java.util.List collectMany(java.lang.Object[] self, Closure projection)


collectMany

public static java.util.List collectMany(java.util.Iterator self, Closure projection)


collectNested

public static java.util.List collectNested(java.util.Collection self, Closure transform)
Deprecated alias for collectNested
deprecated:
Use collectNested instead
See Also:
collectNested(Collection, Collection, Closure)


collectNested

public static java.util.Collection collectNested(java.util.Collection self, java.util.Collection collector, Closure transform)


combinations

public static java.util.List combinations(java.util.Collection self)
Finds all non-null subsequences of a list.

Example usage:

def result = [1, 2, 3].subsequences()
 assert result == [[1, 2, 3], [1, 3], [2, 3], [1, 2], [1], [2], [3]] as Set
Parameters:
self - the List of items
Returns:
the subsequences from the list
Since:
1.7.0


compareTo

public static int compareTo(java.lang.Character left, java.lang.Number right)


compareTo

public static int compareTo(java.lang.Number left, java.lang.Character right)


compareTo

public static int compareTo(java.lang.Character left, java.lang.Character right)


compareTo

public static int compareTo(java.lang.Number left, java.lang.Number right)


contains

public static boolean contains(int[] self, java.lang.Object value)
Checks whether the array contains the given value.
Parameters:
self - the array we are searching
value - the value being searched for
Returns:
true if the array contains the value
Since:
1.8.6


contains

public static boolean contains(long[] self, java.lang.Object value)
Checks whether the array contains the given value.
Parameters:
self - the array we are searching
value - the value being searched for
Returns:
true if the array contains the value
Since:
1.8.6


contains

public static boolean contains(short[] self, java.lang.Object value)
Returns the string representation of the given array.
Parameters:
self - an array
Returns:
the string representation
Since:
1.6.0


contains

public static boolean contains(char[] self, java.lang.Object value)
Returns the string representation of the given array.
Parameters:
self - an array
Returns:
the string representation
Since:
1.6.0


contains

public static boolean contains(boolean[] self, java.lang.Object value)
Returns the string representation of the given array.
Parameters:
self - an array
Returns:
the string representation
Since:
1.6.0


contains

public static boolean contains(double[] self, java.lang.Object value)
Returns the string representation of the given array.
Parameters:
self - an array
Returns:
the string representation
Since:
1.6.0


contains

public static boolean contains(float[] self, java.lang.Object value)


contains

public static boolean contains(byte[] self, java.lang.Object value)
Returns the string representation of the given array.
Parameters:
self - an array
Returns:
the string representation
Since:
1.6.0


contains

public static boolean contains(java.lang.Object[] self, java.lang.Object value)
Returns the string representation of the given map.
Parameters:
self - a Map
Returns:
the string representation
See Also:
toMapString(java.util.Map)
Since:
1.0


contains

return StringGroovyMethods.find(self, pattern, closure);
public static boolean contains(java.lang.CharSequence self, java.lang.CharSequence text)


contains

return StringGroovyMethods.find(self, pattern);
public static boolean contains(java.lang.String self, java.lang.String text)


containsAll

public static boolean containsAll(java.util.Collection self, java.lang.Object[] items)
Modifies this collection by removing its elements that are contained within the specified object array. See also findAll and grep when wanting to produce a new list containing items which don't match some criteria while leaving the original collection unchanged.
Parameters:
self - a Collection to be modified
items - array containing elements to be removed from this collection
Returns:
true if this collection changed as a result of the call
See Also:
java.util.Collection#removeAll(java.util.Collection)
Since:
1.7.2


count

public static java.lang.Number count(java.util.Iterator self, java.lang.Object value)


count

public static java.lang.Number count(java.util.Iterator self, Closure closure)
Counts the number of occurrences which satisfy the given closure from the items within this Iterator. The iterator will become exhausted of elements after determining the count value.

Example usage:

assert [2,4,2,1,3,5,2,4,3].toSet().iterator().count{ it % 2 == 0 } == 2
Parameters:
self - the Iterator from which we count the number of matching occurrences
closure - a closure condition
Returns:
the number of occurrences
Since:
1.8.0


count

public static java.lang.Number count(java.util.Collection self, java.lang.Object value)


count

public static java.lang.Number count(java.util.Collection self, Closure closure)


count

public static java.lang.Number count(java.util.Map self, Closure closure)


count

public static java.lang.Number count(java.lang.Object[] self, java.lang.Object value)
Counts the number of occurrences which satisfy the given closure from inside this array.
Parameters:
self - the array within which we count the number of occurrences
closure - a closure condition
Returns:
the number of occurrences
Since:
1.8.0


count

public static java.lang.Number count(java.lang.Object[] self, Closure closure)
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) ).
Parameters:
self - the array within which we count the number of occurrences
value - the value being searched for
Returns:
the number of occurrences
Since:
1.6.4


count

public static java.lang.Number count(int[] self, java.lang.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) ).
Parameters:
self - the array within which we count the number of occurrences
value - the value being searched for
Returns:
the number of occurrences
Since:
1.6.4


count

public static java.lang.Number count(long[] self, java.lang.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) ).
Parameters:
self - the array within which we count the number of occurrences
value - the value being searched for
Returns:
the number of occurrences
Since:
1.6.4


count

public static java.lang.Number count(short[] self, java.lang.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) ).
Parameters:
self - the array within which we count the number of occurrences
value - the value being searched for
Returns:
the number of occurrences
Since:
1.6.4


count

public static java.lang.Number count(char[] self, java.lang.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) ).
Parameters:
self - the array within which we count the number of occurrences
value - the value being searched for
Returns:
the number of occurrences
Since:
1.6.4


count

public static java.lang.Number count(boolean[] self, java.lang.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) ).
Parameters:
self - the array within which we count the number of occurrences
value - the value being searched for
Returns:
the number of occurrences
Since:
1.6.4


count

public static java.lang.Number count(double[] self, java.lang.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) ).
Parameters:
self - the array within which we count the number of occurrences
value - the value being searched for
Returns:
the number of occurrences
Since:
1.6.4


count

public static java.lang.Number count(float[] self, java.lang.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) ).
Parameters:
self - the array within which we count the number of occurrences
value - the value being searched for
Returns:
the number of occurrences
Since:
1.6.4


count

public static java.lang.Number count(byte[] self, java.lang.Object value)


count

return StringGroovyMethods.find(self, pattern, closure);
public static int count(java.lang.CharSequence self, java.lang.CharSequence text)


count

return StringGroovyMethods.find(self, regex);
public static int count(java.lang.String self, java.lang.String text)


countBy

public static java.util.Map countBy(java.util.Collection self, Closure closure)
Sorts all array members into groups determined by the supplied mapping closure and counts the group size. The closure should return the key that each item should be grouped by. The returned Map will have an entry for each distinct key returned from the closure, with each value being the frequency of items occurring for that group.

Example usage:

assert ([1,2,2,2,3] as Object[]).countBy{ it % 2 } == [1:2, 0:3]
Parameters:
self - an object array to group and count
closure - a closure mapping items to the frequency keys
Returns:
a new Map grouped by keys with frequency counts
See Also:
countBy(Collection, Closure)
Since:
1.8.0


countBy

public static java.util.Map countBy(java.lang.Object[] self, Closure closure)
Sorts all iterator items into groups determined by the supplied mapping closure and counts the group size. The closure should return the key that each item should be grouped by. The returned Map will have an entry for each distinct key returned from the closure, with each value being the frequency of items occurring for that group.

Example usage:

assert [1,2,2,2,3].toSet().iterator().countBy{ it % 2 } == [1:2, 0:1]
Parameters:
self - an iterator to group and count
closure - a closure mapping items to the frequency keys
Returns:
a new Map grouped by keys with frequency counts
See Also:
countBy(Collection, Closure)
Since:
1.8.0


countBy

public static java.util.Map countBy(java.util.Iterator self, Closure closure)


countBy

public static java.util.Map countBy(java.util.Map self, Closure closure)
Groups the current element according to the value
Parameters:
answer - the map containing the results
element - the element to be placed
value - the value according to which the element will be placed
Since:
1.5.0


createStringBufferWriter

return StringGroovyMethods.find(self, regex, closure);
protected static StringBufferWriter createStringBufferWriter(java.lang.StringBuffer self)


createStringWriter

return StringGroovyMethods.findAll(self, regex);
protected static java.io.StringWriter createStringWriter(java.lang.String self)


deleteDir

public static boolean deleteDir(java.io.File self)


denormalize

public static java.lang.CharSequence denormalize(java.lang.CharSequence self)


denormalize

public static java.lang.String denormalize(java.lang.String self)


disjoint

public static boolean disjoint(java.util.Collection left, java.util.Collection right)
Compare the contents of this array to the contents of the given array.
Parameters:
left - an int array
right - the array being compared
Returns:
true if the contents of both arrays are equal.
Since:
1.5.0


div

public static java.lang.Number div(java.lang.Character left, java.lang.Number right)
Bitwise AND together two Numbers.
Parameters:
left - a Number
right - another Number to bitwise AND
Returns:
the bitwise AND of both Numbers
Since:
1.0


div

public static java.lang.Number div(java.lang.Number left, java.lang.Character right)
Bitwise AND together two BitSets.
Parameters:
left - a BitSet
right - another BitSet to bitwise AND
Returns:
the bitwise AND of both BitSets
Since:
1.5.0


div

public static java.lang.Number div(java.lang.Character left, java.lang.Character right)
Bitwise XOR together two BitSets. Called when the '^' operator is used between two bit sets.
Parameters:
left - a BitSet
right - another BitSet to bitwise AND
Returns:
the bitwise XOR of both BitSets
Since:
1.5.0


downto

public static void downto(java.lang.Number self, java.lang.Number to, Closure closure)
Iterates from this number down to the given number, inclusive, decrementing by one each time.
Parameters:
self - a double
to - the end number
closure - the code to execute for each number
Since:
1.0


downto

public static void downto(long self, java.lang.Number to, Closure closure)


downto

public static void downto(java.lang.Long self, java.lang.Number to, Closure closure)


downto

public static void downto(float self, java.lang.Number to, Closure closure)


downto

public static void downto(java.lang.Float self, java.lang.Number to, Closure closure)


downto

public static void downto(double self, java.lang.Number to, Closure closure)


downto

public static void downto(java.lang.Double self, java.lang.Number to, 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.
Parameters:
self - a Number to start with
to - a Number to go up to, exclusive
stepNumber - a Number representing the step increment
closure - the closure to call
Since:
1.0


downto

public static void downto(java.math.BigInteger self, java.lang.Number to, Closure closure)


downto

public static void downto(java.math.BigDecimal self, java.lang.Number to, Closure closure)
Get the absolute value
Parameters:
number - a Number
Returns:
the absolute value of that Number
Since:
1.0


drop

public static java.util.List drop(java.util.List self, int num)


drop

public static java.util.List drop(java.lang.Iterable self, int num)
Drops the given number of elements from the head of this array if they are available.
 String[] strings = [ 'a', 'b', 'c' ]
 assert strings.drop( 0 ) == [ 'a', 'b', 'c' ] as String[]
 assert strings.drop( 2 ) == [ 'c' ] as String[]
 assert strings.drop( 5 ) == [] as String[]
 
Parameters:
self - the original array
num - the number of elements to drop from this array
Returns:
an array consisting of all elements of this array except the first num ones, or else the empty array, if this array has less than num elements.
Since:
1.8.1


drop

public static java.lang.Object[] drop(java.lang.Object[] self, int num)


drop

public static java.util.Map drop(java.util.Map self, int num)


drop

public static java.util.Iterator drop(java.util.Iterator self, int num)
Returns the longest prefix of this list where each element passed to the given closure condition evaluates to true. Similar to takeWhile(Iterable, groovy.lang.Closure) except that it attempts to preserve the type of the original list.
 def nums = [ 1, 3, 2 ]
 assert nums.takeWhile{ it < 1 } == []
 assert nums.takeWhile{ it < 3 } == [ 1 ]
 assert nums.takeWhile{ it < 4 } == [ 1, 3, 2 ]
 
Parameters:
self - the original list
condition - the closure that must evaluate to true to continue taking elements
Returns:
a prefix of the given list where each element passed to the given closure evaluates to true
Since:
1.8.7


drop

public static java.lang.CharSequence drop(java.lang.CharSequence self, int num)


dropWhile

public static java.util.List dropWhile(java.util.List self, Closure condition)
Returns a suffix of this Iterable where elements are dropped from the front while the given closure evaluates to true.
 class AbcIterable implements Iterable {
     Iterator iterator() { "abc".iterator() }
 }
 def abc = new AbcIterable()
 assert abc.dropWhile{ it < 'b' } == ['b', 'c']
 assert abc.dropWhile{ it <= 'b' } == ['c']
 
Parameters:
self - an Iterable
condition - the closure that must evaluate to true to continue dropping elements
Returns:
the shortest suffix of the given Iterable such that the given closure condition evaluates to true for each element dropped from the front of the Iterable
Since:
1.8.7


dropWhile

public static java.util.List dropWhile(java.lang.Iterable self, Closure condition)
Create a suffix of the given Map by dropping as many entries as possible from the front of the original Map such that calling the given closure condition evaluates to true when passed each of the dropped entries (or key/value pairs).
 def shopping = [milk:1, bread:2, chocolate:3]
 assert shopping.takeWhile{ it.key.size() < 6 } == [milk:1, bread:2]
 assert shopping.takeWhile{ it.value % 2 } == [milk:1]
 assert shopping.takeWhile{ k, v -> k.size() + v <= 7 } == [milk:1, bread:2]
 
If the map instance does not have ordered keys, then this function could appear to drop random entries. Groovy by default uses LinkedHashMap, so this shouldn't be an issue in the main.
Parameters:
self - a Map
condition - a 1 (or 2) arg Closure that must evaluate to true for the entry (or key and value) to continue dropping elements
Returns:
the shortest suffix of the given Map such that the given closure condition evaluates to true for each element dropped from the front of the Map
Since:
1.8.7


dropWhile

public static java.util.Map dropWhile(java.util.Map self, Closure condition)


dropWhile

public static java.lang.Object[] dropWhile(java.lang.Object[] self, Closure condition)


dropWhile

public static java.util.Iterator dropWhile(java.util.Iterator self, Closure condition)


dump

public static java.lang.String dump(java.lang.Object self)


each

public static java.lang.Object each(java.lang.Object 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.
Parameters:
self - the object over which we iterate
closure - the closure applied on each element found
Returns:
the self Object
Since:
1.0


each

public static java.util.Map each(java.util.Map self, Closure closure)


eachByte

public static void eachByte(java.lang.Byte[] self, Closure closure)


eachByte

public static void eachByte(byte[] self, Closure closure)


eachByte

public static void eachByte(java.io.File self, Closure closure)


eachByte

public static void eachByte(java.io.File self, int bufferLen, Closure closure)


eachByte

public static void eachByte(java.io.InputStream is, Closure closure)


eachByte

public static void eachByte(java.io.InputStream is, int bufferLen, Closure closure)


eachByte

public static void eachByte(java.net.URL url, Closure closure)


eachByte

public static void eachByte(java.net.URL url, int bufferLen, Closure closure)


eachDir

public static void eachDir(java.io.File self, Closure closure)


eachDirMatch

public static void eachDirMatch(java.io.File self, java.lang.Object nameFilter, Closure closure)


eachDirRecurse

return ResourceGroovyMethods.newWriter(file, append);
public static void eachDirRecurse(java.io.File self, Closure closure)


eachFile

}
public static void eachFile(java.io.File self, FileType fileType, Closure closure)


eachFile

public static void eachFile(java.io.File self, Closure closure)


eachFileMatch

return ResourceGroovyMethods.newWriter(file, charset, append);
public static void eachFileMatch(java.io.File self, FileType fileType, java.lang.Object nameFilter, Closure closure)


eachFileMatch

}
public static void eachFileMatch(java.io.File self, java.lang.Object nameFilter, Closure closure)


eachFileRecurse

public static void eachFileRecurse(java.io.File self, FileType fileType, Closure closure)


eachFileRecurse

return ResourceGroovyMethods.newWriter(file);
public static void eachFileRecurse(java.io.File self, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.lang.CharSequence self, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.lang.CharSequence self, int firstLine, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.lang.String self, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.lang.String self, int firstLine, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.io.File self, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.io.File self, java.lang.String charset, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.io.File self, int firstLine, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.io.File self, java.lang.String charset, int firstLine, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.io.InputStream stream, java.lang.String charset, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.io.InputStream stream, java.lang.String charset, int firstLine, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.io.InputStream stream, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.io.InputStream stream, int firstLine, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.net.URL url, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.net.URL url, int firstLine, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.net.URL url, java.lang.String charset, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.net.URL url, java.lang.String charset, int firstLine, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.io.Reader self, Closure closure)


eachLine

@Deprecated
public static java.lang.Object eachLine(java.io.Reader self, int firstLine, Closure closure)


eachMatch

@Deprecated
public static java.lang.String eachMatch(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


eachMatch

@Deprecated
public static java.lang.String eachMatch(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)


eachMatch

@Deprecated
public static java.lang.String eachMatch(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)


eachMatch

@Deprecated
public static java.lang.String eachMatch(java.lang.String self, java.lang.String regex, Closure closure)


eachObject

@Deprecated
public static void eachObject(java.io.File self, Closure closure)


eachObject

@Deprecated
public static void eachObject(java.io.ObjectInputStream ois, Closure closure)


eachPermutation

public static java.util.Iterator eachPermutation(java.util.Collection self, Closure closure)


eachWithIndex

public static java.lang.Object eachWithIndex(java.lang.Object self, Closure closure)


eachWithIndex

public static java.util.Map eachWithIndex(java.util.Map self, Closure closure)


equals

public static boolean equals(int[] left, int[] 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.
Parameters:
left - an array
right - the List being compared
Returns:
true if the contents of both collections are equal
Since:
1.5.0


equals

public static boolean equals(java.lang.Object[] left, java.util.List right)


equals

public static boolean equals(java.util.List left, java.lang.Object[] right)


equals

public static boolean equals(java.util.List left, java.util.List right)


equals

public static boolean equals(java.util.Set self, java.util.Set other)


equals

public static boolean equals(java.util.Map self, java.util.Map other)
Create a Set composed of the elements of the first Set minus the elements of the given Collection.
Parameters:
self - a Set object
removeMe - the items to remove from the Set
Returns:
the resulting Set
Since:
1.5.0


every

public static boolean every(java.lang.Object self, Closure closure)


every

public static boolean every(java.util.Map self, Closure closure)


every

public static boolean every(java.lang.Object self)


execute

public static java.lang.Process execute(java.lang.String self)


execute

public static java.lang.Process execute(java.lang.String self, java.lang.String[] envp, java.io.File dir)


execute

public static java.lang.Process execute(java.lang.String self, java.util.List envp, java.io.File dir)


execute

public static java.lang.Process execute(java.lang.String[] commandArray)


execute

public static java.lang.Process execute(java.lang.String[] commandArray, java.lang.String[] envp, java.io.File dir)


execute

public static java.lang.Process execute(java.lang.String[] commandArray, java.util.List envp, java.io.File dir)


execute

public static java.lang.Process execute(java.util.List commands)


execute

public static java.lang.Process execute(java.util.List commands, java.lang.String[] envp, java.io.File dir)


execute

public static java.lang.Process execute(java.util.List commands, java.util.List envp, java.io.File dir)


expand

@Deprecated
public static java.lang.CharSequence expand(java.lang.CharSequence self)


expand

@Deprecated
public static java.lang.CharSequence expand(java.lang.CharSequence self, int tabStop)


expand

@Deprecated
public static java.lang.String expand(java.lang.String self)


expand

@Deprecated
public static java.lang.String expand(java.lang.String self, int tabStop)


expandLine

@Deprecated
public static java.lang.CharSequence expandLine(java.lang.CharSequence self, int tabStop)


expandLine

@Deprecated
public static java.lang.String expandLine(java.lang.String self, int tabStop)


filterLine

public static void filterLine(java.io.Reader reader, java.io.Writer writer, Closure closure)


filterLine

public static Writable filterLine(java.io.File self, Closure closure)


filterLine

public static Writable filterLine(java.io.File self, java.lang.String charset, Closure closure)


filterLine

public static void filterLine(java.io.File self, java.io.Writer writer, Closure closure)


filterLine

public static void filterLine(java.io.File self, java.io.Writer writer, java.lang.String charset, Closure closure)


filterLine

public static Writable filterLine(java.io.Reader reader, Closure closure)


filterLine

public static Writable filterLine(java.io.InputStream self, Closure predicate)


filterLine

public static Writable filterLine(java.io.InputStream self, java.lang.String charset, Closure predicate)


filterLine

public static void filterLine(java.io.InputStream self, java.io.Writer writer, Closure predicate)


filterLine

public static void filterLine(java.io.InputStream self, java.io.Writer writer, java.lang.String charset, Closure predicate)


filterLine

public static Writable filterLine(java.net.URL self, Closure predicate)


filterLine

public static Writable filterLine(java.net.URL self, java.lang.String charset, Closure predicate)


filterLine

public static void filterLine(java.net.URL self, java.io.Writer writer, Closure predicate)


filterLine

public static void filterLine(java.net.URL self, java.io.Writer writer, java.lang.String charset, Closure predicate)


find

public static java.lang.Object find(java.lang.Object self, Closure closure)


find

public static java.lang.Object find(java.lang.Object self)
Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns the defaultResult.
Parameters:
self - an Object with an iterator returning its values
defaultResult - an Object that should be returned if all closure results are null
closure - a closure that returns a non-null value when processing should stop
Returns:
the first non-null result of the closure, otherwise the default value
Since:
1.7.5


find

public static java.lang.Object find(java.util.Collection self, Closure closure)


find

public static java.lang.Object find(java.lang.Object[] self, Closure condition)


find

public static java.lang.Object find(java.util.Collection self)


find

public static java.util.Map$Entry find(java.util.Map self, Closure closure)


find

@Deprecated
public static java.lang.CharSequence find(java.lang.CharSequence self, java.lang.CharSequence regex)


find

@Deprecated
public static java.lang.CharSequence find(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


find

@Deprecated
public static java.lang.CharSequence find(java.lang.CharSequence self, java.util.regex.Pattern pattern)


find

@Deprecated
public static java.lang.CharSequence find(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)


find

@Deprecated
public static java.lang.String find(java.lang.String self, java.util.regex.Pattern pattern)


find

@Deprecated
public static java.lang.String find(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)


find

@Deprecated
public static java.lang.String find(java.lang.String self, java.lang.String regex)


find

@Deprecated
public static java.lang.String find(java.lang.String self, java.lang.String regex, Closure closure)


findAll

public static java.util.Collection findAll(java.util.Collection self, Closure closure)
Finds all elements of the array matching the given Closure condition.
 def items = [1,2,3,4] as Integer[]
 assert [2,4] == items.findAll { it % 2 == 0 }
 
Parameters:
self - an array
condition - a closure condition
Returns:
a list of matching values
Since:
2.0


findAll

public static java.util.Collection findAll(java.lang.Object[] self, Closure condition)


findAll

public static java.util.Collection findAll(java.util.Collection self)
Finds the elements of the array matching the IDENTITY Closure (i.e. matching Groovy truth).

Example:

 def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null] as Object[]
 assert items.findAll() == [1, 2, true, 'foo', [4, 5]]
 
Parameters:
self - an array
Returns:
a collection of the elements found
See Also:
Closure.IDENTITY
Since:
2.0


findAll

public static java.util.Collection findAll(java.lang.Object[] self)
Finds all items matching the closure condition.
Parameters:
self - an Object with an Iterator returning its values
closure - a closure condition
Returns:
a List of the values found
Since:
1.6.0


findAll

public static java.util.Collection findAll(java.lang.Object self, Closure closure)


findAll

public static java.util.Collection findAll(java.lang.Object self)


findAll

public static java.util.Map findAll(java.util.Map self, Closure closure)


findAll

@Deprecated
public static java.util.List findAll(java.lang.CharSequence self, java.lang.CharSequence regex)


findAll

@Deprecated
public static java.util.List findAll(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


findAll

@Deprecated
public static java.util.List findAll(java.lang.CharSequence self, java.util.regex.Pattern pattern)


findAll

@Deprecated
public static java.util.List findAll(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)


findAll

@Deprecated
public static java.util.List findAll(java.lang.String self, java.util.regex.Pattern pattern)


findAll

@Deprecated
public static java.util.List findAll(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)


findAll

@Deprecated
public static java.util.List findAll(java.lang.String self, java.lang.String regex)


findAll

@Deprecated
public static java.util.List findAll(java.lang.String self, java.lang.String regex, Closure closure)


findIndexOf

public static int findIndexOf(java.lang.Object self, Closure closure)


findIndexOf

public static int findIndexOf(java.lang.Object self, int startIndex, Closure closure)


findIndexValues

public static java.util.List findIndexValues(java.lang.Object self, Closure closure)


findIndexValues

public static java.util.List findIndexValues(java.lang.Object self, java.lang.Number startIndex, Closure closure)


findLastIndexOf

public static int findLastIndexOf(java.lang.Object self, Closure closure)


findLastIndexOf

public static int findLastIndexOf(java.lang.Object self, int startIndex, Closure closure)


findResult

public static java.lang.Object findResult(java.lang.Object self, java.lang.Object defaultResult, Closure closure)
Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns null.
Parameters:
self - an Object with an iterator returning its values
closure - a closure that returns a non-null value when processing should stop
Returns:
the first non-null result of the closure
Since:
1.7.5


findResult

public static java.lang.Object findResult(java.lang.Object self, Closure closure)


findResult

public static java.lang.Object findResult(java.util.Collection self, java.lang.Object defaultResult, Closure closure)


findResult

public static java.lang.Object findResult(java.util.Collection self, Closure closure)


findResult

public static java.lang.Object findResult(java.util.Map self, java.lang.Object defaultResult, Closure closure)


findResult

public static java.lang.Object findResult(java.util.Map self, Closure closure)


findResults

public static java.util.Collection findResults(java.util.Collection self, Closure filteringTransform)


findResults

public static java.util.Collection findResults(java.util.Map self, Closure filteringTransform)


first

public static java.lang.Object first(java.util.List self)


first

public static java.lang.Object first(java.lang.Iterable self)
Returns the first item from the array.
 def array = [3, 4, 2].toArray()
 assert array.first() == 3
 
throws:
NoSuchElementException if the array is empty and you try to access the first() item.
Parameters:
self - an array
Returns:
the first item from the array
Since:
1.7.3


first

public static java.lang.Object first(java.lang.Object[] self)


flatten

public static java.util.Collection flatten(java.util.Collection self)
Flatten an array. This array and any nested arrays or collections have their contents (recursively) added to the new collection.
Parameters:
self - a byte Array to flatten
Returns:
a flattened Collection
Since:
1.6.0


flatten

public static java.util.Collection flatten(java.lang.Object[] self)


flatten

public static java.util.Collection flatten(boolean[] self)


flatten

public static java.util.Collection flatten(byte[] self)


flatten

public static java.util.Collection flatten(char[] self)


flatten

public static java.util.Collection flatten(short[] self)


flatten

public static java.util.Collection flatten(int[] self)


flatten

public static java.util.Collection flatten(long[] self)


flatten

public static java.util.Collection flatten(float[] self)
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.
Parameters:
self - a Collection
flattenUsing - a closure to determine how to flatten non-Array, non-Collection elements
Returns:
a flattened Collection
Since:
1.6.0


flatten

public static java.util.Collection flatten(double[] self)


flatten

public static java.util.Collection flatten(java.util.Collection self, Closure flattenUsing)
Overloads the left shift operator to provide an easy way to append objects to a Collection.
def list = [1,2]
 list << 3
 assert list == [1,2,3]
Parameters:
self - a Collection
value - an Object to be added to the collection.
Returns:
same collection, after the value was added to it.
Since:
1.0


get

public static java.lang.Object get(java.util.Map map, java.lang.Object key, java.lang.Object defaultValue)
Support the range subscript operator for an Array
Parameters:
array - an Array of Objects
range - a Range
Returns:
a range of a list from the range's from index up to but not including the range's to value
Since:
1.0


getAt

public static java.lang.Object getAt(java.lang.Object self, java.lang.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.
Parameters:
self - the object to act upon
property - the property name of interest
Returns:
the property value
Since:
1.0


getAt

public static java.util.List getAt(java.util.List self, Range range)
Support the range subscript operator for a List.
def list = [true, 1, 3.4]
 assert list[0..<0] == []
Parameters:
self - a List
range - a Range indicating the items to get
Returns:
a sublist based on range borders or a new list if range is reversed
See Also:
java.util.List#subList(int,int)
Since:
1.0


getAt

public static java.util.List getAt(java.util.List self, EmptyRange range)
Select a List of items from a List using a Collection to identify the indices to be selected.
def list = [true, 1, 3.4, false]
 assert list[1,0,2] == [1, true, 3.4]
Parameters:
self - a List
indices - a Collection of indices
Returns:
a new list of the values at the given indices
Since:
1.0


getAt

public static java.util.List getAt(java.util.List self, java.util.Collection indices)
Select a List of items from an Object array using a Collection to identify the indices to be selected.
Parameters:
self - an Array of Objects
indices - a Collection of indices
Returns:
a new list of the values at the given indices
Since:
1.0


getAt

public static java.util.List getAt(java.lang.Object[] self, java.util.Collection indices)
Creates a sub-Map containing the given keys. This method is similar to List.subList() but uses keys rather than index ranges.
assert [1:10, 2:20, 4:40].subMap( [2, 4] ) == [2:20, 4:40]
Parameters:
map - a Map
keys - a Collection of keys
Returns:
a new Map containing the given keys
Since:
1.0


getAt

public static java.util.List getAt(java.lang.Object[] array, Range range)
Parameters:
array - an Array of Objects
range - an EmptyRange
Returns:
an empty Range
Since:
1.5.0


getAt

public static java.util.List getAt(java.lang.Object[] array, IntRange range)
Parameters:
array - an Array of Objects
range - an ObjectRange
Returns:
a range of a list from the range's from index up to but not including the range's to value
Since:
1.0


getAt

public static java.util.List getAt(java.lang.Object[] array, EmptyRange range)


getAt

public static java.util.List getAt(java.lang.Object[] array, ObjectRange range)


getAt

public static java.lang.Object getAt(java.util.List self, int idx)


getAt

public static java.lang.Object getAt(java.util.Iterator self, int idx)


getAt

public static java.lang.Object getAt(java.util.Map self, java.lang.Object key)
Support the subscript operator for a Map.
def map = [a:10]
 assert map["a"] == 10
Parameters:
self - a Map
key - an Object as a key for the map
Returns:
the value corresponding to the given key
Since:
1.0


getAt

public static java.util.List getAt(java.util.Collection coll, java.lang.String property)
A convenience method for creating an immutable map.
Parameters:
self - a Map
Returns:
an immutable Map
See Also:
java.util.Collections#unmodifiableMap(java.util.Map)
Since:
1.0


getAt

* Support the subscript operator with a range for a long array
public static java.util.List getAt(byte[] array, Range range)
Support the subscript operator with a range for an int array
Parameters:
array - an int array
range - a range indicating the indices for the items to retrieve
Returns:
list of the ints at the given indices
Since:
1.0


getAt

* Support the subscript operator with a range for a float array
public static java.util.List getAt(char[] array, Range range)


getAt

* Support the subscript operator with a range for a double array
public static java.util.List getAt(short[] array, Range range)


getAt

* Support the subscript operator with a range for a boolean array
public static java.util.List getAt(int[] array, Range range)


getAt

* Support the subscript operator with an IntRange for a byte array
public static java.util.List getAt(long[] array, Range range)


getAt

* Support the subscript operator with an IntRange for a char array
public static java.util.List getAt(float[] array, Range range)


getAt

* Support the subscript operator with an IntRange for a short array
public static java.util.List getAt(double[] array, Range range)


getAt

* Support the subscript operator with an IntRange for an int array
public static java.util.List getAt(boolean[] array, Range range)


getAt

* Support the subscript operator with an IntRange for a long array
public static java.util.List getAt(byte[] array, IntRange range)


getAt

* Support the subscript operator with an IntRange for a float array
public static java.util.List getAt(char[] array, IntRange range)


getAt

* Support the subscript operator with an IntRange for a double array
public static java.util.List getAt(short[] array, IntRange range)


getAt

* Support the subscript operator with an IntRange for a boolean array
public static java.util.List getAt(int[] array, IntRange range)


getAt

* Support the subscript operator with an ObjectRange for a byte array
public static java.util.List getAt(long[] array, IntRange range)


getAt

* Support the subscript operator with an ObjectRange for a char array
public static java.util.List getAt(float[] array, IntRange range)


getAt

* Support the subscript operator with an ObjectRange for a short array
public static java.util.List getAt(double[] array, IntRange range)


getAt

* Support the subscript operator with an ObjectRange for an int array
public static java.util.List getAt(boolean[] array, IntRange range)


getAt

* Support the subscript operator with an ObjectRange for a long array
public static java.util.List getAt(byte[] array, ObjectRange range)


getAt

* Support the subscript operator with an ObjectRange for a float array
public static java.util.List getAt(char[] array, ObjectRange range)


getAt

* Support the subscript operator with an ObjectRange for a double array
public static java.util.List getAt(short[] array, ObjectRange range)


getAt

* Support the subscript operator with an ObjectRange for a byte array
public static java.util.List getAt(int[] array, ObjectRange range)


getAt

* Support the subscript operator with a collection for a byte array
public static java.util.List getAt(long[] array, ObjectRange range)


getAt

* Support the subscript operator with a collection for a char array
public static java.util.List getAt(float[] array, ObjectRange range)


getAt

* Support the subscript operator with a collection for a short array
public static java.util.List getAt(double[] array, ObjectRange range)


getAt

* Support the subscript operator with a collection for an int array
public static java.util.List getAt(boolean[] array, ObjectRange range)


getAt

* Support the subscript operator with a collection for a long array
public static java.util.List getAt(byte[] array, java.util.Collection indices)


getAt

* Support the subscript operator with a collection for a float array
public static java.util.List getAt(char[] array, java.util.Collection indices)


getAt

* Support the subscript operator with a collection for a double array
public static java.util.List getAt(short[] array, java.util.Collection indices)


getAt

* Support the subscript operator with a collection for a boolean array
public static java.util.List getAt(int[] array, java.util.Collection indices)


getAt

* Support the subscript operator for a Bitset
public static java.util.List getAt(long[] array, java.util.Collection indices)


getAt

* Support retrieving a subset of a BitSet using a Range
public static java.util.List getAt(float[] array, java.util.Collection indices)


getAt

BitSet result = new BitSet();
public static java.util.List getAt(double[] array, java.util.Collection indices)


getAt

}
public static java.util.List getAt(boolean[] array, java.util.Collection indices)


getAt

public static boolean getAt(java.util.BitSet self, int index)


getAt

public static java.util.BitSet getAt(java.util.BitSet self, IntRange range)


getAt

@Deprecated
public static java.lang.CharSequence getAt(java.lang.CharSequence self, java.util.Collection indices)


getAt

@Deprecated
public static java.lang.CharSequence getAt(java.lang.CharSequence text, EmptyRange range)


getAt

@Deprecated
public static java.lang.CharSequence getAt(java.lang.CharSequence text, int index)


getAt

@Deprecated
public static java.lang.CharSequence getAt(java.lang.CharSequence text, IntRange range)


getAt

@Deprecated
public static java.lang.CharSequence getAt(java.lang.CharSequence text, Range range)


getAt

@Deprecated
public static java.util.List getAt(java.util.regex.Matcher self, java.util.Collection indices)


getAt

@Deprecated
public static java.lang.Object getAt(java.util.regex.Matcher matcher, int idx)


getAt

@Deprecated
public static java.lang.String getAt(java.lang.String self, java.util.Collection indices)


getAt

@Deprecated
public static java.lang.String getAt(java.lang.String text, EmptyRange range)


getAt

@Deprecated
public static java.lang.String getAt(java.lang.String text, int index)


getAt

@Deprecated
public static java.lang.String getAt(java.lang.String text, IntRange range)


getAt

@Deprecated
public static java.lang.String getAt(java.lang.String text, Range range)


getBytes

public static void eachFileMatch(final File self, final FileType fileType, final Object nameFilter, final Closure closure)
public static byte[] getBytes(java.io.File file)


getBytes

@Deprecated
public static byte[] getBytes(java.net.URL url)


getBytes

public static byte[] getBytes(java.io.InputStream is)


getChars

@Deprecated
public static char[] getChars(java.lang.CharSequence self)


getChars

@Deprecated
public static char[] getChars(java.lang.String self)


getCount

@Deprecated
public static int getCount(java.util.regex.Matcher matcher)


getMetaClass

public static MetaClass getMetaClass(java.lang.Class c)


getMetaClass

public static MetaClass getMetaClass(java.lang.Object obj)


getMetaClass

public static MetaClass getMetaClass(GroovyObject obj)
Sets/updates the metaclass for a given object to a closure.
throws:
GroovyRuntimeException if the metaclass can't be set for this object
Parameters:
self - the object whose metaclass we wish to update
closure - the closure representing the new metaclass
Returns:
the new metaclass value
Since:
1.6.0


getMetaPropertyValues

public static java.util.List getMetaPropertyValues(java.lang.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'.
Parameters:
self - the receiver object
Returns:
list of PropertyValue objects
See Also:
Expando.getMetaPropertyValues
Since:
1.0


getProperties

public static java.util.Map getProperties(java.lang.Object self)
Convenience method that calls getMetaPropertyValues(java.lang.Object)(self) and provides the data in form of simple key/value pairs, i.e.&nsbp;without type() information.
Parameters:
self - the receiver object
Returns:
meta properties as Map of key/value pairs
Since:
1.0


getRootLoader

public static java.lang.ClassLoader getRootLoader(java.lang.ClassLoader self)
Convenience method to dynamically create a new instance of this class. Calls the default constructor.
Parameters:
c - a class
Returns:
a new instance of this class
Since:
1.0


getSubList

protected static java.util.List getSubList(java.util.List self, java.util.List splice)


getText

@Deprecated
public static java.lang.String getText(java.io.File file, java.lang.String charset)


getText

public static java.lang.String getText(java.io.File file)


getText

public static java.lang.String getText(java.net.URL url)


getText

public static java.lang.String getText(java.net.URL url, java.util.Map parameters)


getText

}
public static java.lang.String getText(java.net.URL url, java.lang.String charset)


getText

ResourceGroovyMethods.traverse(self, options, closure);
public static java.lang.String getText(java.net.URL url, java.util.Map parameters, java.lang.String charset)


getText

ResourceGroovyMethods.traverse(self, closure);
public static java.lang.String getText(java.io.InputStream is)


getText

throws FileNotFoundException, IllegalArgumentException {
public static java.lang.String getText(java.io.InputStream is, java.lang.String charset)


getText

public static void eachFileRecurse(File self, Closure closure) throws FileNotFoundException, IllegalArgumentException {
public static java.lang.String getText(java.io.Reader reader)


getText

public static void eachDirRecurse(final File self, final Closure closure) throws FileNotFoundException, IllegalArgumentException {
public static java.lang.String getText(java.io.BufferedReader reader)


grep

public static java.util.Collection grep(java.lang.Object self, java.lang.Object filter)


grep

public static java.util.Collection grep(java.util.Collection self, java.lang.Object filter)
Iterates over the collection of items and returns each item that matches the given filter - calling the isCase(java.lang.Object, java.lang.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', 3, 4.5]
 assert list.grep( ~/a+/ )  == ['a', 'aa']
 assert list.grep( ~/../ )  == ['aa', 'bc']
 assert list.grep( Number ) == [ 3, 4.5 ]
 assert list.grep{ it.toString().size() == 1 } == [ 'a', 'b', 3 ]
 
Parameters:
self - a collection
filter - the filter to perform on each element of the collection (using the isCase(java.lang.Object, java.lang.Object) method)
Returns:
a collection of objects which match the filter
Since:
2.0


grep

public static java.util.Collection grep(java.lang.Object[] self, java.lang.Object filter)


grep

public static java.util.Collection grep(java.lang.Object self)


grep

* assert items.grep() == [1, 2, true, 'foo', [4, 5]]
public static java.util.Collection grep(java.util.Collection self)


grep

* @param self  the Iterator from which we count the number of matching occurrences
public static java.util.Collection grep(java.lang.Object[] self)


groupAnswer

protected static void groupAnswer(java.util.Map answer, java.lang.Object element, java.lang.Object value)


groupBy

public static java.util.Map groupBy(java.util.Collection self, Closure closure)


groupBy

public static java.util.Map groupBy(java.util.Collection self, java.lang.Object... closures)


groupBy

public static java.util.Map groupBy(java.util.Collection self, java.util.List closures)
Sorts all collection members into (sub)groups determined by the supplied mapping closures. Each closure should return the key that this item should be grouped by. The returned LinkedHashMap will have an entry for each distinct 'key path' returned from the closures, with each value being a list of items for that 'group path'.

Example usage:

def result = [1,2,3,4,5,6].groupBy([{ it % 2 }, { it < 4 }])
 assert result == [1:[(true):[1, 3], (false):[5]], 0:[(true):[2], (false):[4, 6]]]
Another example:
def sql = groovy.sql.Sql.newInstance(/* ... */)
 def data = sql.rows("SELECT * FROM a_table").groupBy([{ it.column1 }, { it.column2 }, { it.column3 }])
 if (data.val1.val2.val3) {
     // there exists a record where:
     //   a_table.column1 == val1
     //   a_table.column2 == val2, and
     //   a_table.column3 == val3
 } else {
     // there is no such record
 }
If an empty list of closures is supplied the IDENTITY Closure will be used.
Parameters:
self - a collection to group
closures - a list of closures, each mapping entries on keys
Returns:
a new Map grouped by keys on each criterion
See Also:
Closure.IDENTITY
Since:
1.8.1


groupBy

public static java.util.Map groupBy(java.util.Map self, Closure closure)


groupBy

public static java.util.Map groupBy(java.util.Map self, java.lang.Object... closures)


groupBy

public static java.util.Map groupBy(java.util.Map self, java.util.List closures)
Groups the members of a map into sub maps determined by the supplied mapping closures. Each 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 path' returned by all closures, with values being the map members from the original map that belong to each such 'group path'.

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

def result = [a:1,b:2,c:3,d:4,e:5,f:6].groupBy([{ it.value % 2 }, { it.key.next() }])
 assert result == [1:[b:[a:1], d:[c:3], f:[e:5]], 0:[c:[b:2], e:[d:4], g:[f:6]]]
If an empty list of closures is supplied the IDENTITY Closure will be used.
Parameters:
self - a map to group
closures - a list of closures that map entries on keys
Returns:
a new map grouped by keys on each criterion
See Also:
Closure.IDENTITY
Since:
1.8.1


groupEntriesBy

public static java.util.Map groupEntriesBy(java.util.Map self, Closure closure)


hasGroup

@Deprecated
public static boolean hasGroup(java.util.regex.Matcher matcher)


hasProperty

public static MetaProperty hasProperty(java.lang.Object self, java.lang.String name)


head

public static java.lang.Object head(java.util.List self)
Returns the items from the List excluding the first item.
def list = [3, 4, 2]
 assert list.tail() == [4, 2]
 assert list == [3, 4, 2]
throws:
NoSuchElementException if the list is empty and you try to access the tail() item.
Parameters:
self - a List
Returns:
a list without its first element
Since:
1.5.6


head

public static java.lang.Object head(java.lang.Object[] self)


identity

public static java.lang.Object identity(java.lang.Object self, Closure closure)


implies

public static java.lang.Boolean implies(java.lang.Boolean left, java.lang.Boolean right)


inject

public static java.lang.Object inject(java.util.Collection self, Closure closure)


inject

public static java.lang.Object inject(java.util.Collection self, java.lang.Object initialValue, Closure closure)


inject

public static java.lang.Object inject(java.util.Map self, java.lang.Object initialValue, Closure closure)


inject

public static java.lang.Object inject(java.util.Iterator self, java.lang.Object initialValue, Closure closure)


inject

public static java.lang.Object inject(java.lang.Object self, Closure closure)
Iterates through the given Object, passing in the initial value to the closure along with the first item. The result is passed back (injected) into the closure along with the second item. The new result is injected back into the closure along with the third item and so on until further iteration of the object is not possible. Also known as foldLeft in functional parlance.
Parameters:
self - an Object
initialValue - some initial value
closure - a closure
Returns:
the result of the last closure call
See Also:
inject(Collection, Object, Closure)
Since:
1.5.0


inject

public static java.lang.Object inject(java.lang.Object self, java.lang.Object initialValue, Closure closure)
Iterates through the given array as with inject(Object[],initialValue,closure), but using the first element of the array as the initialValue, and then iterating the remaining elements of the array.
throws:
NoSuchElementException if the array is empty.
Parameters:
self - an Object[]
closure - a closure
Returns:
the result of the last closure call
See Also:
inject(Object[], Object, Closure)
Since:
1.8.7


inject

public static java.lang.Object inject(java.lang.Object[] self, Closure closure)


inject

public static java.lang.Object inject(java.lang.Object[] self, java.lang.Object initialValue, Closure closure)
Sums the items in a collection. This is equivalent to invoking the "plus" method on all items in the collection.
assert 1+2+3+4 == [1,2,3,4].sum()
Parameters:
self - Collection of values to add together
Returns:
The sum of all of the items
Since:
1.0


inspect

public static java.lang.String inspect(java.lang.Object self)
Inspects returns the String that matches what would be typed into a terminal to create this object.
Parameters:
self - any Object
Returns:
a String that matches what would be typed into a terminal to create this object. e.g. [1, 'hello'].inspect() -> [1, "hello"]
Since:
1.0


intdiv

public static java.lang.Number intdiv(java.lang.Character left, java.lang.Number right)
Bitwise NEGATE a BitSet.
Parameters:
self - a BitSet
Returns:
the bitwise NEGATE of the BitSet
Since:
1.5.0


intdiv

public static java.lang.Number intdiv(java.lang.Number left, java.lang.Character right)
Bitwise OR together two BitSets. Called when the '|' operator is used between two bit sets.
Parameters:
left - a BitSet
right - another BitSet to bitwise AND
Returns:
the bitwise OR of both BitSets
Since:
1.5.0


intdiv

public static java.lang.Number intdiv(java.lang.Character left, java.lang.Character right)
Bitwise XOR together two Numbers. Called when the '|' operator is used.
Parameters:
left - a Number
right - another Number to bitwse XOR
Returns:
the bitwise XOR of both Numbers
Since:
1.0


intdiv

public static java.lang.Number intdiv(java.lang.Number left, java.lang.Number right)


intersect

public static java.util.Collection intersect(java.util.Collection left, java.util.Collection right)


intersect

public static java.util.Map intersect(java.util.Map left, java.util.Map right)
Returns true if the intersection of two collections is empty.
assert [1,2,3].disjoint([3,4,5]) == false
assert [1,2].disjoint([3,4]) == true
Parameters:
left - a Collection
right - a Collection
Returns:
boolean true if the intersection of two collections is empty, false otherwise.
Since:
1.0


invokeMethod

public static java.lang.Object invokeMethod(java.lang.Object object, java.lang.String method, java.lang.Object arguments)


is

public static boolean is(java.lang.Object self, java.lang.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' method, like so: def same = this.is(that)
Parameters:
self - an object
other - an object to compare identity with
Returns:
true if self and other are both references to the same instance, false otherwise
Since:
1.0


isAllWhitespace

@Deprecated
public static boolean isAllWhitespace(java.lang.CharSequence self)


isAllWhitespace

@Deprecated
public static boolean isAllWhitespace(java.lang.String self)


isBigDecimal

@Deprecated
public static boolean isBigDecimal(java.lang.CharSequence self)


isBigDecimal

@Deprecated
public static boolean isBigDecimal(java.lang.String self)


isBigInteger

@Deprecated
public static boolean isBigInteger(java.lang.CharSequence self)


isBigInteger

@Deprecated
public static boolean isBigInteger(java.lang.String self)


isCase

public static boolean isCase(java.lang.Object caseValue, java.lang.Object switchValue)


isCase

public static boolean isCase(java.lang.Class caseValue, java.lang.Object switchValue)


isCase

public static boolean isCase(java.util.Collection caseValue, java.lang.Object switchValue)


isCase

public static boolean isCase(java.util.Map caseValue, java.lang.Object switchValue)


isCase

public static boolean isCase(java.lang.Number caseValue, java.lang.Number switchValue)


isCase

@Deprecated
public static boolean isCase(java.lang.CharSequence caseValue, java.lang.Object switchValue)


isCase

@Deprecated
public static boolean isCase(GString caseValue, java.lang.Object switchValue)


isCase

@Deprecated
public static boolean isCase(java.util.regex.Pattern caseValue, java.lang.Object switchValue)


isCase

@Deprecated
public static boolean isCase(java.lang.String caseValue, java.lang.Object switchValue)


isDigit

public static boolean isDigit(java.lang.Character self)


isDouble

@Deprecated
public static boolean isDouble(java.lang.CharSequence self)


isDouble

@Deprecated
public static boolean isDouble(java.lang.String self)


isFloat

@Deprecated
public static boolean isFloat(java.lang.CharSequence self)


isFloat

@Deprecated
public static boolean isFloat(java.lang.String self)


isInteger

@Deprecated
public static boolean isInteger(java.lang.CharSequence self)


isInteger

@Deprecated
public static boolean isInteger(java.lang.String self)


isLetter

public static boolean isLetter(java.lang.Character self)
Transform a Number into a Double
Parameters:
self - a Number
Returns:
an Double
Since:
1.0


isLetterOrDigit

public static boolean isLetterOrDigit(java.lang.Character self)
Transform a Number into a BigDecimal
Parameters:
self - a Number
Returns:
an BigDecimal
Since:
1.0


isLong

@Deprecated
public static boolean isLong(java.lang.CharSequence self)


isLong

@Deprecated
public static boolean isLong(java.lang.String self)


isLowerCase

public static boolean isLowerCase(java.lang.Character self)
Transform a Number into a Float
Parameters:
self - a Number
Returns:
an Float
Since:
1.0


isNumber

@Deprecated
public static boolean isNumber(java.lang.CharSequence self)


isNumber

@Deprecated
public static boolean isNumber(java.lang.String self)


isUpperCase

public static boolean isUpperCase(java.lang.Character self)


isWhitespace

public static boolean isWhitespace(java.lang.Character self)


iterator

public static java.util.Iterator iterator(java.lang.Object[] a)


iterator

public static java.util.Iterator iterator(java.lang.Object o)


iterator

public static java.util.Iterator iterator(java.util.Enumeration enumeration)


iterator

public static java.util.Iterator iterator(java.util.Iterator self)


iterator

@Deprecated
public static java.util.Iterator iterator(java.util.regex.Matcher matcher)


iterator

public static java.util.Iterator iterator(java.io.Reader self)


iterator

public static java.util.Iterator iterator(java.io.InputStream self)


iterator

public static java.util.Iterator iterator(java.io.DataInputStream self)


join

public static java.lang.String join(java.util.Iterator self, java.lang.String separator)
Concatenates the toString() representation of each item in this collection, with the given String as a separator between each item.
assert "1, 2, 3" == [1,2,3].join(", ")
Parameters:
self - a Collection of objects
separator - a String separator
Returns:
the joined String
Since:
1.0


join

public static java.lang.String join(java.util.Collection self, java.lang.String separator)


join

public static java.lang.String join(java.lang.Object[] self, java.lang.String separator)


last

public static java.lang.Object last(java.util.List self)


last

public static java.lang.Object last(java.lang.Iterable self)
Returns the last item from the array.
 def array = [3, 4, 2].toArray()
 assert array.last() == 2
 
throws:
NoSuchElementException if the array is empty and you try to access the last() item.
Parameters:
self - an array
Returns:
the last item from the array
Since:
1.7.3


last

public static java.lang.Object last(java.lang.Object[] self)
Returns the first item from the List.
 def list = [3, 4, 2]
 assert list.first() == 3
 // check original is unaltered
 assert list == [3, 4, 2]
 
throws:
NoSuchElementException if the list is empty and you try to access the first() item.
Parameters:
self - a List
Returns:
the first item from the List
Since:
1.5.5


leftShift

public static java.util.Collection leftShift(java.util.Collection self, java.lang.Object value)
Overloads the left shift operator to provide an easy way to append Map.Entry values to a Map.
Parameters:
self - a Map
entry - a Map.Entry to be added to the Map.
Returns:
same map, after the value has been added to it.
Since:
1.6.0


leftShift

public static java.util.concurrent.BlockingQueue leftShift(java.util.concurrent.BlockingQueue self, java.lang.Object value)


leftShift

public static java.util.Map leftShift(java.util.Map self, java.util.Map$Entry entry)


leftShift

public static java.util.Map leftShift(java.util.Map self, java.util.Map other)
Implementation of the right shift (unsigned) operator for integral types. Non integral Number types throw UnsupportedOperationException.
Parameters:
self - a Number object
operand - the shift distance by which to right shift (unsigned) the number
Returns:
the resulting number
Since:
1.5.0


leftShift

public static java.lang.Number leftShift(java.lang.Number self, java.lang.Number operand)
Support the subscript operator with a range for a byte array
Parameters:
array - a byte array
range - a range indicating the indices for the items to retrieve
Returns:
list of the retrieved bytes
Since:
1.0


leftShift

@Deprecated
public static java.lang.StringBuilder leftShift(java.lang.CharSequence self, java.lang.Object value)


leftShift

@Deprecated
public static java.lang.StringBuffer leftShift(java.lang.String self, java.lang.Object value)


leftShift

@Deprecated
public static java.lang.StringBuffer leftShift(java.lang.StringBuffer self, java.lang.Object value)


leftShift

@Deprecated
public static java.lang.StringBuilder leftShift(java.lang.StringBuilder self, java.lang.Object value)


leftShift

public static java.io.Writer leftShift(java.net.Socket self, java.lang.Object value)


leftShift

public static java.io.OutputStream leftShift(java.net.Socket self, byte[] value)


leftShift

@Deprecated
public static java.io.Writer leftShift(java.io.Writer self, java.lang.Object value)


leftShift

@Deprecated
public static java.io.Writer leftShift(java.io.OutputStream self, java.lang.Object value)


leftShift

@Deprecated
public static void leftShift(java.io.ObjectOutputStream self, java.lang.Object value)


leftShift

@Deprecated
public static java.io.OutputStream leftShift(java.io.OutputStream self, java.io.InputStream in)


leftShift

@Deprecated
public static java.io.OutputStream leftShift(java.io.OutputStream self, byte[] value)


leftShift

public static java.io.File leftShift(java.io.File file, java.lang.Object text)


leftShift

public static java.io.File leftShift(java.io.File file, byte[] bytes)


leftShift

public static java.io.File leftShift(java.io.File file, java.io.InputStream data)


matches

@Deprecated
public static boolean matches(java.lang.CharSequence self, java.util.regex.Pattern pattern)


matches

@Deprecated
public static boolean matches(java.lang.String self, java.util.regex.Pattern pattern)


max

public static java.util.Map$Entry max(java.util.Map self, Closure closure)


max

public static java.lang.Object max(java.util.Collection self)


max

public static java.lang.Object max(java.util.Iterator self)


max

public static java.lang.Object max(java.lang.Object[] self)


max

public static java.lang.Object max(java.util.Collection self, Closure closure)


max

public static java.lang.Object max(java.util.Iterator 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.
Parameters:
self - an Object array
closure - a Closure used to determine the correct ordering
Returns:
the maximum value
See Also:
max(java.util.Collection, groovy.lang.Closure)
Since:
1.5.5


max

public static java.lang.Object max(java.lang.Object[] self, Closure closure)
Selects the maximum value found in the collection using the given comparator.
assert "hello" == ["hello","hi","hey"].max( { a, b -> a.length() <=> b.length() } as Comparator )
Parameters:
self - a Collection
comparator - a Comparator
Returns:
the maximum value
Since:
1.0


max

public static java.lang.Object max(java.util.Collection self, java.util.Comparator comparator)


max

public static java.lang.Object max(java.util.Iterator self, java.util.Comparator comparator)
Provide the standard Groovy size() method for Iterator. The iterator will become exhausted of elements after determining the size value.
Parameters:
self - an Iterator
Returns:
the length of the Iterator
Since:
1.5.5


max

public static java.lang.Object max(java.lang.Object[] self, java.util.Comparator comparator)


metaClass

public static MetaClass metaClass(java.lang.Class self, Closure closure)
Allows an Enumeration to behave like an Iterator. Note that the java.util.Iterator#remove() remove() method is unsupported since the underlying Enumeration does not provide a mechanism for removing items.
Parameters:
enumeration - an Enumeration object
Returns:
an Iterator for the given Enumeration
Since:
1.0


metaClass

public static MetaClass metaClass(java.lang.Object self, Closure closure)
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.
Parameters:
self - an iterator object
Returns:
itself
Since:
1.5.0


min

public static java.lang.Object min(java.util.Collection self)
Adds min() method to Iterator objects. The iterator will become exhausted of elements after determining the minimum value.
Parameters:
self - an Iterator
Returns:
the minimum value
See Also:
min(java.util.Collection)
Since:
1.5.5


min

public static java.lang.Object min(java.util.Iterator self)


min

public static java.lang.Object min(java.lang.Object[] self)


min

public static java.lang.Object min(java.util.Collection self, java.util.Comparator comparator)


min

public static java.lang.Object min(java.util.Iterator self, java.util.Comparator comparator)


min

public static java.lang.Object min(java.lang.Object[] self, java.util.Comparator comparator)


min

public static java.lang.Object min(java.util.Collection self, Closure closure)


min

public static java.util.Map$Entry min(java.util.Map self, Closure closure)


min

public static java.lang.Object min(java.util.Iterator 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.
Parameters:
self - an Object array
closure - a Closure used to determine the correct ordering
Returns:
the minimum value
See Also:
min(java.util.Collection, groovy.lang.Closure)
Since:
1.5.5


min

public static java.lang.Object min(java.lang.Object[] self, Closure closure)
Adds max() method to Collection objects.
assert 5 == [2,3,1,5,4].max()
Parameters:
self - a Collection
Returns:
the maximum value
See Also:
GroovyCollections.max
Since:
1.0


minus

public static java.util.Set minus(java.util.Set self, java.util.Collection removeMe)
Create a Set composed of the elements of the first Set minus the elements from the given Iterable.
Parameters:
self - a Set object
removeMe - the items to remove from the Set
Returns:
the resulting Set
Since:
1.8.7


minus

public static java.util.Set minus(java.util.Set self, java.lang.Iterable removeMe)
Create an array composed of the elements of the first array minus the elements of the given Iterable.
Parameters:
self - an object array
removeMe - a Collection of elements to remove
Returns:
an array with the supplied elements removed
Since:
1.5.5


minus

public static java.util.Set minus(java.util.Set self, java.lang.Object removeMe)
Create an array composed of the elements of the first array minus the elements of the given array.
Parameters:
self - an object array
removeMe - an array of elements to remove
Returns:
an array with the supplied elements removed
Since:
1.5.5


minus

public static java.lang.Object[] minus(java.lang.Object[] self, java.lang.Iterable removeMe)
Create a List composed of the elements of the first list minus every occurrence of elements of the given Collection.
assert [1, "a", true, true, false, 5.3] - [true, 5.3] == [1, "a", false]
Parameters:
self - a List
removeMe - a Collection of elements to remove
Returns:
a List with the given elements removed
Since:
1.0


minus

if (Number.class.isInstance(t)) {
public static java.lang.Object[] minus(java.lang.Object[] self, java.lang.Object[] removeMe)


minus

public static java.util.List minus(java.util.List self, java.util.Collection removeMe)


minus

public static java.util.List minus(java.util.List self, java.lang.Iterable removeMe)
Create a List composed of the elements of the first list minus every occurrence of elements of the given Iterable.
 class AbcIterable implements Iterable {
     Iterator iterator() { "abc".iterator() }
 }
 assert "backtrack".toList() - new AbcIterable() == ["k", "t", "r", "k"]
 
Parameters:
self - a List
removeMe - an Iterable of elements to remove
Returns:
a List with the supplied elements removed
Since:
1.8.7


minus

public static java.util.List minus(java.util.List self, java.lang.Object removeMe)


minus

/**
public static java.lang.Object[] minus(java.lang.Object[] self, java.lang.Object removeMe)
Flatten a collection. This collection and any nested arrays or collections have their contents (recursively) added to the new collection.
assert [1,2,3,4,5] == [1,[2,3],[[4]],[],5].flatten()
Parameters:
self - a Collection to flatten
Returns:
a flattened Collection
Since:
1.6.0


minus

public static java.util.Map minus(java.util.Map self, java.util.Map removeMe)
Flatten an array. This array and any nested arrays or collections have their contents (recursively) added to the new collection.
Parameters:
self - an Array to flatten
Returns:
a flattened Collection
Since:
1.6.0


minus

public static java.lang.Number minus(java.lang.Character left, java.lang.Number right)


minus

public static java.lang.Number minus(java.lang.Number left, java.lang.Character right)
Power of a Number to a certain exponent. Called by the '**' operator.
Parameters:
self - a Number
exponent - a Number exponent
Returns:
a Number to the power of a certain exponent
Since:
1.0


minus

public static java.lang.Number minus(java.lang.Character left, java.lang.Character right)


minus

@Deprecated
public static java.lang.CharSequence minus(java.lang.CharSequence self, java.lang.Object target)


minus

@Deprecated
public static java.lang.String minus(java.lang.String self, java.lang.Object target)


mixin

public static void mixin(MetaClass self, java.util.List categoryClasses)


mixin

public static void mixin(java.lang.Class self, java.util.List categoryClasses)


mixin

public static void mixin(java.lang.Class self, java.lang.Class categoryClass)


mixin

public static void mixin(java.lang.Class self, java.lang.Class[] categoryClass)


mixin

public static void mixin(MetaClass self, java.lang.Class categoryClass)


mixin

public static void mixin(MetaClass self, java.lang.Class[] categoryClass)


mod

public static java.lang.Number mod(java.lang.Number left, java.lang.Number right)


multiply

public static java.util.List multiply(java.util.Collection self, java.lang.Number factor)


multiply

public static java.lang.Number multiply(java.lang.Character left, java.lang.Number right)


multiply

public static java.lang.Number multiply(java.lang.Number left, java.lang.Character right)


multiply

public static java.lang.Number multiply(java.lang.Character left, java.lang.Character right)
Power of an integer to an integer certain exponent. If the exponent is positive, convert to a BigInteger and call BigInteger.pow(int) method to maintain precision. Called by the '**' operator.
Parameters:
self - an Integer
exponent - an Integer exponent
Returns:
a Number to the power of a the exponent


multiply

public static java.lang.Number multiply(java.math.BigDecimal left, java.lang.Double right)


multiply

public static java.lang.Number multiply(java.math.BigDecimal left, java.math.BigInteger right)


multiply

@Deprecated
public static java.lang.CharSequence multiply(java.lang.CharSequence self, java.lang.Number factor)


multiply

@Deprecated
public static java.lang.String multiply(java.lang.String self, java.lang.Number factor)


newDataInputStream

public static java.io.DataInputStream newDataInputStream(java.io.File file)


newDataOutputStream

@Deprecated
public static java.io.DataOutputStream newDataOutputStream(java.io.File file)


newInputStream

@Deprecated
public static java.io.BufferedInputStream newInputStream(java.io.File file)


newInputStream

@Deprecated
public static java.io.BufferedInputStream newInputStream(java.net.URL url)


newInputStream

@Deprecated
public static java.io.BufferedInputStream newInputStream(java.net.URL url, java.util.Map parameters)


newInstance

}
public static java.lang.Object newInstance(java.lang.Class c)
Sets the metaclass for a given class.
Parameters:
self - the class whose metaclass we wish to set
metaClass - the new MetaClass
Since:
1.6.0


newInstance

((ExpandoMetaClass) mc).define(closure);
public static java.lang.Object newInstance(java.lang.Class c, java.lang.Object[] args)
Sets/updates the metaclass for a given class to a closure.
throws:
GroovyRuntimeException if the metaclass can't be set for this class
Parameters:
self - the class whose metaclass we wish to update
closure - the closure representing the new metaclass
Returns:
the new metaclass value
Since:
1.6.0


newObjectInputStream

@Deprecated
public static java.io.ObjectInputStream newObjectInputStream(java.io.File file)


newObjectInputStream

@Deprecated
public static java.io.ObjectInputStream newObjectInputStream(java.io.InputStream inputStream)


newObjectInputStream

@Deprecated
public static java.io.ObjectInputStream newObjectInputStream(java.io.InputStream inputStream, java.lang.ClassLoader classLoader)


newObjectInputStream

@Deprecated
public static java.io.ObjectInputStream newObjectInputStream(java.io.File file, java.lang.ClassLoader classLoader)


newObjectOutputStream

@Deprecated
public static java.io.ObjectOutputStream newObjectOutputStream(java.io.File file)


newObjectOutputStream

@Deprecated
public static java.io.ObjectOutputStream newObjectOutputStream(java.io.OutputStream outputStream)


newOutputStream

@Deprecated
public static java.io.BufferedOutputStream newOutputStream(java.io.File file)


newPrintWriter

@Deprecated
public static java.io.PrintWriter newPrintWriter(java.io.File file)


newPrintWriter

@Deprecated
public static java.io.PrintWriter newPrintWriter(java.io.File file, java.lang.String charset)


newPrintWriter

@Deprecated
public static java.io.PrintWriter newPrintWriter(java.io.Writer writer)


newReader

public static java.io.BufferedReader newReader(java.io.File file)


newReader

public static java.io.BufferedReader newReader(java.io.File file, java.lang.String charset)


newReader

@Deprecated
public static java.io.BufferedReader newReader(java.io.InputStream self)


newReader

@Deprecated
public static java.io.BufferedReader newReader(java.io.InputStream self, java.lang.String charset)


newReader

@Deprecated
public static java.io.BufferedReader newReader(java.net.URL url)


newReader

}
public static java.io.BufferedReader newReader(java.net.URL url, java.util.Map parameters)


newReader

public static java.io.BufferedReader newReader(java.net.URL url, java.lang.String charset)


newReader

public static java.io.BufferedReader newReader(java.net.URL url, java.util.Map parameters, java.lang.String charset)


newWriter

@Deprecated
public static java.io.BufferedWriter newWriter(java.io.File file)


newWriter

@Deprecated
public static java.io.BufferedWriter newWriter(java.io.File file, boolean append)


newWriter

@Deprecated
public static java.io.BufferedWriter newWriter(java.io.File file, java.lang.String charset, boolean append)


newWriter

@Deprecated
public static java.io.BufferedWriter newWriter(java.io.File file, java.lang.String charset)


next

public static java.lang.Character next(java.lang.Character self)
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).
Parameters:
left - a Number
right - a Character
Returns:
the result of the comparison
Since:
1.0


next

public static java.lang.Number next(java.lang.Number self)


next

@Deprecated
public static java.lang.CharSequence next(java.lang.CharSequence self)


next

@Deprecated
public static java.lang.String next(java.lang.String self)


normalize

@Deprecated
public static java.lang.CharSequence normalize(java.lang.CharSequence self)


normalize

@Deprecated
public static java.lang.String normalize(java.lang.String self)


numberAwareCompareTo

public static int numberAwareCompareTo(java.lang.Comparable self, java.lang.Comparable other)
Provides a method that compares two comparables using Groovy's default number aware comparator.
Parameters:
self - a Comparable
other - another Comparable
Returns:
a -ve number, 0 or a +ve number according to Groovy's compareTo contract
Since:
1.6.0


or

public static java.lang.Number or(java.lang.Number left, java.lang.Number right)


or

public static java.util.BitSet or(java.util.BitSet left, java.util.BitSet right)


or

public static java.lang.Boolean or(java.lang.Boolean left, java.lang.Boolean right)
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.
Parameters:
self - the iteration object over which to iterate
closure - the filter to perform a match on the collection
Returns:
an integer that is the index of the last matched object or -1 if no match was found
Since:
1.5.2


padLeft

@Deprecated
public static java.lang.CharSequence padLeft(java.lang.CharSequence self, java.lang.Number numberOfChars)


padLeft

@Deprecated
public static java.lang.CharSequence padLeft(java.lang.CharSequence self, java.lang.Number numberOfChars, java.lang.CharSequence padding)


padLeft

@Deprecated
public static java.lang.String padLeft(java.lang.String self, java.lang.Number numberOfChars)


padLeft

@Deprecated
public static java.lang.String padLeft(java.lang.String self, java.lang.Number numberOfChars, java.lang.String padding)


padRight

@Deprecated
public static java.lang.CharSequence padRight(java.lang.CharSequence self, java.lang.Number numberOfChars)


padRight

@Deprecated
public static java.lang.CharSequence padRight(java.lang.CharSequence self, java.lang.Number numberOfChars, java.lang.CharSequence padding)


padRight

@Deprecated
public static java.lang.String padRight(java.lang.String self, java.lang.Number numberOfChars)


padRight

@Deprecated
public static java.lang.String padRight(java.lang.String self, java.lang.Number numberOfChars, java.lang.String padding)


permutations

public static java.util.Set permutations(java.util.List self)


plus

public static java.util.Map plus(java.util.Map left, java.util.Map right)
A helper method to allow maps to work with subscript operators
Parameters:
self - a Map
key - an Object as a key for the map
value - the value to put into the map
Returns:
the value corresponding to the given key
Since:
1.0


plus

public static java.util.Map plus(java.util.Map self, java.util.Collection entries)


plus

* @param right a Collection to be appended
public static java.lang.Object[] plus(java.lang.Object[] left, java.lang.Object[] right)


plus

* assert result.class.array
public static java.lang.Object[] plus(java.lang.Object[] left, java.lang.Object right)


plus

* 
assert [1,2,3,4] == [1,2] + [3,4]
public static java.lang.Object[] plus(java.lang.Object[] left, java.util.Collection right)


plus

* @since 1.8.7
public static java.lang.Object[] plus(java.lang.Object[] left, java.lang.Iterable right)


plus

public static java.util.Collection plus(java.util.Collection left, java.util.Collection right)


plus

public static java.util.Collection plus(java.util.Collection left, java.lang.Iterable right)


plus

public static java.util.List plus(java.util.List self, int index, java.lang.Object[] items)
Creates a new List by inserting all of the elements in the given additions List to the elements from the original List at the specified index. Shifts the element currently at that index (if any) and any subsequent elements to the right (increasing their indices). The new elements will appear in the resulting List in the order that they occur in the original lists. The behavior of this operation is undefined if the original lists are modified while the operation is in progress. The original lists remain unchanged.
 def items = [1, 2, 3]
 def newItems = items.plus(2, 'a'..'c')
 assert newItems == [1, 2, 'a', 'b', 'c', 3]
 assert items == [1, 2, 3]
 
See also addAll for similar functionality with modify semantics, i.e. which performs the changes on the original list itself.
Parameters:
self - an original List
additions - a List containing elements to be merged with elements from the original List
index - index at which to insert the first element from the given additions List
Returns:
the new list
Since:
1.8.1


plus

public static java.util.List plus(java.util.List self, int index, java.util.List additions)
Creates a new List by inserting all of the elements in the given Iterable to the elements from this List at the specified index.
Parameters:
self - an original list
additions - an Iterable containing elements to be merged with the elements from the original List
index - index at which to insert the first element from the given additions Iterable
Returns:
the new list
See Also:
plus(List, int, List)
Since:
1.8.7


plus

public static java.util.List plus(java.util.List self, int index, java.lang.Iterable additions)


plus

public static java.util.Collection plus(java.util.Collection left, java.lang.Object right)


plus

public static java.lang.Number plus(java.lang.Character left, java.lang.Number right)


plus

public static java.lang.Number plus(java.lang.Number left, java.lang.Character right)


plus

public static java.lang.Number plus(java.lang.Character left, java.lang.Character right)


plus

@Deprecated
public static java.lang.CharSequence plus(java.lang.CharSequence left, java.lang.Object value)


plus

@Deprecated
public static java.lang.String plus(java.lang.Number value, java.lang.String right)


plus

@Deprecated
public static java.lang.String plus(java.lang.String left, java.lang.Object value)


plus

@Deprecated
public static java.lang.String plus(java.lang.StringBuffer left, java.lang.String value)


pop

public static java.lang.Object pop(java.util.List self)


power

public static java.lang.Number power(java.lang.Number self, java.lang.Number exponent)


power

public static java.lang.Number power(java.math.BigDecimal self, java.lang.Integer exponent)
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).
Parameters:
left - a Character
right - another Character
Returns:
the Number corresponding to the division of left by right
Since:
1.0


power

public static java.lang.Number power(java.math.BigInteger self, java.lang.Integer exponent)
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).
Parameters:
left - a Character
right - a Number
Returns:
a Number (an Integer) resulting from the integer division operation
Since:
1.0


power

public static java.lang.Number power(java.lang.Integer self, java.lang.Integer exponent)
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).
Parameters:
left - a Number
right - a Character
Returns:
a Number (an Integer) resulting from the integer division operation
Since:
1.0


power

public static java.lang.Number power(java.lang.Long self, java.lang.Integer exponent)
Integer Divide two Numbers.
Parameters:
left - a Number
right - another Number
Returns:
a Number (an Integer) resulting from the integer division operation
Since:
1.0


previous

public static java.lang.Character previous(java.lang.Character self)


previous

public static java.lang.Number previous(java.lang.Number self)
todo:
maybe a double dispatch thing to handle new large numbers?


previous

@Deprecated
public static java.lang.CharSequence previous(java.lang.CharSequence self)


previous

@Deprecated
public static java.lang.String previous(java.lang.String self)


primitiveArrayGet

protected static java.lang.Object primitiveArrayGet(java.lang.Object self, int idx)


primitiveArrayGet

protected static java.util.List primitiveArrayGet(java.lang.Object self, Range range)


primitiveArrayGet

protected static java.util.List primitiveArrayGet(java.lang.Object self, java.util.Collection indices)
Checks whether the array contains the given value.
Parameters:
self - the array within which we count the number of occurrences
value - the value being searched for
Returns:
the number of occurrences
Since:
1.8.6


primitiveArrayPut

protected static java.lang.Object primitiveArrayPut(java.lang.Object self, int idx, java.lang.Object newValue)
Checks whether the array contains the given value.
Parameters:
self - the array we are searching
value - the value being searched for
Returns:
true if the array contains the value
Since:
1.8.6


print

public static void print(java.lang.Object self, java.lang.Object value)
Print a value formatted Groovy style to self if it is a Writer, otherwise to the standard output stream.
Parameters:
self - any Object
value - the value to print
Since:
1.0


print

public static void print(java.io.PrintWriter self, java.lang.Object value)
Print a value formatted Groovy style to the print writer.
Parameters:
self - a PrintWriter
value - the value to print
Since:
1.0


print

public static void print(java.io.PrintStream self, java.lang.Object value)


print

public static void print(Closure self, java.lang.Object value)


print

public static void print(java.lang.Object self, java.io.PrintWriter out)


printf

public static void printf(java.lang.Object self, java.lang.String format, java.lang.Object[] values)


printf

public static void printf(java.lang.Object self, java.lang.String format, java.lang.Object arg)


println

public static void println(java.lang.Object self)


println

public static void println(Closure self)
Print a linebreak to the standard output stream. This method delegates to the owner to execute the method.
Parameters:
self - a closure
Since:
1.0


println

public static void println(java.lang.Object self, java.lang.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.
Parameters:
self - any Object
value - the value to print
Since:
1.0


println

public static void println(java.io.PrintWriter self, java.lang.Object value)
Print a value formatted Groovy style (followed by a newline) to the print writer.
Parameters:
self - a PrintWriter
value - the value to print
Since:
1.0


println

public static void println(java.io.PrintStream self, java.lang.Object value)


println

public static void println(Closure self, java.lang.Object value)


println

public static void println(java.lang.Object self, java.io.PrintWriter out)


push

public static boolean push(java.util.List self, java.lang.Object value)


putAll

public static java.util.Map putAll(java.util.Map self, java.util.Collection entries)


putAt

public static void putAt(java.lang.Object self, java.lang.String property, java.lang.Object newValue)


putAt

public static void putAt(java.util.List self, int idx, java.lang.Object value)
A helper method to allow lists to work with subscript operators.
def list = ["a", true]
 list[1..<1] = 5
 assert list == ["a", 5, true]
Parameters:
self - a List
range - the (in this case empty) subset of the list to set
value - the values to put at the given sublist or a Collection of values
Since:
1.0


putAt

public static void putAt(java.util.List self, EmptyRange range, java.lang.Object value)
A helper method to allow lists to work with subscript operators.
def list = ["a", true]
 list[1..<1] = [4, 3, 2]
 assert list == ["a", 4, 3, 2, true]
Parameters:
self - a List
range - the (in this case empty) subset of the list to set
value - the Collection of values
See Also:
putAt(java.util.List, groovy.lang.EmptyRange, java.lang.Object)
Since:
1.0


putAt

public static void putAt(java.util.List self, EmptyRange range, java.util.Collection value)


putAt

public static void putAt(java.util.List self, IntRange range, java.util.Collection col)
List subscript assignment operator when given a range as the index. Example:
def myList = [4, 3, 5, 1, 2, 8, 10]
 myList[3..5] = "b"
 assert myList == [4, 3, 5, "b", 10]
Items in the given range are replaced with the operand. The value operand is always treated as a single value.
Parameters:
self - a List
range - the subset of the list to set
value - the value to put at the given sublist
Since:
1.0


putAt

public static void putAt(java.util.List self, IntRange range, java.lang.Object value)


putAt

public static void putAt(java.util.List self, java.util.List splice, java.util.List values)


putAt

public static void putAt(java.util.List self, java.util.List splice, java.lang.Object value)


putAt

public static java.lang.Object putAt(java.util.Map self, java.lang.Object key, java.lang.Object value)


putAt

public static void putAt(java.util.BitSet self, IntRange range, boolean value)
Support assigning a range of values with a single assignment statement.
Parameters:
self - a BitSet
range - the range of values to set
value - value
See Also:
java.util.BitSet
Range
Since:
1.5.0


putAt

public static void putAt(java.util.BitSet self, int index, boolean value)
Converts this array to a List of the same size, with each element added to the list.
Parameters:
array - a byte array
Returns:
a list containing the contents of this array.
Since:
1.0


putAt

@Deprecated
public static void putAt(java.lang.StringBuffer self, EmptyRange range, java.lang.Object value)


putAt

@Deprecated
public static void putAt(java.lang.StringBuffer self, IntRange range, java.lang.Object value)


readBytes

public static byte[] readBytes(java.io.File file)


readLine

@Deprecated
public static java.lang.String readLine(java.io.Reader self)


readLines

@Deprecated
public static java.util.List readLines(java.lang.CharSequence self)


readLines

@Deprecated
public static java.util.List readLines(java.lang.String self)


readLines

@Deprecated
public static java.util.List readLines(java.io.File file)


readLines

@Deprecated
public static java.util.List readLines(java.io.File file, java.lang.String charset)


readLines

@Deprecated
public static java.util.List readLines(java.io.InputStream stream)


readLines

@Deprecated
public static java.util.List readLines(java.io.InputStream stream, java.lang.String charset)


readLines

@Deprecated
public static java.util.List readLines(java.net.URL self)


readLines

@Deprecated
public static java.util.List readLines(java.net.URL self, java.lang.String charset)


readLines

@Deprecated
public static java.util.List readLines(java.io.Reader reader)


removeAll

public static boolean removeAll(java.util.Collection self, java.lang.Object[] items)
Modifies this collection so that it retains only its elements that are contained in the specified array. In other words, removes from this collection all of its elements that are not contained in the specified array. See also grep and findAll when wanting to produce a new list containing items which match some specified items but leaving the original collection unchanged.
Parameters:
self - a Collection to be modified
items - array containing elements to be retained from this collection
Returns:
true if this collection changed as a result of the call
See Also:
java.util.Collection#retainAll(java.util.Collection)
Since:
1.7.2


removeAll

public static boolean removeAll(java.util.Collection self, Closure condition)


renameTo

public static boolean renameTo(java.io.File self, java.lang.String newPathName)


replaceAll

@Deprecated
public static java.lang.CharSequence replaceAll(java.lang.CharSequence self, java.lang.CharSequence regex, java.lang.CharSequence replacement)


replaceAll

@Deprecated
public static java.lang.CharSequence replaceAll(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


replaceAll

@Deprecated
public static java.lang.CharSequence replaceAll(java.lang.CharSequence self, java.util.regex.Pattern pattern, java.lang.CharSequence replacement)


replaceAll

@Deprecated
public static java.lang.String replaceAll(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)


replaceAll

@Deprecated
public static java.lang.String replaceAll(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)


replaceAll

@Deprecated
public static java.lang.String replaceAll(java.lang.String self, java.util.regex.Pattern pattern, java.lang.String replacement)


replaceAll

@Deprecated
public static java.lang.String replaceAll(java.lang.String self, java.lang.String regex, Closure closure)


replaceFirst

@Deprecated
public static java.lang.String replaceFirst(java.lang.CharSequence self, java.lang.CharSequence regex, java.lang.CharSequence replacement)


replaceFirst

@Deprecated
public static java.lang.String replaceFirst(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


replaceFirst

@Deprecated
public static java.lang.CharSequence replaceFirst(java.lang.CharSequence self, java.util.regex.Pattern pattern, java.lang.CharSequence replacement)


replaceFirst

@Deprecated
public static java.lang.String replaceFirst(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)


replaceFirst

@Deprecated
public static java.lang.String replaceFirst(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)


replaceFirst

@Deprecated
public static java.lang.String replaceFirst(java.lang.String self, java.util.regex.Pattern pattern, java.lang.String replacement)


replaceFirst

@Deprecated
public static java.lang.String replaceFirst(java.lang.String self, java.lang.String regex, Closure closure)


respondsTo

public static java.util.List respondsTo(java.lang.Object self, java.lang.String name, java.lang.Object[] argTypes)


respondsTo

public static java.util.List respondsTo(java.lang.Object self, java.lang.String name)


retainAll

public static boolean retainAll(java.util.Collection self, java.lang.Object[] items)
Modifies this collection so that it retains only its elements that are matched according to the specified closure condition. In other words, removes from this collection all of its elements that don't match. See also findAll and grep when wanting to produce a new list containing items which match some criteria but leaving the original collection unchanged.
Parameters:
self - a Collection to be modified
condition - a closure condition
Returns:
true if this collection changed as a result of the call
See Also:
java.util.Iterator#remove()
Since:
1.7.2


retainAll

public static boolean retainAll(java.util.Collection self, Closure condition)


reverse

public static java.util.List reverse(java.util.List self)
Reverses the elements in a list. If mutate is true, the original list is modified in place and returned. Otherwise, a new list containing the reversed items is produced.
 def list = ["a", 4, false]
 assert list.reverse(false) == [false, 4, "a"]
 assert list == ["a", 4, false]
 assert list.reverse(true) == [false, 4, "a"]
 assert list == [false, 4, "a"]
 
Parameters:
self - a List
mutate - true if the list itself should be reversed in place and returned, false if a new list should be created
Returns:
a reversed List
Since:
1.8.1


reverse

public static java.util.List reverse(java.util.List self, boolean mutate)
Creates a new array containing items which are the same as this array but in reverse order.
Parameters:
self - an array
Returns:
an array containing the reversed items
See Also:
reverse(Object[], boolean)
Since:
1.5.5


reverse

* @since 1.5.5
public static java.lang.Object[] reverse(java.lang.Object[] self)


reverse

* @param left  the left Array
public static java.lang.Object[] reverse(java.lang.Object[] self, boolean mutate)


reverse

public static java.util.Iterator reverse(java.util.Iterator self)


reverse

@Deprecated
public static java.lang.CharSequence reverse(java.lang.CharSequence self)


reverse

@Deprecated
public static java.lang.String reverse(java.lang.String self)


reverseEach

public static java.util.Map reverseEach(java.util.Map self, Closure closure)


reverseEach

public static java.util.List reverseEach(java.util.List self, Closure closure)


reverseEach

public static java.lang.Object[] reverseEach(java.lang.Object[] self, Closure closure)


rightShift

public static java.lang.Number rightShift(java.lang.Number self, java.lang.Number operand)
Support the subscript operator with a range for a char array
Parameters:
array - a char array
range - a range indicating the indices for the items to retrieve
Returns:
list of the retrieved chars
Since:
1.5.0


rightShiftUnsigned

public static java.lang.Number rightShiftUnsigned(java.lang.Number self, java.lang.Number operand)
Support the subscript operator with a range for a short array
Parameters:
array - a short array
range - a range indicating the indices for the items to retrieve
Returns:
list of the retrieved shorts
Since:
1.0


round

public static int round(java.lang.Float number)


round

public static float round(java.lang.Float number, int precision)


round

public static long round(java.lang.Double number)


round

public static double round(java.lang.Double number, int precision)
Converts the character to uppercase. Synonym for 'Character.toUpperCase(this)'.
Parameters:
self - a Character to convert
Returns:
the uppercase equivalent of the character, if any; otherwise, the character itself.
See Also:
java.lang.Character#isUpperCase(char)
java.lang.String#toUpperCase()
Since:
1.5.7


runAfter

public static java.util.TimerTask runAfter(java.util.Timer timer, int delay, 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.
Parameters:
self - the iteration object over which to iterate
closure - the filter to perform a match on the collection
Returns:
a list of numbers corresponding to the index values of all matched objects
Since:
1.5.2


setBytes

public static void setBytes(java.io.File file, byte[] bytes)


setBytes

public static void setBytes(java.io.OutputStream os, byte[] bytes)


setIndex

@Deprecated
public static void setIndex(java.util.regex.Matcher matcher, int idx)


setMetaClass

public static void setMetaClass(java.lang.Class self, MetaClass metaClass)


setMetaClass

public static void setMetaClass(java.lang.Object self, MetaClass metaClass)


setMetaClass

public static void setMetaClass(GroovyObject self, MetaClass metaClass)


setText

public static void setText(java.io.File file, java.lang.String text)


setText

public static void setText(java.io.File file, java.lang.String text, java.lang.String charset)


size

public static int size(java.util.Iterator self)


size

public static int size(java.lang.Object[] self)


size

public static int size(boolean[] array)


size

public static int size(byte[] array)


size

public static int size(char[] array)
Converts this array to a List of the same size, with each element added to the list.
Parameters:
array - a short array
Returns:
a list containing the contents of this array.
Since:
1.0


size

public static int size(short[] array)
Converts this array to a List of the same size, with each element added to the list.
Parameters:
array - an int array
Returns:
a list containing the contents of this array.
Since:
1.0


size

public static int size(int[] array)


size

public static int size(long[] array)


size

public static int size(float[] array)


size

public static int size(double[] array)


size

@Deprecated
public static int size(java.lang.CharSequence text)


size

@Deprecated
public static long size(java.util.regex.Matcher self)


size

@Deprecated
public static int size(java.lang.String text)


size

@Deprecated
public static int size(java.lang.StringBuffer buffer)


size

@Deprecated
public static long size(java.io.File self)


sort

public static java.util.List sort(java.util.Collection self)


sort

public static java.util.List sort(java.util.Collection self, boolean mutate)
Sorts the elements from the given map into a new ordered map using the closure as a comparator to determine the ordering. The original map is unchanged.
def map = [a:5, b:3, c:6, d:4].sort { a, b -> a.value <=> b.value }
 assert map == [b:3, d:4, a:5, c:6]
Parameters:
self - the original unsorted map
closure - a Closure used as a comparator
Returns:
the sorted map
Since:
1.6.0


sort

public static java.util.Map sort(java.util.Map self, Closure closure)


sort

public static java.util.Map sort(java.util.Map self, java.util.Comparator comparator)


sort

public static java.util.Map sort(java.util.Map self)


sort

public static java.lang.Object[] sort(java.lang.Object[] self)


sort

public static java.lang.Object[] sort(java.lang.Object[] self, boolean mutate)
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.
Parameters:
self - the Iterator to be sorted
Returns:
the sorted items as an Iterator
Since:
1.5.5


sort

public static java.util.Iterator sort(java.util.Iterator self)


sort

public static java.util.Iterator sort(java.util.Iterator self, java.util.Comparator comparator)


sort

public static java.util.List sort(java.util.Collection self, java.util.Comparator comparator)


sort

public static java.util.List sort(java.util.Collection self, boolean mutate, java.util.Comparator comparator)
Sorts the given array into sorted order using the given comparator.
Parameters:
self - the array to be sorted
comparator - a Comparator used for the comparison
Returns:
the sorted array
Since:
1.5.5


sort

public static java.lang.Object[] sort(java.lang.Object[] self, java.util.Comparator comparator)


sort

public static java.lang.Object[] sort(java.lang.Object[] self, boolean mutate, java.util.Comparator comparator)
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.
Parameters:
self - the Iterator to be sorted
closure - a Closure used to determine the correct ordering
Returns:
the sorted items as an Iterator
Since:
1.5.5


sort

public static java.util.Iterator sort(java.util.Iterator self, Closure closure)


sort

*/
public static java.lang.Object[] sort(java.lang.Object[] self, Closure closure)


sort

* @since 1.0
public static java.lang.Object[] sort(java.lang.Object[] self, boolean mutate, Closure closure)


sort

public static java.util.List sort(java.util.Collection self, Closure closure)


sort

public static java.util.List sort(java.util.Collection self, boolean mutate, Closure closure)
Avoids doing unnecessary work when sorting an already sorted set (i.e. an identity function for an already sorted set).
Parameters:
self - an already sorted set
Returns:
the set
Since:
1.0


sort

public static java.util.SortedSet sort(java.util.SortedSet self)
Removes the last item from the List. Using add() and pop() is similar to push and pop on a Stack.
def list = ["a", false, 2]
 assert list.pop() == 2
 assert list == ["a", false]
throws:
NoSuchElementException if the list is empty and you try to pop() it.
Parameters:
self - a List
Returns:
the item removed from the List
Since:
1.0


sort

public static java.util.SortedMap sort(java.util.SortedMap self)


split

public static java.util.Collection split(java.lang.Object self, Closure closure)


split

public static java.util.Collection split(java.util.Collection self, Closure closure)


split

@Deprecated
public static java.lang.CharSequence[] split(java.lang.CharSequence self)


split

@Deprecated
public static java.lang.String[] split(GString self)


split

@Deprecated
public static java.lang.String[] split(java.lang.String self)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)


splitEachLine

public static java.lang.Object splitEachLine(java.lang.String self, java.lang.String regex, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.io.File self, java.lang.String regex, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.io.File self, java.util.regex.Pattern pattern, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.io.File self, java.lang.String regex, java.lang.String charset, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.io.File self, java.util.regex.Pattern pattern, java.lang.String charset, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.net.URL self, java.lang.String regex, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.net.URL self, java.util.regex.Pattern pattern, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.net.URL self, java.lang.String regex, java.lang.String charset, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.net.URL self, java.util.regex.Pattern pattern, java.lang.String charset, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.io.Reader self, java.lang.String regex, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.io.Reader self, java.util.regex.Pattern pattern, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.io.InputStream stream, java.lang.String regex, java.lang.String charset, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.io.InputStream stream, java.util.regex.Pattern pattern, java.lang.String charset, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.io.InputStream stream, java.lang.String regex, Closure closure)


splitEachLine

@Deprecated
public static java.lang.Object splitEachLine(java.io.InputStream stream, java.util.regex.Pattern pattern, Closure closure)


spread

public static SpreadMap spread(java.util.Map self)


sprintf

public static java.lang.String sprintf(java.lang.Object self, java.lang.String format, java.lang.Object[] values)


sprintf

public static java.lang.String sprintf(java.lang.Object self, java.lang.String format, java.lang.Object arg)


step

public static void step(java.lang.Number self, java.lang.Number to, java.lang.Number stepNumber, Closure closure)
Get the absolute value
Parameters:
number - a Float
Returns:
the absolute value of that Float
Since:
1.0


stripIndent

public static java.lang.CharSequence stripIndent(java.lang.CharSequence self)


stripIndent

}
public static java.lang.CharSequence stripIndent(java.lang.CharSequence self, int numChars)


stripIndent

}
public static java.lang.String stripIndent(java.lang.String self)


stripIndent

}
public static java.lang.String stripIndent(java.lang.String self, int numChars)


stripMargin

}
public static java.lang.CharSequence stripMargin(java.lang.CharSequence self)


stripMargin

}
public static java.lang.CharSequence stripMargin(java.lang.CharSequence self, char marginChar)


stripMargin

}
public static java.lang.String stripMargin(java.lang.CharSequence self, java.lang.CharSequence marginChar)


stripMargin

}
public static java.lang.String stripMargin(java.lang.String self)


stripMargin

}
public static java.lang.String stripMargin(java.lang.String self, char marginChar)


stripMargin

}
public static java.lang.String stripMargin(java.lang.String self, java.lang.String marginChar)


subMap

public static java.util.Map subMap(java.util.Map map, java.util.Collection keys)
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.
def map=[:]
 map.get("a", []) << 5
 assert map == [a:[5]]
Parameters:
map - a Map
key - the key to lookup the value of
defaultValue - the value to return and add to the map for this key if there is no entry for the given key
Returns:
the value of the given key or the default value, added to the map if the key did not exist
Since:
1.0


subsequences

public static java.util.Set subsequences(java.util.List self)
Finds all permutations of a collection.

Example usage:

def result = [1, 2, 3].permutations()
 assert result == [[3, 2, 1], [3, 1, 2], [1, 3, 2], [2, 3, 1], [2, 1, 3], [1, 2, 3]] as Set
Parameters:
self - the Collection of items
Returns:
the permutations from the list
Since:
1.7.0


sum

public static java.lang.Object sum(java.util.Collection self)
Sums the items in an array. This is equivalent to invoking the "plus" method on all items in the array.
Parameters:
self - The array of values to add together
Returns:
The sum of all of the items
See Also:
sum(java.util.Collection)
Since:
1.7.1


sum

public static java.lang.Object sum(java.lang.Object[] self)


sum

public static java.lang.Object sum(java.util.Iterator self)


sum

public static java.lang.Object sum(java.util.Collection self, java.lang.Object initialValue)


sum

public static java.lang.Object sum(java.lang.Object[] self, java.lang.Object initialValue)


sum

public static java.lang.Object sum(java.util.Iterator self, java.lang.Object initialValue)


sum

public static java.lang.Object sum(java.util.Collection self, Closure closure)
Sums the result of apply a closure to each item of an array. array.sum(closure) is equivalent to: array.collect(closure).sum().
Parameters:
self - An array
closure - a single parameter closure that returns a numeric value.
Returns:
The sum of the values returned by applying the closure to each item of the array.
Since:
1.7.1


sum

public static java.lang.Object sum(java.lang.Object[] self, Closure closure)


sum

public static java.lang.Object sum(java.util.Iterator self, Closure closure)


sum

public static java.lang.Object sum(java.util.Collection self, java.lang.Object initialValue, Closure closure)


sum

public static java.lang.Object sum(java.lang.Object[] self, java.lang.Object initialValue, Closure closure)


sum

public static java.lang.Object sum(java.util.Iterator self, java.lang.Object initialValue, Closure closure)


tail

public static java.util.List tail(java.util.List self)


tail

public static java.lang.Object[] tail(java.lang.Object[] self)
Returns the first num elements from the head of this list.
 def strings = [ 'a', 'b', 'c' ]
 assert strings.take( 0 ) == []
 assert strings.take( 2 ) == [ 'a', 'b' ]
 assert strings.take( 5 ) == [ 'a', 'b', 'c' ]
 
Similar to take(Iterable, int) except that it attempts to preserve the type of the original list.
Parameters:
self - the original list
num - the number of elements to take from this list
Returns:
a list consisting of the first num elements of this list, or else the whole list if it has less then num elements.
Since:
1.8.1


take

public static java.util.List take(java.util.List self, int num)
Returns the first num elements from the head of this array.
 String[] strings = [ 'a', 'b', 'c' ]
 assert strings.take( 0 ) == [] as String[]
 assert strings.take( 2 ) == [ 'a', 'b' ] as String[]
 assert strings.take( 5 ) == [ 'a', 'b', 'c' ] as String[]
 
Parameters:
self - the original array
num - the number of elements to take from this array
Returns:
an array consisting of the first num elements of this array, or else the whole array if it has less then num elements.
Since:
1.8.1


take

public static java.lang.Object[] take(java.lang.Object[] self, int num)


take

public static java.util.List take(java.lang.Iterable self, int num)
Returns a new map containing the first num elements from the head of this map. If the map instance does not have ordered keys, then this function could return a random num entries. Groovy by default uses LinkedHashMap, so this shouldn't be an issue in the main.
 def strings = [ 'a':10, 'b':20, 'c':30 ]
 assert strings.take( 0 ) == [:]
 assert strings.take( 2 ) == [ 'a':10, 'b':20 ]
 assert strings.take( 5 ) == [ 'a':10, 'b':20, 'c':30 ]
 
Parameters:
self - the original map
num - the number of elements to take from this map
Returns:
a new map consisting of the first num elements of this map, or else the whole map if it has less then num elements.
Since:
1.8.1


take

public static java.util.Map take(java.util.Map self, int num)


take

public static CharSequence take(CharSequence self, int num) {
public static java.util.Iterator take(java.util.Iterator self, int num)


take

ret.addAll(self);
public static java.lang.CharSequence take(java.lang.CharSequence self, int num)


takeWhile

public static java.util.List takeWhile(java.util.List self, Closure condition)


takeWhile

public static java.util.List takeWhile(java.lang.Iterable self, Closure condition)
Returns the longest prefix of this Map where each entry (or key/value pair) when passed to the given closure evaluates to true.
 def shopping = [milk:1, bread:2, chocolate:3]
 assert shopping.takeWhile{ it.key.size() < 6 } == [milk:1, bread:2]
 assert shopping.takeWhile{ it.value % 2 } == [milk:1]
 assert shopping.takeWhile{ k, v -> k.size() + v <= 7 } == [milk:1, bread:2]
 
If the map instance does not have ordered keys, then this function could appear to take random entries. Groovy by default uses LinkedHashMap, so this shouldn't be an issue in the main.
Parameters:
self - a Map
condition - a 1 (or 2) arg Closure that must evaluate to true for the entry (or key and value) to continue taking elements
Returns:
a prefix of the given Map where each entry (or key/value pair) passed to the given closure evaluates to true
Since:
1.8.7


takeWhile

public static java.util.Map takeWhile(java.util.Map self, Closure condition)
Returns the longest prefix of this array where each element passed to the given closure evaluates to true.
 def nums = [ 1, 3, 2 ] as Integer[]
 assert nums.takeWhile{ it < 1 } == [] as Integer[]
 assert nums.takeWhile{ it < 3 } == [ 1 ] as Integer[]
 assert nums.takeWhile{ it < 4 } == [ 1, 3, 2 ] as Integer[]
 
Parameters:
self - the original array
condition - the closure that must evaluate to true to continue taking elements
Returns:
a prefix of the given array where each element passed to the given closure evaluates to true
Since:
1.8.7


takeWhile

public static java.lang.Object[] takeWhile(java.lang.Object[] self, Closure condition)


takeWhile

public static java.util.Iterator takeWhile(java.util.Iterator self, Closure condition)


times

public static void times(java.lang.Number self, Closure closure)


toArrayString

public static java.lang.String toArrayString(java.lang.Object[] self)


toBigDecimal

public static java.math.BigDecimal toBigDecimal(java.lang.Number self)
Logical implication of two boolean operators
Parameters:
left - left operator
right - right operator
Returns:
result of logical implication
Since:
1.8.3


toBigDecimal

}
public static java.math.BigDecimal toBigDecimal(java.lang.CharSequence self)


toBigDecimal

}
public static java.math.BigDecimal toBigDecimal(java.lang.String self)


toBigInteger

public static java.math.BigInteger toBigInteger(java.lang.Number self)
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.
Parameters:
self - the iteration object over which to iterate
closure - the filter to perform a match on the collection
Returns:
an integer that is the index of the first matched object or -1 if no match was found
Since:
1.0


toBigInteger

}
public static java.math.BigInteger toBigInteger(java.lang.CharSequence self)


toBigInteger

}
public static java.math.BigInteger toBigInteger(java.lang.String self)


toBoolean

public static java.lang.Boolean toBoolean(java.lang.Boolean self)


toBoolean

}
public static java.lang.Boolean toBoolean(java.lang.String self)


toCharacter

}
public static java.lang.Character toCharacter(java.lang.String self)


toDouble

public static java.lang.Double toDouble(java.lang.Number self)
Logical disjunction of two boolean operators
Parameters:
left - left operator
right - right operator
Returns:
result of logical disjunction
Since:
1.0


toDouble

}
public static java.lang.Double toDouble(java.lang.CharSequence self)


toDouble

}
public static java.lang.Double toDouble(java.lang.String self)


toFloat

public static java.lang.Float toFloat(java.lang.Number self)
Logical conjunction of two boolean operators.
Parameters:
left - left operator
right - right operator
Returns:
result of logical conjunction
Since:
1.0


toFloat

}
public static java.lang.Float toFloat(java.lang.CharSequence self)


toFloat

}
public static java.lang.Float toFloat(java.lang.String self)


toInteger

public static java.lang.Integer toInteger(java.lang.Number self)


toInteger

}
public static java.lang.Integer toInteger(java.lang.CharSequence self)


toInteger

}
public static java.lang.Integer toInteger(java.lang.String self)


toList

public static java.util.List toList(java.util.Collection self)
Convert an iterator to a List. The iterator will become exhausted of elements after making this conversion.
Parameters:
self - an iterator
Returns:
a List
Since:
1.5.0


toList

public static java.util.List toList(java.util.Iterator self)


toList

public static java.util.List toList(java.lang.Iterable self)
Convert an enumeration to a List.
Parameters:
self - an enumeration
Returns:
a List
Since:
1.5.0


toList

public static java.util.List toList(java.util.Enumeration self)


toList

public static java.util.List toList(java.lang.Object[] array)


toList

public static java.util.List toList(byte[] array)
Converts this array to a Set, with each unique element added to the set.
Parameters:
array - a byte array
Returns:
a set containing the unique contents of this array.
Since:
1.8.0


toList

public static java.util.List toList(boolean[] array)
Converts this array to a Set, with each unique element added to the set.
Parameters:
array - a boolean array
Returns:
a set containing the unique contents of this array.
Since:
1.8.0


toList

public static java.util.List toList(char[] array)
Converts this array to a Set, with each unique element added to the set.
Parameters:
array - a char array
Returns:
a set containing the unique contents of this array.
Since:
1.8.0


toList

public static java.util.List toList(short[] array)
Converts this array to a Set, with each unique element added to the set.
Parameters:
array - a short array
Returns:
a set containing the unique contents of this array.
Since:
1.8.0


toList

public static java.util.List toList(int[] array)
Converts this array to a Set, with each unique element added to the set.
Parameters:
array - an int array
Returns:
a set containing the unique contents of this array.
Since:
1.8.0


toList

public static java.util.List toList(long[] array)
Converts this array to a Set, with each unique element added to the set.
Parameters:
array - a long array
Returns:
a set containing the unique contents of this array.
Since:
1.8.0


toList

public static java.util.List toList(float[] array)
Converts this array to a Set, with each unique element added to the set.
Parameters:
array - a float array
Returns:
a set containing the unique contents of this array.
Since:
1.8.0


toList

public static java.util.List toList(double[] array)
Converts this array to a Set, with each unique element added to the set.
Parameters:
array - a double array
Returns:
a set containing the unique contents of this array.
Since:
1.8.0


toList

@Deprecated
public static java.util.List toList(java.lang.CharSequence self)


toList

@Deprecated
public static java.util.List toList(java.lang.String self)


toListString

public static java.lang.String toListString(java.util.Collection self)


toListString

public static java.lang.String toListString(java.util.Collection self, int maxSize)


toLong

public static java.lang.Long toLong(java.lang.Number self)


toLong

@Deprecated
public static java.lang.Long toLong(java.lang.CharSequence self)


toLong

@Deprecated
public static java.lang.Long toLong(java.lang.String self)


toLowerCase

public static char toLowerCase(java.lang.Character self)


toMapString

public static java.lang.String toMapString(java.util.Map self)
Increment a Character by one.
Parameters:
self - a Character
Returns:
an incremented Character
Since:
1.5.7


toMapString

public static java.lang.String toMapString(java.util.Map self, int maxSize)


toSet

* @return a Set
public static java.util.Set toSet(byte[] array)


toSet

* @param self an iterator
public static java.util.Set toSet(boolean[] array)


toSet

* Convert an enumeration to a Set.
public static java.util.Set toSet(char[] array)


toSet

public static java.util.Set toSet(short[] array)


toSet

/**
public static java.util.Set toSet(int[] array)
Implements the getAt(int) method for primitive type arrays.
Parameters:
self - an array object
idx - the index of interest
Returns:
the returned value from the array
Since:
1.5.0


toSet

}
public static java.util.Set toSet(long[] array)
Implements the getAt(Range) method for primitive type arrays.
Parameters:
self - an array object
range - the range of indices of interest
Returns:
the returned values from the array corresponding to the range
Since:
1.5.0


toSet

*/
public static java.util.Set toSet(float[] array)


toSet

return answer;
public static java.util.Set toSet(double[] array)


toSet

public static java.util.Set toSet(java.util.Collection self)
Implements the setAt(int idx) method for primitive type arrays.
Parameters:
self - an object
idx - the index of interest
newValue - the new value to be put into the index of interest
Returns:
the added value
Since:
1.5.0


toSet

public static java.util.Set toSet(java.util.Iterator self)


toSet

public static java.util.Set toSet(java.util.Enumeration self)


toSet

@Deprecated
public static java.util.Set toSet(java.lang.CharSequence self)


toSet

@Deprecated
public static java.util.Set toSet(java.lang.String self)


toShort

@Deprecated
public static java.lang.Short toShort(java.lang.CharSequence self)


toShort

@Deprecated
public static java.lang.Short toShort(java.lang.String self)


toSpreadMap

public static SpreadMap toSpreadMap(java.util.Map self)
Creates a spreadable map from this array.

Parameters:
self - an object array
Returns:
a newly created SpreadMap
See Also:
SpreadMap.SpreadMap
toSpreadMap(java.util.Map)
Since:
1.0


toSpreadMap

public static SpreadMap toSpreadMap(java.lang.Object[] self)


toSpreadMap

public static SpreadMap toSpreadMap(java.util.List self)


toString

public static java.lang.String toString(boolean[] self)


toString

public static java.lang.String toString(byte[] self)


toString

public static java.lang.String toString(char[] self)


toString

public static java.lang.String toString(short[] 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].
Parameters:
self - a Collection
Returns:
the string representation
Since:
1.0


toString

public static java.lang.String toString(int[] self)


toString

public static java.lang.String toString(long[] self)


toString

public static java.lang.String toString(float[] self)


toString

public static java.lang.String toString(double[] self)


toString

public static java.lang.String toString(java.util.AbstractMap self)


toString

public static java.lang.String toString(java.util.AbstractCollection self)


toString

public static java.lang.String toString(java.lang.Object[] self)


toString

public static java.lang.String toString(java.lang.Object value)


toURI

public static java.net.URI toURI(java.lang.CharSequence self)


toURI

public static java.net.URI toURI(java.lang.String self)


toURL

public static java.net.URL toURL(java.lang.CharSequence self)


toURL

public static java.net.URL toURL(java.lang.String self)


toUpperCase

public static char toUpperCase(java.lang.Character self)


tokenize

}
public static java.util.List tokenize(java.lang.CharSequence self)


tokenize

}
public static java.util.List tokenize(java.lang.CharSequence self, java.lang.Character token)


tokenize

}
public static java.util.List tokenize(java.lang.CharSequence self, java.lang.CharSequence token)


tokenize

}

public static java.util.List tokenize(java.lang.String self)


tokenize

public static java.util.List tokenize(java.lang.String self, java.lang.Character token)


tokenize

@Deprecated
public static java.util.List tokenize(java.lang.String self, java.lang.String token)


tr

public static java.lang.CharSequence tr(java.lang.CharSequence self, java.lang.CharSequence sourceSet, java.lang.CharSequence replacementSet)


tr

public static java.lang.String tr(java.lang.String self, java.lang.String sourceSet, java.lang.String replacementSet)


transformChar

public static void transformChar(java.io.Reader self, java.io.Writer writer, Closure closure)


transformLine

public static void transformLine(java.io.Reader reader, java.io.Writer writer, Closure closure)


transpose

public static java.util.List transpose(java.util.List self)


traverse

@Deprecated
public static void traverse(java.io.File self, java.util.Map options, Closure closure)


traverse

public static  T withDataOutputStream(File file, Closure closure) throws IOException {
public static void traverse(java.io.File self, Closure closure)


traverse

public static  T withDataInputStream(File file, Closure closure) throws IOException {
public static void traverse(java.io.File self, java.util.Map options)


trunc

public static float trunc(java.lang.Float number, int precision)


trunc

public static float trunc(java.lang.Float number)


trunc

public static double trunc(java.lang.Double number)


trunc

public static double trunc(java.lang.Double number, int precision)


unaryMinus

public static java.lang.Number unaryMinus(java.lang.Number left)


unexpand

public static java.lang.CharSequence unexpand(java.lang.CharSequence self)


unexpand

public static java.lang.CharSequence unexpand(java.lang.CharSequence self, int tabStop)


unexpand

public static java.lang.String unexpand(java.lang.String self)


unexpand

public static java.lang.String unexpand(java.lang.String self, int tabStop)


unexpandLine

public static java.lang.CharSequence unexpandLine(java.lang.CharSequence self, int tabStop)


unexpandLine

public static java.lang.String unexpandLine(java.lang.String self, int tabStop)


unique

public static java.util.Iterator unique(java.util.Iterator self)


unique

public static java.util.Collection unique(java.util.Collection self)


unique

public static java.util.Collection unique(java.util.Collection self, boolean mutate)


unique

public static java.util.Iterator unique(java.util.Iterator self, Closure closure)


unique

public static java.util.Collection unique(java.util.Collection self, Closure closure)


unique

public static java.util.Collection unique(java.util.Collection self, boolean mutate, Closure closure)


unique

public static java.util.Iterator unique(java.util.Iterator self, java.util.Comparator comparator)
Returns an iterator equivalent to this iterator with all duplicated items removed by using the supplied comparator.
Parameters:
self - an Iterator
comparator - a Comparator
Returns:
the modified Iterator
Since:
1.5.5


unique

public static java.util.Collection unique(java.util.Collection self, java.util.Comparator comparator)


unique

public static java.util.Collection unique(java.util.Collection self, boolean mutate, java.util.Comparator comparator)


upto

public static void upto(java.lang.Number self, java.lang.Number to, Closure closure)


upto

public static void upto(long self, java.lang.Number to, Closure closure)


upto

public static void upto(java.lang.Long self, java.lang.Number to, Closure closure)


upto

public static void upto(float self, java.lang.Number to, Closure closure)


upto

public static void upto(java.lang.Float self, java.lang.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
Parameters:
self - a BigDecimal
to - the end number
closure - the code to execute for each number
Since:
1.0


upto

public static void upto(double self, java.lang.Number to, Closure closure)


upto

public static void upto(java.lang.Double self, java.lang.Number to, Closure closure)
Iterates from this number down to the given number, inclusive, decrementing by one each time.
Parameters:
self - a Number
to - another Number to go down to
closure - the closure to call
Since:
1.0


upto

public static void upto(java.math.BigInteger self, java.lang.Number to, Closure closure)
Iterates from this number down to the given number, inclusive, decrementing by one each time.
Parameters:
self - a long
to - the end number
closure - the code to execute for each number
Since:
1.0


upto

public static void upto(java.math.BigDecimal self, java.lang.Number to, Closure closure)
Iterates from this number down to the given number, inclusive, decrementing by one each time.
Parameters:
self - a Long
to - the end number
closure - the code to execute for each number
Since:
1.0


use

public static java.lang.Object use(java.lang.Object self, java.lang.Class categoryClass, Closure closure)
Scoped use method
Parameters:
self - any Object
categoryClass - a category class to use
closure - the closure to invoke with the category in place
Returns:
the value returned from the closure
Since:
1.0


use

public static java.lang.Object use(java.lang.Object self, java.util.List categoryClassList, Closure closure)


use

public static java.lang.Object use(java.lang.Object self, java.lang.Object[] array)


with

public static java.lang.Object with(java.lang.Object self, Closure closure)


withDataInputStream

@Deprecated
public static java.lang.Object withDataInputStream(java.io.File file, Closure closure)


withDataOutputStream

@Deprecated
public static java.lang.Object withDataOutputStream(java.io.File file, Closure closure)


withDefault

public static java.util.Map withDefault(java.util.Map self, Closure init)
An alias for withLazyDefault which decorates a list allowing it to grow when called with index values outside the normal list bounds.
Parameters:
self - a List
init - a Closure with the target index as parameter which generates the default value
Returns:
the decorated List
See Also:
withLazyDefault(java.util.List, groovy.lang.Closure)
withEagerDefault(java.util.List, groovy.lang.Closure)
Since:
1.8.7


withDefault

public static java.util.List withDefault(java.util.List self, Closure init)


withEagerDefault

public static java.util.List withEagerDefault(java.util.List self, Closure init)
Sorts the Collection. Assumes that the collection items are comparable and uses their natural ordering to determine the resulting order. If the Collection is a List, it is sorted in place and returned. Otherwise, the elements are first placed into a new list which is then sorted and returned - leaving the original Collection unchanged.
assert [1,2,3] == [3,1,2].sort()
Parameters:
self - the collection to be sorted
Returns:
the sorted collection as a List
See Also:
sort(Collection, boolean)
Since:
1.0


withInputStream

@Deprecated
public static java.lang.Object withInputStream(java.io.File file, Closure closure)


withInputStream

@Deprecated
public static java.lang.Object withInputStream(java.net.URL url, Closure closure)


withLazyDefault

public static java.util.List withLazyDefault(java.util.List self, Closure init)


withObjectInputStream

@Deprecated
public static java.lang.Object withObjectInputStream(java.io.File file, Closure closure)


withObjectInputStream

@Deprecated
public static java.lang.Object withObjectInputStream(java.io.File file, java.lang.ClassLoader classLoader, Closure closure)


withObjectInputStream

@Deprecated
public static java.lang.Object withObjectInputStream(java.io.InputStream inputStream, Closure closure)


withObjectInputStream

@Deprecated
public static java.lang.Object withObjectInputStream(java.io.InputStream inputStream, java.lang.ClassLoader classLoader, Closure closure)


withObjectOutputStream

@Deprecated
public static java.lang.Object withObjectOutputStream(java.io.File file, Closure closure)


withObjectOutputStream

@Deprecated
public static java.lang.Object withObjectOutputStream(java.io.OutputStream outputStream, Closure closure)


withObjectStreams

public static java.lang.Object withObjectStreams(java.net.Socket socket, Closure closure)


withOutputStream

@Deprecated
public static java.lang.Object withOutputStream(java.io.File file, Closure closure)


withPrintWriter

@Deprecated
public static java.lang.Object withPrintWriter(java.io.File file, Closure closure)


withPrintWriter

@Deprecated
public static java.lang.Object withPrintWriter(java.io.File file, java.lang.String charset, Closure closure)


withPrintWriter

@Deprecated
public static java.lang.Object withPrintWriter(java.io.Writer writer, Closure closure)


withReader

@Deprecated
public static java.lang.Object withReader(java.io.File file, Closure closure)


withReader

@Deprecated
public static java.lang.Object withReader(java.io.File file, java.lang.String charset, Closure closure)


withReader

@Deprecated
public static java.lang.Object withReader(java.io.Reader reader, Closure closure)


withReader

@Deprecated
public static java.lang.Object withReader(java.net.URL url, Closure closure)


withReader

@Deprecated
public static java.lang.Object withReader(java.net.URL url, java.lang.String charset, Closure closure)


withReader

@Deprecated
public static java.lang.Object withReader(java.io.InputStream in, Closure closure)


withReader

@Deprecated
public static java.lang.Object withReader(java.io.InputStream in, java.lang.String charset, Closure closure)


withStream

@Deprecated
public static java.lang.Object withStream(java.io.InputStream stream, Closure closure)


withStream

@Deprecated
public static java.lang.Object withStream(java.io.OutputStream os, Closure closure)


withStreams

public static java.lang.Object withStreams(java.net.Socket socket, Closure closure)


withWriter

@Deprecated
public static java.lang.Object withWriter(java.io.File file, Closure closure)


withWriter

@Deprecated
public static java.lang.Object withWriter(java.io.File file, java.lang.String charset, Closure closure)


withWriter

@Deprecated
public static java.lang.Object withWriter(java.io.Writer writer, Closure closure)


withWriter

@Deprecated
public static java.lang.Object withWriter(java.io.OutputStream stream, Closure closure)


withWriter

@Deprecated
public static java.lang.Object withWriter(java.io.OutputStream stream, java.lang.String charset, Closure closure)


withWriterAppend

@Deprecated
public static java.lang.Object withWriterAppend(java.io.File file, java.lang.String charset, Closure closure)


withWriterAppend

@Deprecated
public static java.lang.Object withWriterAppend(java.io.File file, Closure closure)


write

@Deprecated
public static void write(java.io.Writer self, Writable writable)


write

public static void write(java.io.File file, java.lang.String text)


write

public static void write(java.io.File file, java.lang.String text, java.lang.String charset)


writeLine

public static void writeLine(java.io.BufferedWriter writer, java.lang.String line)


xor

public static java.util.BitSet xor(java.util.BitSet left, java.util.BitSet right)


xor

public static java.lang.Number xor(java.lang.Number left, java.lang.Number right)


xor

public static java.lang.Boolean xor(java.lang.Boolean left, java.lang.Boolean right)


 

Groovy Documentation