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)

static float abs(java.lang.Float number)

static double abs(java.lang.Double number)

Determine if a Character is lowercase.

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)

static boolean asBoolean(java.lang.Boolean bool)

static boolean asBoolean(java.util.Collection collection)

static boolean asBoolean(java.util.Map map)

static boolean asBoolean(java.util.Iterator iterator)

static boolean asBoolean(java.util.Enumeration enumeration)

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

static boolean asBoolean(byte[] array)

static boolean asBoolean(short[] array)

static boolean asBoolean(int[] array)

static boolean asBoolean(long[] array)

static boolean asBoolean(float[] array)

static boolean asBoolean(double[] array)

static boolean asBoolean(boolean[] array)

static boolean asBoolean(char[] array)

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 list

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)

static java.util.List asList(java.lang.Iterable self)

Coerce an Boolean 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)

Creates a new List with the identical contents to this list but in reverse order.

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)

@deprecated Use the Iterable version of collectEntries instead

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

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

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

@deprecated Use the Iterable version of collectEntries instead

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

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

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

@deprecated Use the Iterable version of collectEntries instead

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)

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

@deprecated Use the Iterable version of collectEntries instead

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

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)

@deprecated Use the Iterable version of collectMany instead

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

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

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

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

static java.util.Collection collectMany(java.util.Map self, 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)

static java.util.List collectNested(java.lang.Iterable 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.Collection collectNested(java.lang.Iterable self, java.util.Collection collector, Closure transform)

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

Adds GroovyCollections#combinations(Iterable) as a method on Iterables.

static java.util.List combinations(java.lang.Iterable self)

Adds GroovyCollections#combinations(Iterable, Closure) as a method on collections.

static java.util.List combinations(java.lang.Iterable self, Closure function)

Applies a function on each combination of the input lists.

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

Multiply a Number by a Character.

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

Multiply two Characters.

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)

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)

Returns the string representation of the given array.

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)

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)

@deprecated use count(Iterable, Closure)

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

@deprecated use count(Iterable, Closure)

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

static java.lang.Number count(java.lang.Iterable 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 of the given value 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)

static java.util.Map countBy(java.lang.Iterable 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)

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

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)

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

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)

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)

Drops the given number of elements from the head of this Iterable.

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)

Drops the given number of key/value pairs from the head of this map if they are available.

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)

Create a suffix of the given array by dropping as many elements as possible from the front of the original array such that calling the given closure condition evaluates to true when passed each of the dropped elements.

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

Creates an Iterator that returns a suffix of the elements from an original Iterator.

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 eachCombination(java.lang.Iterable self, Closure function)

Finds all non-null subsequences of a list.

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. matching Groovy truth).

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)

@deprecated Use the Iterable version of groupBy instead

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)

@deprecated Use the Iterable version of findResults instead

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.lang.Iterable 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)

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

Returns the first item from the Object array.

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

Flatten an array.

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

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)

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

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

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

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)

Select a List of items from an eager or lazy List using a Collection to identify the indices to be selected.

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

Support the range subscript operator for an eager or lazy List.

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

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

Support the range subscript operator for a List.

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

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)

Allows conversion of arrays into a mutable List.

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.lang.Iterable self, int idx)

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

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

Returns a new Map containing all entries from left and right, giving precedence to right.

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)

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.lang.Iterable self, Closure closure)

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

@deprecated Use the Iterable version of groupBy instead

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

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

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

Sorts all array members into (sub)groups determined by the supplied mapping closures as per the Iterable variant of this method.

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

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

Sorts all array members into (sub)groups determined by the supplied mapping closures as per the list variant of this method.

static java.util.Map groupBy(java.lang.Object[] self, java.util.List 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)

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

static 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)

@deprecated Use the Iterable version of sum instead

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)

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

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

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)

Transform a Number into a Long

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)

@deprecated Use the Iterable version of join instead

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

static java.lang.String join(java.lang.Iterable 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)

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.lang.Iterable self)

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

@deprecated Use the Iterable version of max instead

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.lang.Iterable 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)

@deprecated Use the Iterable version of max instead

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

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

Selects the maximum value found from the Iterator using the given 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 Collection objects.

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

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

@deprecated Use the Iterable version of min instead

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

Selects the minimum value found in the Iterable using the given comparator.

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

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

Selects the minimum value found from the Iterator using the given comparator.

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

@deprecated Use the Iterable version of min instead

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.lang.Object min(java.lang.Iterable 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)

@deprecated Use the Iterable version of max instead

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)

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)

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)

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)

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

Power of a long to an integer certain exponent.

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)

Set the metaclass for an object.

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

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)

Compare two Characters.

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)

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

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.List permutations(java.util.List self, Closure function)

Iterates over all permutations of a collection, running a closure for each iteration.

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

Support the subscript operator for Collection.

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)

Create a Collection as a union of a Collection and an Iterable.

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)

Create a List composed of the elements of this list, repeated a certain number of times.

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)

Multiply a Character by a Number.

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)

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)

Checks whether the array contains the given value.

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)

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)

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

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)

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)

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)

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

Reverses the iterator.

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

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

Create an array containing elements from an original array plus an additional appended element.

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)

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)

Attempts to create an Iterator for the given object by first converting it to a Collection.

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)

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)

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

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.lang.Iterable self)

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

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

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

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

Modifies this array so that its elements are in sorted order.

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 using the comparator.

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

@deprecated Use the Iterable version of sort instead

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)

@deprecated Use the Iterable version of sort instead

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

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

static java.util.List sort(java.lang.Iterable self, boolean mutate, java.util.Comparator 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)

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)

Sorts this Collection using the given Closure to determine the correct ordering.

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

Sorts this Iterable using the given Closure to determine the correct ordering.

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

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

static java.util.List sort(java.lang.Iterable 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)

Provides an easy way to append multiple Map.Entry values to a Map.

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)

Creates a sub-Map containing the given keys.

static java.util.Map subMap(java.util.Map map, java.lang.Object[] 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)

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

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

@deprecated Use the Iterable version of sum instead

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

static java.lang.Object sum(java.lang.Iterable self, Closure closure)

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.Iterable 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)

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)

Returns an iterator of up to the first num elements from this iterator.

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)

Returns a List containing the longest prefix of the elements from this Iterable where each element passed to the given closure evaluates to true.

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)

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)

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)

static java.util.List toList(boolean[] array)

static java.util.List toList(char[] array)

static java.util.List toList(short[] array)

static java.util.List toList(int[] array)

static java.util.List toList(long[] array)

static java.util.List toList(float[] array)

static java.util.List toList(double[] array)

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)

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)

static java.util.Set toSet(long[] array)

static java.util.Set toSet(float[] array)

Implements the getAt(Collection) method for primitive type arrays.

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)

Checks whether the array contains the given value.

static java.util.Set toSet(java.util.Enumeration self)

Checks whether the array contains the given value.

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)

static java.lang.String toString(int[] self)

Returns the string representation of the given list.

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)

Decrement a Number by one.

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)

Transform a Number into an Integer

static java.lang.Number unaryMinus(java.lang.Number left)

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

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)

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)

@deprecated Use the Iterable version of sort instead

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, int), java.lang.Object#wait(long), 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)


abs

public static float abs(java.lang.Float number)


abs

public static double abs(java.lang.Double number)
Determine if a Character is lowercase. Synonym for 'Character.isLowerCase(this)'.
Parameters:
self - a Character
Returns:
true if the character is lowercase
See Also:
java.lang.Character#isLowerCase(char)
Since:
1.5.7


accept

@java.lang.Deprecatedreturn IOGroovyMethods.eachLine(stream, charset, closure);
public static java.net.Socket accept(java.net.ServerSocket serverSocket, Closure closure)


accept

@java.lang.Deprecatedreturn IOGroovyMethods.eachLine(stream, charset, firstLine, closure);
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

@java.lang.Deprecatedpublic static BufferedReader newReader(InputStream self) {
public static void append(java.io.File file, java.lang.Object text)


append

@java.lang.Deprecatedpublic static BufferedReader newReader(InputStream self, String charset) throws UnsupportedEncodingException {
public static void append(java.io.File file, byte[] bytes)


append

@java.lang.Deprecatedpublic static  T withReader(File file, Closure closure) throws IOException {
public static void append(java.io.File self, java.io.InputStream stream)


append

@java.lang.Deprecatedpublic static  T withReader(File file, String charset, Closure closure) throws IOException {
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)


asBoolean

public static boolean asBoolean(java.lang.Boolean bool)


asBoolean

public static boolean asBoolean(java.util.Collection collection)


asBoolean

public static boolean asBoolean(java.util.Map map)


asBoolean

public static boolean asBoolean(java.util.Iterator iterator)


asBoolean

public static boolean asBoolean(java.util.Enumeration enumeration)


asBoolean

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


asBoolean

public static boolean asBoolean(byte[] array)


asBoolean

public static boolean asBoolean(short[] array)


asBoolean

public static boolean asBoolean(int[] array)


asBoolean

public static boolean asBoolean(long[] array)


asBoolean

public static boolean asBoolean(float[] array)


asBoolean

public static boolean asBoolean(double[] array)


asBoolean

public static boolean asBoolean(boolean[] array)


asBoolean

public static boolean asBoolean(char[] array)


asBoolean

public static boolean asBoolean(java.lang.Character character)


asBoolean

public static boolean asBoolean(java.lang.Number number)


asBoolean

@java.lang.Deprecated}
public static boolean asBoolean(java.lang.CharSequence string)


asBoolean

@java.lang.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 list
Parameters:
self - a List
Returns:
an immutable List
See Also:
java.util.Collections#unmodifiableList(java.util.List)
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

@java.lang.Deprecated*/
public static java.util.List asList(java.util.Collection self)


asList

public static java.util.List asList(java.lang.Iterable self)
Coerce an Boolean instance to a boolean value.
Parameters:
bool - the Boolean
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

@java.lang.SuppressWarnings}
public static java.lang.Object asType(java.util.Collection col, java.lang.Class clazz)


asType

@java.lang.SuppressWarnings} catch (GroovyCastException ce) {
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

@java.lang.SuppressWarningsnew Class[]{clazz},
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

@java.lang.SuppressWarningsreturn reverse(self, false);
public static java.lang.Object asType(java.util.Map map, java.lang.Class clazz)
Creates a new List with the identical contents to this list but in reverse order.
 def list = ["a", 4, false]
 assert list.reverse() == [false, 4, "a"]
 assert list == ["a", 4, false]
 
Parameters:
self - a List
Returns:
a reversed List
See Also:
reverse(List, boolean)
Since:
1.0


asType

@java.lang.SuppressWarnings* @param closure a closure
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

@java.lang.SuppressWarningselse {
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

@java.lang.Deprecated}
public static java.lang.Object asType(java.lang.CharSequence self, java.lang.Class c)


asType

@java.lang.Deprecated}
@java.lang.SuppressWarnings
public static java.lang.Object asType(GString self, java.lang.Class c)


asType

@java.lang.Deprecated
@java.lang.SuppressWarnings@Deprecated
public static java.lang.Object asType(java.lang.String self, java.lang.Class c)


asType

@java.lang.Deprecatedreturn ResourceGroovyMethods.withPrintWriter(file, charset, closure);
public static java.lang.Object asType(java.io.File f, java.lang.Class c)


asWritable

@java.lang.Deprecatedreturn ResourceGroovyMethods.withPrintWriter(file, closure);
public static java.io.File asWritable(java.io.File file)


asWritable

@java.lang.Deprecatedreturn IOGroovyMethods.withPrintWriter(writer, closure);
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

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


bitwiseNegate

@java.lang.Deprecated
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

@java.lang.Deprecated
public static java.lang.CharSequence capitalize(java.lang.CharSequence self)


capitalize

@java.lang.Deprecated
public static java.lang.String capitalize(java.lang.String self)


center

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


center

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


center

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


center

@java.lang.Deprecated
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)
deprecated:
Use the Iterable version of collectEntries instead
See Also:
collectEntries(Iterable, Closure)
Since:
1.7.9


collectEntries

@java.lang.Deprecatedpublic static  Map collectEntries(Iterator self, Closure transform) {
public static java.util.Map collectEntries(java.util.Collection self, Closure transform)


collectEntries

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


collectEntries

public static java.util.Map collectEntries(java.lang.Iterable self, Closure transform)
deprecated:
Use the Iterable version of collectEntries instead
See Also:
collectEntries(Iterable)
Since:
1.8.5


collectEntries

@java.lang.Deprecated}
public static java.util.Map collectEntries(java.util.Collection self)


collectEntries

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


collectEntries

public static java.util.Map collectEntries(java.lang.Iterable self)
deprecated:
Use the Iterable version of collectEntries instead
See Also:
collectEntries(Iterable, Map, Closure)
Since:
1.7.9


collectEntries

@java.lang.Deprecatedpublic static  Map collectEntries(Iterator self, Map collector, Closure transform) {
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)


collectEntries

public static java.util.Map collectEntries(java.lang.Iterable self, java.util.Map collector, Closure transform)
deprecated:
Use the Iterable version of collectEntries instead
See Also:
collectEntries(Iterable, Map)
Since:
1.8.5


collectEntries

@java.lang.Deprecatedpublic static  Map collectEntries(Iterator self, Map collector) {
public static java.util.Map collectEntries(java.util.Collection self, java.util.Map collector)


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

@java.lang.Deprecated/**
public static java.util.List collectMany(java.util.Collection self, Closure projection)
deprecated:
Use the Iterable version of collectMany instead
See Also:
collectMany(Iterable, Closure)
Since:
1.8.1


collectMany

@java.lang.Deprecated* assert smallAnimals == ['cat', 'dog']
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.Iterable self, Closure projection)


collectMany

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


collectMany

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


collectMany

public static java.util.Collection collectMany(java.util.Map self, 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)


collectNested

public static java.util.List collectNested(java.lang.Iterable self, Closure transform)
Deprecated alias for collectNested
deprecated:
Use collectNested instead
See Also:
collectNested(Iterable, Collection, Closure)


collectNested

@java.lang.Deprecated* @param self      an Iterable
public static java.util.Collection collectNested(java.util.Collection self, java.util.Collection collector, Closure transform)


collectNested

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


combinations

@java.lang.Deprecatedpublic static List combinations(Iterable self) {
public static java.util.List combinations(java.util.Collection self)
Adds GroovyCollections#combinations(Iterable) as a method on Iterables.

Example usage:

 assert [['a', 'b'],[1, 2, 3]].combinations() == [['a', 1], ['b', 1], ['a', 2], ['b', 2], ['a', 3], ['b', 3]]
 
Parameters:
self - an Iterable of collections
Returns:
a List of the combinations found
See Also:
GroovyCollections.combinations
Since:
2.2.0


combinations

public static java.util.List combinations(java.lang.Iterable self)
Adds GroovyCollections#combinations(Iterable, Closure) as a method on collections.

Example usage:

assert [[2, 3],[4, 5, 6]].combinations {x,y -> x*y } == [8, 12, 10, 15, 12, 18]
Parameters:
self - a Collection of lists
function - a closure to be called on each combination
Returns:
a List of the results of applying the closure to each combinations found
See Also:
GroovyCollections.combinations
Since:
2.2.0


combinations

public static java.util.List combinations(java.lang.Iterable self, Closure function)
Applies a function on each combination of the input lists.

Example usage:

[[2, 3],[4, 5, 6]].eachCombination { println "Found $it" }
Parameters:
self - a Collection of lists
function - a closure to be called on each combination
See Also:
GroovyCollections.combinations
Since:
2.2.0


compareTo

public static int compareTo(java.lang.Character left, java.lang.Number right)
Multiply a Number by a Character. The ordinal value of the Character is used in the multiplication (the ordinal value is the unicode value which for simple character sets is the ASCII value).
Parameters:
left - a Number
right - a Character
Returns:
the multiplication of left by right
Since:
1.0


compareTo

public static int compareTo(java.lang.Number left, java.lang.Character right)
Multiply two Characters. The ordinal values of the Characters are used in the multiplication (the ordinal value is the unicode value which for simple character sets is the ASCII value).
Parameters:
left - a Character
right - another Character
Returns:
the Number corresponding to the multiplication of left by right
Since:
1.0


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)


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)
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(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)


contains

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


contains

@java.lang.Deprecated
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

@java.lang.Deprecated* @param value the value being searched for
public static java.lang.Number count(java.util.Collection self, java.lang.Object value)
deprecated:
use count(Iterable, Closure)
Since:
1.0


count

public static java.lang.Number count(java.lang.Iterable self, java.lang.Object value)
deprecated:
use count(Iterable, Closure)
Since:
1.8.0


count

@java.lang.Deprecated* @since 2.2.0
public static java.lang.Number count(java.util.Collection self, Closure closure)


count

public static java.lang.Number count(java.lang.Iterable 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 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(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

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


count

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


countBy

@java.lang.Deprecatedpublic static  Map countBy(Iterable self, Closure closure) {
public static java.util.Map countBy(java.util.Collection self, Closure closure)


countBy

public static java.util.Map countBy(java.lang.Iterable 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

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


createStringWriter

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


deleteDir

@java.lang.Deprecatedreturn ResourceGroovyMethods.withWriterAppend(file, charset, closure);
public static boolean deleteDir(java.io.File self)


denormalize

@java.lang.Deprecatedreturn StringGroovyMethods.findAll(self, pattern);
public static java.lang.CharSequence denormalize(java.lang.CharSequence self)


denormalize

@java.lang.Deprecatedreturn StringGroovyMethods.findAll(self, pattern, closure);
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)


div

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


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)
Iterates from this number down to the given number, inclusive, decrementing by one each time.
Parameters:
self - a BigInteger
to - the end number
closure - the code to execute for each number
Since:
1.0


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)


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)
Drops the given number of elements from the head of this Iterable.
 class AbcIterable implements Iterable {
     Iterator iterator() { "abc".iterator() }
 }
 def abc = new AbcIterable()
 assert abc.drop(0) == ['a', 'b', 'c']
 assert abc.drop(1) == ['b', 'c']
 assert abc.drop(3) == []
 assert abc.drop(5) == []
 
Parameters:
self - the original Iterable
num - the number of elements to drop from this Iterable
Returns:
a List consisting of all the elements of this Iterable minus the first num elements, or an empty list if it has less then num elements.
Since:
1.8.7


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)
Drops the given number of key/value pairs from the head of this map if they are available.
 def strings = [ 'a':10, 'b':20, 'c':30 ]
 assert strings.drop( 0 ) == [ 'a':10, 'b':20, 'c':30 ]
 assert strings.drop( 2 ) == [ 'c':30 ]
 assert strings.drop( 5 ) == [:]
 
If the map instance does not have ordered keys, then this function could drop a random num entries. Groovy by default uses LinkedHashMap, so this shouldn't be an issue in the main.
Parameters:
self - the original map
num - the number of elements to drop from this map
Returns:
a map consisting of all key/value pairs of this map except the first num ones, or else the empty map, if this map has less than num elements.
Since:
1.8.1


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

@java.lang.Deprecatedreturn StringGroovyMethods.findAll(self, pattern);
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)
Create a suffix of the given array by dropping as many elements as possible from the front of the original array such that calling the given closure condition evaluates to true when passed each of the dropped elements.
 def nums = [ 1, 3, 2 ] as Integer[]
 assert nums.dropWhile{ it <= 3 } == [ ] as Integer[]
 assert nums.dropWhile{ it < 3 } == [ 3, 2 ] as Integer[]
 assert nums.dropWhile{ it != 2 } == [ 2 ] as Integer[]
 assert nums.dropWhile{ it == 0 } == [ 1, 3, 2 ] as Integer[]
 
Parameters:
self - the original array
condition - the closure that must evaluate to true to continue dropping elements
Returns:
the shortest suffix of the given array such that the given closure condition evaluates to true for each element dropped from the front of the array
Since:
1.8.7


dropWhile

public static java.lang.Object[] dropWhile(java.lang.Object[] self, Closure condition)
Creates an Iterator that returns a suffix of the elements from an original Iterator. As many elements as possible are dropped from the front of the original Iterator such that calling the given closure condition evaluates to true when passed each of the dropped elements.
 def a = 0
 def iter = [ hasNext:{ a < 10 }, next:{ a++ } ] as Iterator
 assert [].iterator().dropWhile{ it < 3 }.toList() == []
 assert [1, 2, 3, 4, 5].iterator().dropWhile{ it < 3 }.toList() == [ 3, 4, 5 ]
 assert iter.dropWhile{ it < 5 }.toList() == [ 5, 6, 7, 8, 9 ]
 
Parameters:
self - the Iterator
condition - the closure that must evaluate to true to continue dropping elements
Returns:
the shortest suffix of elements from the given Iterator such that the given closure condition evaluates to true for each element dropped from the front of the Iterator
Since:
1.8.7


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

@java.lang.Deprecated
public static void eachByte(java.io.File self, Closure closure)


eachByte

@java.lang.Deprecated
public static void eachByte(java.io.File self, int bufferLen, Closure closure)


eachByte

@java.lang.Deprecated
public static void eachByte(java.io.InputStream is, Closure closure)


eachByte

@java.lang.Deprecated
public static void eachByte(java.io.InputStream is, int bufferLen, Closure closure)


eachByte

@java.lang.Deprecated
public static void eachByte(java.net.URL url, Closure closure)


eachByte

@java.lang.Deprecated
public static void eachByte(java.net.URL url, int bufferLen, Closure closure)


eachCombination

public static void eachCombination(java.lang.Iterable self, Closure function)
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


eachDir

@java.lang.Deprecatedreturn ResourceGroovyMethods.withOutputStream(file, closure);
public static void eachDir(java.io.File self, Closure closure)


eachDirMatch

@java.lang.Deprecatedreturn ResourceGroovyMethods.withWriter(file, charset, closure);
public static void eachDirMatch(java.io.File self, java.lang.Object nameFilter, Closure closure)


eachDirRecurse

@java.lang.Deprecated
public static void eachDirRecurse(java.io.File self, Closure closure)


eachFile

@java.lang.Deprecatedpublic static BufferedOutputStream newOutputStream(File file) throws IOException {
public static void eachFile(java.io.File self, FileType fileType, Closure closure)


eachFile

@java.lang.Deprecatedreturn ResourceGroovyMethods.newDataOutputStream(file);
public static void eachFile(java.io.File self, Closure closure)


eachFileMatch

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


eachFileMatch

@java.lang.Deprecatedpublic static  T withWriter(File file, Closure closure) throws IOException {
public static void eachFileMatch(java.io.File self, java.lang.Object nameFilter, Closure closure)


eachFileRecurse

@java.lang.Deprecatedreturn ResourceGroovyMethods.withInputStream(file, closure);
public static void eachFileRecurse(java.io.File self, FileType fileType, Closure closure)


eachFileRecurse

@java.lang.Deprecated
public static void eachFileRecurse(java.io.File self, Closure closure)


eachLine

@java.lang.Deprecated}
public static java.lang.Object eachLine(java.lang.CharSequence self, Closure closure)


eachLine

@java.lang.Deprecated}
public static java.lang.Object eachLine(java.lang.CharSequence self, int firstLine, Closure closure)


eachLine

@java.lang.Deprecated}
public static java.lang.Object eachLine(java.lang.String self, Closure closure)


eachLine

@java.lang.Deprecated}
public static java.lang.Object eachLine(java.lang.String self, int firstLine, Closure closure)


eachLine

@java.lang.Deprecated}
public static java.lang.Object eachLine(java.io.File self, Closure closure)


eachLine

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


eachLine

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


eachLine

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


eachLine

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


eachLine

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


eachLine

@java.lang.Deprecated}
public static java.lang.Object eachLine(java.io.InputStream stream, Closure closure)


eachLine

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


eachLine

@java.lang.Deprecated}
public static java.lang.Object eachLine(java.net.URL url, Closure closure)


eachLine

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


eachLine

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


eachLine

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


eachLine

@java.lang.Deprecated}
public static java.lang.Object eachLine(java.io.Reader self, Closure closure)


eachLine

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


eachMatch

@java.lang.Deprecated}
public static java.lang.String eachMatch(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


eachMatch

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


eachMatch

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


eachMatch

@java.lang.Deprecated}
public static java.lang.String eachMatch(java.lang.String self, java.lang.String regex, Closure closure)


eachObject

@java.lang.Deprecated}
public static void eachObject(java.io.File self, Closure closure)


eachObject

@java.lang.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

@java.lang.Deprecatedreturn IOGroovyMethods.newObjectInputStream(inputStream);
public static java.lang.Process execute(java.lang.String self)


execute

@java.lang.Deprecatedreturn IOGroovyMethods.newObjectInputStream(inputStream, classLoader);
public static java.lang.Process execute(java.lang.String self, java.lang.String[] envp, java.io.File dir)


execute

@java.lang.Deprecatedreturn ResourceGroovyMethods.newObjectInputStream(file, classLoader);
public static java.lang.Process execute(java.lang.String self, java.util.List envp, java.io.File dir)


execute

@java.lang.DeprecatedResourceGroovyMethods.eachObject(self, closure);
public static java.lang.Process execute(java.lang.String[] commandArray)


execute

@java.lang.DeprecatedIOGroovyMethods.eachObject(ois, closure);
public static java.lang.Process execute(java.lang.String[] commandArray, java.lang.String[] envp, java.io.File dir)


execute

@java.lang.Deprecatedreturn ResourceGroovyMethods.withObjectInputStream(file, closure);
public static java.lang.Process execute(java.lang.String[] commandArray, java.util.List envp, java.io.File dir)


execute

@java.lang.Deprecatedreturn ResourceGroovyMethods.withObjectInputStream(file, classLoader, closure);
public static java.lang.Process execute(java.util.List commands)


execute

@java.lang.Deprecatedreturn IOGroovyMethods.withObjectInputStream(inputStream, closure);
public static java.lang.Process execute(java.util.List commands, java.lang.String[] envp, java.io.File dir)


execute

@java.lang.Deprecatedreturn IOGroovyMethods.withObjectInputStream(inputStream, classLoader, closure);
public static java.lang.Process execute(java.util.List commands, java.util.List envp, java.io.File dir)


expand

@java.lang.Deprecated}
public static java.lang.CharSequence expand(java.lang.CharSequence self)


expand

@java.lang.Deprecated}
public static java.lang.CharSequence expand(java.lang.CharSequence self, int tabStop)


expand

@java.lang.Deprecated}
public static java.lang.String expand(java.lang.String self)


expand

@java.lang.Deprecated}
public static java.lang.String expand(java.lang.String self, int tabStop)


expandLine

@java.lang.Deprecated}
public static java.lang.CharSequence expandLine(java.lang.CharSequence self, int tabStop)


expandLine

@java.lang.Deprecated}
public static java.lang.String expandLine(java.lang.String self, int tabStop)


filterLine

@java.lang.Deprecated
public static void filterLine(java.io.Reader reader, java.io.Writer writer, Closure closure)


filterLine

@java.lang.Deprecated
public static Writable filterLine(java.io.File self, Closure closure)


filterLine

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


filterLine

@java.lang.Deprecated
public static void filterLine(java.io.File self, java.io.Writer writer, Closure closure)


filterLine

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


filterLine

@java.lang.Deprecated
public static Writable filterLine(java.io.Reader reader, Closure closure)


filterLine

@java.lang.Deprecated
public static Writable filterLine(java.io.InputStream self, Closure predicate)


filterLine

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


filterLine

@java.lang.Deprecated
public static void filterLine(java.io.InputStream self, java.io.Writer writer, Closure predicate)


filterLine

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


filterLine

@java.lang.Deprecated
public static Writable filterLine(java.net.URL self, Closure predicate)


filterLine

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


filterLine

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


filterLine

@java.lang.Deprecated
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

@java.lang.Deprecated}
public static java.lang.CharSequence find(java.lang.CharSequence self, java.lang.CharSequence regex)


find

@java.lang.Deprecated}
public static java.lang.CharSequence find(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


find

@java.lang.Deprecated}
public static java.lang.CharSequence find(java.lang.CharSequence self, java.util.regex.Pattern pattern)


find

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


find

@java.lang.Deprecated}
public static java.lang.String find(java.lang.String self, java.util.regex.Pattern pattern)


find

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


find

@java.lang.Deprecated}
public static java.lang.String find(java.lang.String self, java.lang.String regex)


find

@java.lang.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)
deprecated:
Use the Iterable version of groupBy instead
See Also:
groupBy(Iterable, Closure)
Since:
1.0


findAll

@java.lang.Deprecated}
public static java.util.List findAll(java.lang.CharSequence self, java.lang.CharSequence regex)


findAll

@java.lang.Deprecated}
public static java.util.List findAll(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


findAll

@java.lang.Deprecated}
public static java.util.List findAll(java.lang.CharSequence self, java.util.regex.Pattern pattern)


findAll

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


findAll

@java.lang.Deprecated}
public static java.util.List findAll(java.lang.String self, java.util.regex.Pattern pattern)


findAll

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


findAll

@java.lang.Deprecated}
public static java.util.List findAll(java.lang.String self, java.lang.String regex)


findAll

@java.lang.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)
deprecated:
Use the Iterable version of findResults instead
See Also:
findResults(Iterable, Closure)
Since:
1.8.1


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

@java.lang.Deprecated* @return the list of non-null transformed values
public static java.util.Collection findResults(java.util.Collection self, Closure filteringTransform)


findResults

public static java.util.Collection findResults(java.lang.Iterable 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)


first

public static java.lang.Object first(java.lang.Object[] self)
Returns the first item from the Object array.
def array = [3, 4, 2].toArray()
 assert array.head() == 3
throws:
NoSuchElementException if the array is empty and you try to access the head() item.
Parameters:
self - an Object array
Returns:
the first item from the Object array
Since:
1.7.3


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 boolean Array to flatten
Returns:
a flattened Collection
Since:
1.6.0


flatten

public static java.util.Collection flatten(java.lang.Iterable self)


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

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


flatten

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


flatten

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


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)
Select a List of items from an eager or lazy List using a Collection to identify the indices to be selected.
def list = [].withDefault { 42 }
 assert list[1,0,2] == [42, 42, 42]
Parameters:
self - a ListWithDefault
indices - a Collection of indices
Returns:
a new eager or lazy list of the values at the given indices


getAt

public static java.util.List getAt(ListWithDefault self, java.util.Collection indices)
Support the range subscript operator for an eager or lazy List.
def list = [].withDefault { 42 }
 assert list[1..2] == [null, 42]
Parameters:
self - a ListWithDefault
range - a Range indicating the items to get
Returns:
a new eager or lazy sublist based on range borders
See Also:
java.util.List#subList(int,int)


getAt

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


getAt

public static java.util.List getAt(ListWithDefault self, EmptyRange 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)


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)
Allows conversion of arrays into a mutable List.
Parameters:
array - an Array of Objects
Returns:
the array as a List
Since:
1.0


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.lang.Iterable self, int idx)
A helper method to allow lists to work with subscript operators.
def list = [2, 3]
 list[0] = 1
 assert list == [1, 3]
Parameters:
self - a List
idx - an index
value - the value to put at the given index
Since:
1.0


getAt

public static java.lang.Object getAt(java.util.Map self, java.lang.Object key)
Returns a new Map containing all entries from left and right, giving precedence to right. Any keys appearing in both Maps will appear in the resultant map with values from the right operand. If the left map is one of TreeMap, LinkedHashMap, Hashtable or Properties, the returned Map will preserve that type, otherwise a HashMap will be returned.

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

 assert [a:10, b:20] + [a:5, c:7] == [a:5, b:20, c:7]
 
Parameters:
left - a Map
right - a Map
Returns:
a new Map containing all entries from left and right
Since:
1.5.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

@java.lang.SuppressWarnings* @param range a range indicating the indices for the items to retrieve
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

@java.lang.SuppressWarnings* @param range a range indicating the indices for the items to retrieve
public static java.util.List getAt(char[] array, Range range)


getAt

@java.lang.SuppressWarnings* @param range a range indicating the indices for the items to retrieve
public static java.util.List getAt(short[] array, Range range)


getAt

@java.lang.SuppressWarnings* @param range a range indicating the indices for the items to retrieve
public static java.util.List getAt(int[] array, Range range)


getAt

@java.lang.SuppressWarnings* @param range an IntRange indicating the indices for the items to retrieve
public static java.util.List getAt(long[] array, Range range)


getAt

@java.lang.SuppressWarnings* @param range an IntRange indicating the indices for the items to retrieve
public static java.util.List getAt(float[] array, Range range)


getAt

@java.lang.SuppressWarnings* @param range an IntRange indicating the indices for the items to retrieve
public static java.util.List getAt(double[] array, Range range)


getAt

@java.lang.SuppressWarnings* @param range an IntRange indicating the indices for the items to retrieve
public static java.util.List getAt(boolean[] array, Range range)


getAt

@java.lang.SuppressWarnings* @param range an IntRange indicating the indices for the items to retrieve
public static java.util.List getAt(byte[] array, IntRange range)


getAt

@java.lang.SuppressWarnings* @param range an IntRange indicating the indices for the items to retrieve
public static java.util.List getAt(char[] array, IntRange range)


getAt

@java.lang.SuppressWarnings* @param range an IntRange indicating the indices for the items to retrieve
public static java.util.List getAt(short[] array, IntRange range)


getAt

@java.lang.SuppressWarnings* @param range an IntRange indicating the indices for the items to retrieve
public static java.util.List getAt(int[] array, IntRange range)


getAt

@java.lang.SuppressWarnings* @param range an ObjectRange indicating the indices for the items to retrieve
public static java.util.List getAt(long[] array, IntRange range)


getAt

@java.lang.SuppressWarnings* @param range an ObjectRange indicating the indices for the items to retrieve
public static java.util.List getAt(float[] array, IntRange range)


getAt

@java.lang.SuppressWarnings* @param range an ObjectRange indicating the indices for the items to retrieve
public static java.util.List getAt(double[] array, IntRange range)


getAt

@java.lang.SuppressWarnings* @param range an ObjectRange indicating the indices for the items to retrieve
public static java.util.List getAt(boolean[] array, IntRange range)


getAt

@java.lang.SuppressWarnings* @param range an ObjectRange indicating the indices for the items to retrieve
public static java.util.List getAt(byte[] array, ObjectRange range)


getAt

@java.lang.SuppressWarnings* @param range an ObjectRange indicating the indices for the items to retrieve
public static java.util.List getAt(char[] array, ObjectRange range)


getAt

@java.lang.SuppressWarnings* @param range an ObjectRange indicating the indices for the items to retrieve
public static java.util.List getAt(short[] array, ObjectRange range)


getAt

@java.lang.SuppressWarnings* @param range an ObjectRange indicating the indices for the items to retrieve
public static java.util.List getAt(int[] array, ObjectRange range)


getAt

@java.lang.SuppressWarnings* @param indices a collection of indices for the items to retrieve
public static java.util.List getAt(long[] array, ObjectRange range)


getAt

@java.lang.SuppressWarnings* @param indices a collection of indices for the items to retrieve
public static java.util.List getAt(float[] array, ObjectRange range)


getAt

@java.lang.SuppressWarnings* @param indices a collection of indices for the items to retrieve
public static java.util.List getAt(double[] array, ObjectRange range)


getAt

@java.lang.SuppressWarnings* @param indices a collection of indices for the items to retrieve
public static java.util.List getAt(boolean[] array, ObjectRange range)


getAt

@java.lang.SuppressWarnings* @param indices a collection of indices for the items to retrieve
public static java.util.List getAt(byte[] array, java.util.Collection indices)


getAt

@java.lang.SuppressWarnings* @param indices a collection of indices for the items to retrieve
public static java.util.List getAt(char[] array, java.util.Collection indices)


getAt

@java.lang.SuppressWarnings* @param indices a collection of indices for the items to retrieve
public static java.util.List getAt(short[] array, java.util.Collection indices)


getAt

@java.lang.SuppressWarnings* @param indices a collection of indices for the items to retrieve
public static java.util.List getAt(int[] array, java.util.Collection indices)


getAt

@java.lang.SuppressWarnings* @param index index to retrieve
public static java.util.List getAt(long[] array, java.util.Collection indices)


getAt

@java.lang.SuppressWarnings* @param range a Range defining the desired subset
public static java.util.List getAt(float[] array, java.util.Collection indices)


getAt

@java.lang.SuppressWarningsint adjuster = 1;
public static java.util.List getAt(double[] array, java.util.Collection indices)


getAt

@java.lang.SuppressWarnings}
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

@java.lang.Deprecated}
public static java.lang.CharSequence getAt(java.lang.CharSequence self, java.util.Collection indices)


getAt

@java.lang.Deprecated}
public static java.lang.CharSequence getAt(java.lang.CharSequence text, EmptyRange range)


getAt

@java.lang.Deprecated}
public static java.lang.CharSequence getAt(java.lang.CharSequence text, int index)


getAt

@java.lang.Deprecated}
public static java.lang.CharSequence getAt(java.lang.CharSequence text, IntRange range)


getAt

@java.lang.Deprecated}
public static java.lang.CharSequence getAt(java.lang.CharSequence text, Range range)


getAt

@java.lang.Deprecated}
public static java.util.List getAt(java.util.regex.Matcher self, java.util.Collection indices)


getAt

@java.lang.Deprecated}
public static java.lang.Object getAt(java.util.regex.Matcher matcher, int idx)


getAt

@java.lang.Deprecated}
public static java.lang.String getAt(java.lang.String self, java.util.Collection indices)


getAt

@java.lang.Deprecated}
public static java.lang.String getAt(java.lang.String text, EmptyRange range)


getAt

@java.lang.Deprecated}
public static java.lang.String getAt(java.lang.String text, int index)


getAt

@java.lang.Deprecated}
public static java.lang.String getAt(java.lang.String text, IntRange range)


getAt

@java.lang.Deprecated}
public static java.lang.String getAt(java.lang.String text, Range range)


getBytes

@java.lang.Deprecated}
public static byte[] getBytes(java.io.File file)


getBytes

@java.lang.DeprecatedResourceGroovyMethods.eachFileMatch(self, nameFilter, closure);
public static byte[] getBytes(java.net.URL url)


getBytes

@java.lang.DeprecatedResourceGroovyMethods.eachDirMatch(self, nameFilter, closure);
public static byte[] getBytes(java.io.InputStream is)


getChars

@java.lang.Deprecated}
public static char[] getChars(java.lang.CharSequence self)


getChars

@java.lang.Deprecated}
public static char[] getChars(java.lang.String self)


getCount

@java.lang.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)


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

@java.lang.DeprecatedResourceGroovyMethods.eachFile(self, fileType, closure);
public static java.lang.String getText(java.io.File file, java.lang.String charset)


getText

@java.lang.DeprecatedResourceGroovyMethods.eachFile(self, closure);
public static java.lang.String getText(java.io.File file)


getText

@java.lang.DeprecatedResourceGroovyMethods.eachDir(self, closure);
public static java.lang.String getText(java.net.URL url)


getText

@java.lang.Deprecatedthrows FileNotFoundException, IllegalArgumentException {
public static java.lang.String getText(java.net.URL url, java.util.Map parameters)


getText

@java.lang.Deprecatedpublic static void traverse(final File self, final Map options, final Closure closure)
public static java.lang.String getText(java.net.URL url, java.lang.String charset)


getText

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


getText

@java.lang.Deprecated
public static java.lang.String getText(java.io.InputStream is)


getText

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


getText

@java.lang.Deprecated
public static java.lang.String getText(java.io.Reader reader)


getText

@java.lang.Deprecated
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

@java.lang.SuppressWarnings* assert items.grep() == [1, 2, true, 'foo', [4, 5]]
public static java.util.Collection grep(java.util.Collection self)


grep

@java.lang.SuppressWarnings* @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

@java.lang.Deprecated* @return a new Map grouped by keys
public static java.util.Map groupBy(java.util.Collection self, Closure closure)


groupBy

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


groupBy

public static java.util.Map groupBy(java.lang.Object[] self, Closure closure)
deprecated:
Use the Iterable version of groupBy instead
See Also:
groupBy(Iterable, Object...)
Since:
1.8.1


groupBy

@java.lang.Deprecated* def data = sql.rows("SELECT * FROM a_table").groupBy({ it.column1 }, { it.column2 }, { it.column3 })
public static java.util.Map groupBy(java.util.Collection self, java.lang.Object... closures)


groupBy

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


groupBy

public static java.util.Map groupBy(java.lang.Object[] self, java.lang.Object... closures)
Sorts all array members into (sub)groups determined by the supplied mapping closures as per the Iterable variant of this method.
Parameters:
self - an array to group
closures - an array of closures, each mapping entries on keys
Returns:
a new Map grouped by keys on each criterion
See Also:
groupBy(Iterable, Object...)
Closure.IDENTITY
Since:
2.2.0


groupBy

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


groupBy

public static java.util.Map groupBy(java.lang.Iterable self, java.util.List closures)
Sorts all array members into (sub)groups determined by the supplied mapping closures as per the list variant of this method.
Parameters:
self - an array 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
groupBy(Iterable, List)
Since:
2.2.0


groupBy

public static java.util.Map groupBy(java.lang.Object[] self, java.util.List closures)


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

@java.lang.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)
Iterates over the elements of an iterable collection of items, starting from a specified startIndex, and returns the index of the last item that matches the condition specified in the closure.
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 last matched object or -1 if no match was found
Since:
1.5.2


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)
deprecated:
Use the Iterable version of sum instead
See Also:
sum(Iterable)
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)


intdiv

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


intdiv

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


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

@java.lang.Deprecated}
public static boolean isAllWhitespace(java.lang.CharSequence self)


isAllWhitespace

@java.lang.Deprecated}
public static boolean isAllWhitespace(java.lang.String self)


isBigDecimal

@java.lang.Deprecated}
public static boolean isBigDecimal(java.lang.CharSequence self)


isBigDecimal

@java.lang.Deprecated}
public static boolean isBigDecimal(java.lang.String self)


isBigInteger

@java.lang.Deprecated}
public static boolean isBigInteger(java.lang.CharSequence self)


isBigInteger

@java.lang.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

@java.lang.Deprecated}
public static boolean isCase(java.lang.CharSequence caseValue, java.lang.Object switchValue)


isCase

@java.lang.Deprecated}
public static boolean isCase(GString caseValue, java.lang.Object switchValue)


isCase

@java.lang.Deprecated}
public static boolean isCase(java.util.regex.Pattern caseValue, java.lang.Object switchValue)


isCase

@java.lang.Deprecated}
public static boolean isCase(java.lang.String caseValue, java.lang.Object switchValue)


isDigit

public static boolean isDigit(java.lang.Character self)


isDouble

@java.lang.Deprecated}
public static boolean isDouble(java.lang.CharSequence self)


isDouble

@java.lang.Deprecated}
public static boolean isDouble(java.lang.String self)


isFloat

@java.lang.Deprecated}
public static boolean isFloat(java.lang.CharSequence self)


isFloat

@java.lang.Deprecated}
public static boolean isFloat(java.lang.String self)


isInteger

@java.lang.Deprecated}
public static boolean isInteger(java.lang.CharSequence self)


isInteger

@java.lang.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

@java.lang.Deprecated}
public static boolean isLong(java.lang.CharSequence self)


isLong

@java.lang.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

@java.lang.Deprecated}
public static boolean isNumber(java.lang.CharSequence self)


isNumber

@java.lang.Deprecated}
public static boolean isNumber(java.lang.String self)


isUpperCase

public static boolean isUpperCase(java.lang.Character self)
Transform a Number into a Long
Parameters:
self - a Number
Returns:
an Long
Since:
1.0


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

@java.lang.Deprecated}
public static java.util.Iterator iterator(java.util.regex.Matcher matcher)


iterator

@java.lang.Deprecatedreturn ResourceGroovyMethods.newPrintWriter(file);
public static java.util.Iterator iterator(java.io.Reader self)


iterator

@java.lang.Deprecatedreturn ResourceGroovyMethods.newPrintWriter(file, charset);
public static java.util.Iterator iterator(java.io.InputStream self)


iterator

@java.lang.Deprecatedreturn IOGroovyMethods.newPrintWriter(writer);
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)
deprecated:
Use the Iterable version of join instead
See Also:
join(Iterable, String)
Since:
1.0


join

@java.lang.Deprecated} else {
public static java.lang.String join(java.util.Collection self, java.lang.String separator)


join

public static java.lang.String join(java.lang.Iterable 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)


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

@java.lang.Deprecated}
public static java.lang.StringBuilder leftShift(java.lang.CharSequence self, java.lang.Object value)


leftShift

@java.lang.Deprecated}
public static java.lang.StringBuffer leftShift(java.lang.String self, java.lang.Object value)


leftShift

@java.lang.Deprecated}
public static java.lang.StringBuffer leftShift(java.lang.StringBuffer self, java.lang.Object value)


leftShift

@java.lang.Deprecated}
public static java.lang.StringBuilder leftShift(java.lang.StringBuilder self, java.lang.Object value)


leftShift

@java.lang.Deprecatedreturn ResourceGroovyMethods.eachLine(self, firstLine, closure);
public static java.io.Writer leftShift(java.net.Socket self, java.lang.Object value)


leftShift

@java.lang.Deprecatedreturn ResourceGroovyMethods.eachLine(self, charset, firstLine, closure);
public static java.io.OutputStream leftShift(java.net.Socket self, byte[] value)


leftShift

@java.lang.Deprecated}
public static java.io.Writer leftShift(java.io.Writer self, java.lang.Object value)


leftShift

@java.lang.Deprecated}
public static java.io.Writer leftShift(java.io.OutputStream self, java.lang.Object value)


leftShift

@java.lang.Deprecated}
public static void leftShift(java.io.ObjectOutputStream self, java.lang.Object value)


leftShift

@java.lang.Deprecated}
public static java.io.OutputStream leftShift(java.io.OutputStream self, java.io.InputStream in)


leftShift

@java.lang.Deprecated}
public static java.io.OutputStream leftShift(java.io.OutputStream self, byte[] value)


leftShift

@java.lang.Deprecatedreturn ResourceGroovyMethods.asType(f, c);
public static java.io.File leftShift(java.io.File file, java.lang.Object text)


leftShift

@java.lang.Deprecatedreturn ResourceGroovyMethods.asWritable(file, encoding);
public static java.io.File leftShift(java.io.File file, byte[] bytes)


leftShift

@java.lang.Deprecatedreturn ResourceGroovyMethods.newReader(file);
public static java.io.File leftShift(java.io.File file, java.io.InputStream data)


matches

@java.lang.Deprecated}
public static boolean matches(java.lang.CharSequence self, java.util.regex.Pattern pattern)


matches

@java.lang.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

@java.lang.Deprecated* @param self an Iterator
public static java.lang.Object max(java.util.Collection self)


max

public static java.lang.Object max(java.lang.Iterable self)


max

public static java.lang.Object max(java.util.Iterator self)
deprecated:
Use the Iterable version of max instead
See Also:
max(Iterable, Closure)
Since:
1.0


max

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


max

@java.lang.Deprecated* assert longestName.size() == 8
public static java.lang.Object max(java.util.Collection self, Closure closure)


max

public static java.lang.Object max(java.lang.Iterable 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)
deprecated:
Use the Iterable version of max instead
See Also:
max(Iterable, Comparator)
Since:
1.0


max

@java.lang.Deprecated}
public static java.lang.Object max(java.util.Collection self, java.util.Comparator comparator)


max

public static java.lang.Object max(java.lang.Iterable self, java.util.Comparator comparator)
Selects the maximum value found from the Iterator using the given comparator.
Parameters:
self - an Iterator
comparator - a Comparator
Returns:
the maximum value
Since:
1.5.5


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 Collection objects.
assert 2 == [4,2,5].min()
Parameters:
self - a Collection
Returns:
the minimum value
See Also:
GroovyCollections.min
Since:
1.0


min

public static java.lang.Object min(java.lang.Iterable self)


min

public static java.lang.Object min(java.util.Iterator self)
deprecated:
Use the Iterable version of min instead
See Also:
min(Iterable, Comparator)
Since:
1.0


min

public static java.lang.Object min(java.lang.Object[] self)
Selects the minimum value found in the Iterable using the given comparator.
assert "hi" == ["hello","hi","hey"].min( { a, b -> a.length() <=> b.length() } as Comparator )
Parameters:
self - an Iterable
comparator - a Comparator
Returns:
the minimum value
Since:
2.2.0


min

@java.lang.Deprecated/**
public static java.lang.Object min(java.util.Collection self, java.util.Comparator comparator)


min

public static java.lang.Object min(java.lang.Iterable self, java.util.Comparator comparator)
Selects the minimum value found from the Iterator using the given comparator.
Parameters:
self - an Iterator
comparator - a Comparator
Returns:
the minimum value
See Also:
min(java.util.Collection, java.util.Comparator)
Since:
1.5.5


min

public static java.lang.Object min(java.util.Iterator self, java.util.Comparator comparator)
deprecated:
Use the Iterable version of min instead
See Also:
min(Iterable, Closure)
Since:
1.0


min

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


min

@java.lang.Deprecated* assert [19, 55, 91].min(lastDigit) == 91
public static java.lang.Object min(java.util.Collection self, Closure closure)


min

public static java.lang.Object min(java.lang.Iterable 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)
deprecated:
Use the Iterable version of max instead
See Also:
max(Iterable)
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)


minus

@java.lang.SuppressWarnings// element it encounters.
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

@java.lang.SuppressWarningsif (numberComparator.compare(t, (T)t2) == 0)
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

@java.lang.SuppressWarnings* 
assert [1,2,3,4,5] == [1,[2,3],[[4]],[],5].flatten()
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)


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)


minus

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


minus

@java.lang.Deprecated}
public static java.lang.CharSequence minus(java.lang.CharSequence self, java.lang.Object target)


minus

@java.lang.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)


multiply

public static java.lang.Number multiply(java.math.BigDecimal left, java.lang.Double right)
Power of a long 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 - a Long
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.math.BigInteger right)


multiply

@java.lang.Deprecated}
public static java.lang.CharSequence multiply(java.lang.CharSequence self, java.lang.Number factor)


multiply

@java.lang.Deprecated}
public static java.lang.String multiply(java.lang.String self, java.lang.Number factor)


newDataInputStream

@java.lang.Deprecated
public static java.io.DataInputStream newDataInputStream(java.io.File file)


newDataOutputStream

@java.lang.Deprecated}
public static java.io.DataOutputStream newDataOutputStream(java.io.File file)


newInputStream

@java.lang.Deprecated}
public static java.io.BufferedInputStream newInputStream(java.io.File file)


newInputStream

@java.lang.Deprecated}
public static java.io.BufferedInputStream newInputStream(java.net.URL url)


newInputStream

@java.lang.Deprecated}
public static java.io.BufferedInputStream newInputStream(java.net.URL url, java.util.Map parameters)


newInstance

@java.lang.SuppressWarnings* Sets/updates the metaclass for a given class to a closure.
public static java.lang.Object newInstance(java.lang.Class c)
Set the metaclass for an object.
Parameters:
self - the object whose metaclass we want to set
metaClass - the new metaclass value
Since:
1.6.0


newInstance

@java.lang.SuppressWarningselse {
public static java.lang.Object newInstance(java.lang.Class c, java.lang.Object[] args)


newObjectInputStream

@java.lang.Deprecated}
public static java.io.ObjectInputStream newObjectInputStream(java.io.File file)


newObjectInputStream

@java.lang.Deprecated}
public static java.io.ObjectInputStream newObjectInputStream(java.io.InputStream inputStream)


newObjectInputStream

@java.lang.Deprecated}
public static java.io.ObjectInputStream newObjectInputStream(java.io.InputStream inputStream, java.lang.ClassLoader classLoader)


newObjectInputStream

@java.lang.Deprecated}
public static java.io.ObjectInputStream newObjectInputStream(java.io.File file, java.lang.ClassLoader classLoader)


newObjectOutputStream

@java.lang.Deprecated}
public static java.io.ObjectOutputStream newObjectOutputStream(java.io.File file)


newObjectOutputStream

@java.lang.Deprecated}
public static java.io.ObjectOutputStream newObjectOutputStream(java.io.OutputStream outputStream)


newOutputStream

@java.lang.Deprecated}
public static java.io.BufferedOutputStream newOutputStream(java.io.File file)


newPrintWriter

@java.lang.Deprecated}
public static java.io.PrintWriter newPrintWriter(java.io.File file)


newPrintWriter

@java.lang.Deprecated}
public static java.io.PrintWriter newPrintWriter(java.io.File file, java.lang.String charset)


newPrintWriter

@java.lang.Deprecated}
public static java.io.PrintWriter newPrintWriter(java.io.Writer writer)


newReader

@java.lang.Deprecatedreturn IOGroovyMethods.withWriter(writer, closure);
public static java.io.BufferedReader newReader(java.io.File file)


newReader

@java.lang.Deprecatedreturn IOGroovyMethods.withReader(reader, closure);
public static java.io.BufferedReader newReader(java.io.File file, java.lang.String charset)


newReader

@java.lang.Deprecated}
public static java.io.BufferedReader newReader(java.io.InputStream self)


newReader

@java.lang.Deprecated}
public static java.io.BufferedReader newReader(java.io.InputStream self, java.lang.String charset)


newReader

@java.lang.Deprecated}
public static java.io.BufferedReader newReader(java.net.URL url)


newReader

@java.lang.Deprecated
public static java.io.BufferedReader newReader(java.net.URL url, java.util.Map parameters)


newReader

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


newReader

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


newWriter

@java.lang.Deprecated}
public static java.io.BufferedWriter newWriter(java.io.File file)


newWriter

@java.lang.Deprecated}
public static java.io.BufferedWriter newWriter(java.io.File file, boolean append)


newWriter

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


newWriter

@java.lang.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)
Compare two Characters. The ordinal values of the Characters are compared (the ordinal value is the unicode value which for simple character sets is the ASCII value).
Parameters:
left - a Character
right - a Character
Returns:
the result of the comparison
Since:
1.0


next

@java.lang.Deprecated}
public static java.lang.CharSequence next(java.lang.CharSequence self)


next

@java.lang.Deprecated}
public static java.lang.String next(java.lang.String self)


normalize

@java.lang.Deprecated}
public static java.lang.CharSequence normalize(java.lang.CharSequence self)


normalize

@java.lang.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)
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


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

@java.lang.Deprecated}
public static java.lang.CharSequence padLeft(java.lang.CharSequence self, java.lang.Number numberOfChars)


padLeft

@java.lang.Deprecated}
public static java.lang.CharSequence padLeft(java.lang.CharSequence self, java.lang.Number numberOfChars, java.lang.CharSequence padding)


padLeft

@java.lang.Deprecated}
public static java.lang.String padLeft(java.lang.String self, java.lang.Number numberOfChars)


padLeft

@java.lang.Deprecated}
public static java.lang.String padLeft(java.lang.String self, java.lang.Number numberOfChars, java.lang.String padding)


padRight

@java.lang.Deprecated}
public static java.lang.CharSequence padRight(java.lang.CharSequence self, java.lang.Number numberOfChars)


padRight

@java.lang.Deprecated}
public static java.lang.CharSequence padRight(java.lang.CharSequence self, java.lang.Number numberOfChars, java.lang.CharSequence padding)


padRight

@java.lang.Deprecated}
public static java.lang.String padRight(java.lang.String self, java.lang.Number numberOfChars)


padRight

@java.lang.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)


permutations

public static java.util.List permutations(java.util.List self, Closure function)
Iterates over all permutations of a collection, running a closure for each iteration.

Example usage:

def permutations = []
 [1, 2, 3].eachPermutation{ permutations << it }
 assert permutations == [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
Parameters:
self - the Collection of items
closure - the closure to call for each permutation
Returns:
the permutations from the list
Since:
1.7.0


plus

public static java.util.Map plus(java.util.Map left, java.util.Map right)
Support the subscript operator for Collection.
 assert [String, Long, Integer] == ["a",5L,2]["class"]
 
Parameters:
coll - a Collection
property - a String
Returns:
a List
Since:
1.0


plus

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


plus

@java.lang.SuppressWarnings*/
public static java.lang.Object[] plus(java.lang.Object[] left, java.lang.Object[] right)


plus

@java.lang.SuppressWarnings* @param left  the array
public static java.lang.Object[] plus(java.lang.Object[] left, java.lang.Object right)


plus

@java.lang.SuppressWarnings* @param right the right Collection
public static java.lang.Object[] plus(java.lang.Object[] left, java.util.Collection right)


plus

@java.lang.SuppressWarningspublic static  Collection plus(Collection left, Iterable right) {
public static java.lang.Object[] plus(java.lang.Object[] left, java.lang.Iterable right)
Create a Collection as a union of a Collection and an Iterable. If the left collection is a Set, then the returned collection will be a Set otherwise a List. This operation will always create a new object for the result, while the operands remain unchanged.
Parameters:
left - the left Collection
right - the right Iterable
Returns:
the merged Collection
See Also:
plus(Collection, Collection)
Since:
1.8.7


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)
Create a List composed of the elements of this list, repeated a certain number of times. Note that for non-primitive elements, multiple references to the same instance will be added.
assert [1,2,3,1,2,3] == [1,2,3] * 2
Parameters:
self - a Collection
factor - the number of times to append
Returns:
the multiplied list
Since:
1.0


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)
Multiply a Character by a Number. The ordinal value of the Character is used in the multiplication (the ordinal value is the unicode value which for simple character sets is the ASCII value).
Parameters:
left - a Character
right - a Number
Returns:
the Number corresponding to the multiplication of left by right
Since:
1.0


plus

@java.lang.Deprecated}
public static java.lang.CharSequence plus(java.lang.CharSequence left, java.lang.Object value)


plus

@java.lang.Deprecated}
public static java.lang.String plus(java.lang.Number value, java.lang.String right)


plus

@java.lang.Deprecated}
public static java.lang.String plus(java.lang.String left, java.lang.Object value)


plus

@java.lang.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)


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

@java.lang.Deprecated}
public static java.lang.CharSequence previous(java.lang.CharSequence self)


previous

@java.lang.Deprecated}
public static java.lang.String previous(java.lang.String self)


primitiveArrayGet

protected static java.lang.Object primitiveArrayGet(java.lang.Object self, int idx)
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


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)


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)
A helper method to allow lists to work with subscript operators.
def list = ["a", true, 42, 9.4]
 list[1, 3] = 5
 assert list == ["a", 5, 42, 5]
Parameters:
self - a List
splice - 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, 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

@java.lang.Deprecated}
public static void putAt(java.lang.StringBuffer self, EmptyRange range, java.lang.Object value)


putAt

@java.lang.Deprecated}
public static void putAt(java.lang.StringBuffer self, IntRange range, java.lang.Object value)


readBytes

@java.lang.Deprecated
public static byte[] readBytes(java.io.File file)


readLine

@java.lang.Deprecated}
public static java.lang.String readLine(java.io.Reader self)


readLines

@java.lang.Deprecated}
public static java.util.List readLines(java.lang.CharSequence self)


readLines

@java.lang.Deprecated}
public static java.util.List readLines(java.lang.String self)


readLines

@java.lang.Deprecated}
public static java.util.List readLines(java.io.File file)


readLines

@java.lang.Deprecated}
public static java.util.List readLines(java.io.File file, java.lang.String charset)


readLines

@java.lang.Deprecated}
public static java.util.List readLines(java.io.InputStream stream)


readLines

@java.lang.Deprecated}
public static java.util.List readLines(java.io.InputStream stream, java.lang.String charset)


readLines

@java.lang.Deprecated}
public static java.util.List readLines(java.net.URL self)


readLines

@java.lang.Deprecated}
public static java.util.List readLines(java.net.URL self, java.lang.String charset)


readLines

@java.lang.Deprecated}
public static java.util.List readLines(java.io.Reader reader)


removeAll

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


removeAll

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


renameTo

@java.lang.Deprecatedreturn ResourceGroovyMethods.withWriterAppend(file, closure);
public static boolean renameTo(java.io.File self, java.lang.String newPathName)


replaceAll

@java.lang.Deprecated}
public static java.lang.CharSequence replaceAll(java.lang.CharSequence self, java.lang.CharSequence regex, java.lang.CharSequence replacement)


replaceAll

@java.lang.Deprecated}
public static java.lang.CharSequence replaceAll(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


replaceAll

@java.lang.Deprecated}
public static java.lang.CharSequence replaceAll(java.lang.CharSequence self, java.util.regex.Pattern pattern, java.lang.CharSequence replacement)


replaceAll

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


replaceAll

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


replaceAll

@java.lang.Deprecated}
public static java.lang.String replaceAll(java.lang.String self, java.util.regex.Pattern pattern, java.lang.String replacement)


replaceAll

@java.lang.Deprecated}
public static java.lang.String replaceAll(java.lang.String self, java.lang.String regex, Closure closure)


replaceFirst

@java.lang.Deprecated}
public static java.lang.String replaceFirst(java.lang.CharSequence self, java.lang.CharSequence regex, java.lang.CharSequence replacement)


replaceFirst

@java.lang.Deprecated}
public static java.lang.String replaceFirst(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


replaceFirst

@java.lang.Deprecated}
public static java.lang.CharSequence replaceFirst(java.lang.CharSequence self, java.util.regex.Pattern pattern, java.lang.CharSequence replacement)


replaceFirst

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


replaceFirst

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


replaceFirst

@java.lang.Deprecated}
public static java.lang.String replaceFirst(java.lang.String self, java.util.regex.Pattern pattern, java.lang.String replacement)


replaceFirst

@java.lang.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)


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)


reverse

@java.lang.SuppressWarningsreturn new ReverseListIterator(toList(self));
public static java.lang.Object[] reverse(java.lang.Object[] self)
Reverses the iterator. The original iterator will become exhausted of elements after determining the reversed values. A new iterator for iterating through the reversed values is returned.
Parameters:
self - an Iterator
Returns:
a reversed Iterator
Since:
1.5.5


reverse

@java.lang.SuppressWarnings* @since 1.8.7
public static java.lang.Object[] reverse(java.lang.Object[] self, boolean mutate)


reverse

public static java.util.Iterator reverse(java.util.Iterator self)
Create an array containing elements from an original array plus an additional appended element.
 Integer[] a = [1, 2, 3]
 Integer[] result = a + 4
 assert result == [1, 2, 3, 4] as Integer[]
 
Parameters:
left - the array
right - the value to append
Returns:
A new array containing left with right appended to it.
Since:
1.8.7


reverse

@java.lang.Deprecated}
public static java.lang.CharSequence reverse(java.lang.CharSequence self)


reverse

@java.lang.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)


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

@java.lang.Deprecatedreturn ResourceGroovyMethods.deleteDir(self);
public static void setBytes(java.io.File file, byte[] bytes)


setBytes

@java.lang.Deprecatedreturn ResourceGroovyMethods.renameTo(self, newPathName);
public static void setBytes(java.io.OutputStream os, byte[] bytes)


setIndex

@java.lang.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)
Attempts to create an Iterator for the given object by first converting it to a Collection.
Parameters:
a - an array
Returns:
an Iterator for the given Array.
See Also:
DefaultTypeTransformation.asCollection
Since:
1.6.4


setText

@java.lang.Deprecatedreturn IOGroovyMethods.iterator(self);
public static void setText(java.io.File file, java.lang.String text)


setText

@java.lang.Deprecatedreturn ResourceGroovyMethods.asWritable(file);
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)


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)
Converts this array to a List of the same size, with each element added to the list.
Parameters:
array - a long array
Returns:
a list containing the contents of this array.
Since:
1.0


size

public static int size(long[] array)


size

public static int size(float[] array)


size

public static int size(double[] array)


size

@java.lang.Deprecated}
public static int size(java.lang.CharSequence text)


size

@java.lang.Deprecated}
public static long size(java.util.regex.Matcher self)


size

@java.lang.Deprecated}
public static int size(java.lang.String text)


size

@java.lang.Deprecated}
public static int size(java.lang.StringBuffer buffer)


size

@java.lang.Deprecated}
public static long size(java.io.File self)


sort

@java.lang.Deprecated/**
public static java.util.List sort(java.util.Collection self)


sort

public static java.util.List sort(java.lang.Iterable self)


sort

@java.lang.Deprecated* the closure as a comparator to determine the ordering.
public static java.util.List sort(java.util.Collection self, boolean mutate)


sort

public static java.util.List sort(java.lang.Iterable self, boolean mutate)


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)
Modifies this array so that its elements are in sorted order. The array items are assumed to be comparable.
Parameters:
self - the array to be sorted
Returns:
the sorted array
Since:
1.5.5


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 using the comparator. 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
comparator - a Comparator used for comparing items
Returns:
the sorted items as an Iterator
Since:
1.5.5


sort

public static java.util.Iterator sort(java.util.Iterator self)
deprecated:
Use the Iterable version of sort instead
See Also:
sort(Iterable, Comparator)
Since:
1.0


sort

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


sort

@java.lang.Deprecatedpublic static  List sort(Collection self, boolean mutate, Comparator comparator) {
public static java.util.List sort(java.util.Collection self, java.util.Comparator comparator)
deprecated:
Use the Iterable version of sort instead
See Also:
sort(Iterable, boolean, Comparator)
Since:
1.8.1


sort

public static java.util.List sort(java.lang.Iterable self, java.util.Comparator comparator)


sort

@java.lang.Deprecated* Sorts the given array into sorted order using the given comparator.
public static java.util.List sort(java.util.Collection self, boolean mutate, java.util.Comparator comparator)


sort

public static java.util.List sort(java.lang.Iterable self, boolean mutate, java.util.Comparator comparator)


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)


sort

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


sort

@java.lang.SuppressWarningsT[] answer = (T[]) sort(toList(self), closure).toArray();
public static java.lang.Object[] sort(java.lang.Object[] self, Closure closure)


sort

@java.lang.SuppressWarningsreturn sort((Iterable)self, closure);
public static java.lang.Object[] sort(java.lang.Object[] self, boolean mutate, Closure closure)
Sorts this Collection using the given Closure to determine the correct ordering. 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.

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.

assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { it.length() }
assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { a, b -> a.length() <=> b.length() }
Parameters:
self - a Collection to be sorted
closure - a 1 or 2 arg Closure used to determine the correct ordering
Returns:
a newly created sorted List
See Also:
sort(Collection, boolean, Closure)
Since:
1.0


sort

public static java.util.List sort(java.util.Collection self, Closure closure)
Sorts this Iterable using the given Closure to determine the correct ordering. If the Iterable 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 Iterable unchanged.

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.

assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { it.length() }
assert ["hi","hey","hello"] == ["hello","hi","hey"].sort { a, b -> a.length() <=> b.length() }
Parameters:
self - the Iterable to be sorted
closure - a 1 or 2 arg Closure used to determine the correct ordering
Returns:
a newly created sorted List
See Also:
sort(Collection, boolean, Closure)
Since:
2.2.0


sort

public static java.util.List sort(java.lang.Iterable self, Closure closure)


sort

@java.lang.Deprecated*/
public static java.util.List sort(java.util.Collection self, boolean mutate, Closure closure)


sort

public static java.util.List sort(java.lang.Iterable 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)
Provides an easy way to append multiple Map.Entry values to a Map.
Parameters:
self - a Map
entries - a Collection of Map.Entry items to be added to the Map.
Returns:
the same map, after the items have been added to it.
Since:
1.6.1


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

@java.lang.Deprecated}
public static java.lang.CharSequence[] split(java.lang.CharSequence self)


split

@java.lang.Deprecated}
public static java.lang.String[] split(GString self)


split

@java.lang.Deprecated}
public static java.lang.String[] split(java.lang.String self)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.lang.CharSequence self, java.lang.CharSequence regex, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.lang.CharSequence self, java.util.regex.Pattern pattern, Closure closure)


splitEachLine

@java.lang.Deprecatedreturn StringGroovyMethods.tokenize(self);
public static java.lang.Object splitEachLine(java.lang.String self, java.util.regex.Pattern pattern, Closure closure)


splitEachLine

@java.lang.Deprecatedreturn StringGroovyMethods.tokenize(self, token);
public static java.lang.Object splitEachLine(java.lang.String self, java.lang.String regex, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.io.File self, java.lang.String regex, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.io.File self, java.util.regex.Pattern pattern, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.io.File self, java.lang.String regex, java.lang.String charset, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.io.File self, java.util.regex.Pattern pattern, java.lang.String charset, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.net.URL self, java.lang.String regex, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.net.URL self, java.util.regex.Pattern pattern, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.net.URL self, java.lang.String regex, java.lang.String charset, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.net.URL self, java.util.regex.Pattern pattern, java.lang.String charset, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.io.Reader self, java.lang.String regex, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.io.Reader self, java.util.regex.Pattern pattern, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.io.InputStream stream, java.lang.String regex, java.lang.String charset, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.io.InputStream stream, java.util.regex.Pattern pattern, java.lang.String charset, Closure closure)


splitEachLine

@java.lang.Deprecated}
public static java.lang.Object splitEachLine(java.io.InputStream stream, java.lang.String regex, Closure closure)


splitEachLine

@java.lang.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

@java.lang.Deprecatedpublic static List tokenize(String self, String token) {
public static java.lang.CharSequence stripIndent(java.lang.CharSequence self)


stripIndent

@java.lang.Deprecatedpublic static List toList(CharSequence self) {
public static java.lang.CharSequence stripIndent(java.lang.CharSequence self, int numChars)


stripIndent

@java.lang.Deprecatedpublic static List toList(String self) {
public static java.lang.String stripIndent(java.lang.String self)


stripIndent

@java.lang.Deprecatedpublic static Long toLong(CharSequence self) {
public static java.lang.String stripIndent(java.lang.String self, int numChars)


stripMargin

@java.lang.Deprecatedpublic static Long toLong(String self) {
public static java.lang.CharSequence stripMargin(java.lang.CharSequence self)


stripMargin

@java.lang.Deprecatedpublic static Set toSet(CharSequence self) {
public static java.lang.CharSequence stripMargin(java.lang.CharSequence self, char marginChar)


stripMargin

@java.lang.Deprecatedpublic static Set toSet(String self) {
public static java.lang.String stripMargin(java.lang.CharSequence self, java.lang.CharSequence marginChar)


stripMargin

@java.lang.Deprecatedpublic static Short toShort(CharSequence self) {
public static java.lang.String stripMargin(java.lang.String self)


stripMargin

@java.lang.Deprecatedpublic static Short toShort(String self) {
public static java.lang.String stripMargin(java.lang.String self, char marginChar)


stripMargin

@java.lang.Deprecatedpublic static URI toURI(CharSequence self) throws URISyntaxException {
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)
Creates a sub-Map containing the given keys. This method is similar to List.subList() but uses keys rather than index ranges. The original map is unaltered.
 def orig = [1:10, 2:20, 3:30, 4:40]
 assert orig.subMap([1, 3] as int[]) == [1:10, 3:30]
 assert orig.subMap([2, 4] as Integer[]) == [2:20, 4:40]
 assert orig.size() == 4
 
Parameters:
map - a Map
keys - an array of keys
Returns:
a new Map containing the given keys
Since:
2.1.0


subMap

public static java.util.Map subMap(java.util.Map map, java.lang.Object[] 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

@java.lang.Deprecated* @see #sum(java.util.Collection)
public static java.lang.Object sum(java.util.Collection self)


sum

public static java.lang.Object sum(java.lang.Iterable self)


sum

public static java.lang.Object sum(java.lang.Object[] self)
deprecated:
Use the Iterable version of sum instead
See Also:
sum(Iterable, Object)
Since:
1.5.0


sum

public static java.lang.Object sum(java.util.Iterator self)


sum

@java.lang.Deprecated* @param initialValue the items in the array will be summed to this initial value
public static java.lang.Object sum(java.util.Collection self, java.lang.Object initialValue)


sum

public static java.lang.Object sum(java.lang.Iterable 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

@java.lang.Deprecated* array.collect(closure).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 Iterable. coll.sum(closure) is equivalent to: coll.collect(closure).sum().
assert 4+6+10+12 == [2,3,5,6].sum() { it * 2 }
Parameters:
self - an Iterable
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 Iterable.
Since:
2.2.0


sum

public static java.lang.Object sum(java.lang.Iterable self, Closure closure)


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

@java.lang.Deprecated* array.sum(initVal, closure) is equivalent to:
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.Iterable 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)


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)
Returns an iterator of up to the first num elements from this iterator. The original iterator is stepped along by num elements.
 def a = 0
 def iter = [ hasNext:{ true }, next:{ a++ } ] as Iterator
 def iteratorCompare( Iterator a, List b ) {
     a.collect { it } == b
 }
 assert iteratorCompare( iter.take( 0 ), [] )
 assert iteratorCompare( iter.take( 2 ), [ 0, 1 ] )
 assert iteratorCompare( iter.take( 5 ), [ 2, 3, 4, 5, 6 ] )
 
Parameters:
self - the Iterator
num - the number of elements to take from this iterator
Returns:
an iterator consisting of up to the first num elements of this iterator.
Since:
1.8.1


take

@java.lang.SuppressWarnings
public static java.util.Iterator take(java.util.Iterator self, int num)


take

@java.lang.DeprecatedList ret = createSimilarList(self, self.size() - num);
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)
Returns a List containing the longest prefix of the elements from this Iterable where each element passed to the given closure evaluates to true.
 class AbcIterable implements Iterable {
     Iterator iterator() { "abc".iterator() }
 }
 def abc = new AbcIterable()
 assert abc.takeWhile{ it < 'b' } == ['a']
 assert abc.takeWhile{ it <= 'b' } == ['a', 'b']
 
Parameters:
self - an Iterable
condition - the closure that must evaluate to true to continue taking elements
Returns:
a List containing a prefix of the elements from the given Iterable where each element passed to the given closure evaluates to true
Since:
1.8.7


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

@java.lang.Deprecatedpublic static URI toURI(String self) throws URISyntaxException {
public static java.math.BigDecimal toBigDecimal(java.lang.CharSequence self)


toBigDecimal

@java.lang.Deprecatedpublic static URL toURL(CharSequence self) throws MalformedURLException {
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

@java.lang.Deprecatedpublic static URL toURL(String self) throws MalformedURLException {
public static java.math.BigInteger toBigInteger(java.lang.CharSequence self)


toBigInteger

@java.lang.Deprecatedpublic static CharSequence tr(final CharSequence self, CharSequence sourceSet, CharSequence replacementSet) throws ClassNotFoundException {
public static java.math.BigInteger toBigInteger(java.lang.String self)


toBoolean

public static java.lang.Boolean toBoolean(java.lang.Boolean self)


toBoolean

@java.lang.Deprecatedpublic static String tr(final String self, String sourceSet, String replacementSet) throws ClassNotFoundException {
public static java.lang.Boolean toBoolean(java.lang.String self)


toCharacter

@java.lang.Deprecatedpublic static CharSequence unexpand(CharSequence self) {
public static java.lang.Character toCharacter(java.lang.String self)


toDouble

public static java.lang.Double toDouble(java.lang.Number self)


toDouble

@java.lang.Deprecatedpublic static CharSequence unexpand(CharSequence self, int tabStop) {
public static java.lang.Double toDouble(java.lang.CharSequence self)


toDouble

@java.lang.Deprecatedpublic static String unexpand(String self) {
public static java.lang.Double toDouble(java.lang.String self)


toFloat

public static java.lang.Float toFloat(java.lang.Number self)


toFloat

@java.lang.Deprecatedpublic static String unexpand(String self, int tabStop) {
public static java.lang.Float toFloat(java.lang.CharSequence self)


toFloat

@java.lang.Deprecatedpublic static CharSequence unexpandLine(CharSequence self, int tabStop) {
public static java.lang.Float toFloat(java.lang.String self)


toInteger

public static java.lang.Integer toInteger(java.lang.Number self)


toInteger

@java.lang.Deprecatedpublic static String unexpandLine(String self, int tabStop) {
public static java.lang.Integer toInteger(java.lang.CharSequence self)


toInteger

@java.lang.Deprecatedpublic static Process execute(final String self) throws IOException {
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

@java.lang.SuppressWarnings* added to the set.
public static java.util.List toList(byte[] array)


toList

@java.lang.SuppressWarnings* added to the set.
public static java.util.List toList(boolean[] array)


toList

@java.lang.SuppressWarnings* added to the set.
public static java.util.List toList(char[] array)


toList

@java.lang.SuppressWarnings* added to the set.
public static java.util.List toList(short[] array)


toList

@java.lang.SuppressWarnings* added to the set.
public static java.util.List toList(int[] array)


toList

@java.lang.SuppressWarnings* added to the set.
public static java.util.List toList(long[] array)


toList

@java.lang.SuppressWarnings* added to the set.
public static java.util.List toList(float[] array)


toList

@java.lang.SuppressWarnings* even if the Collection is already a Set.
public static java.util.List toList(double[] array)


toList

@java.lang.Deprecated}
public static java.util.List toList(java.lang.CharSequence self)


toList

@java.lang.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

@java.lang.Deprecated}
public static java.lang.Long toLong(java.lang.CharSequence self)


toLong

@java.lang.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)


toMapString

public static java.lang.String toMapString(java.util.Map self, int maxSize)


toSet

@java.lang.SuppressWarningspublic static  Set toSet(Collection self) {
public static java.util.Set toSet(byte[] array)


toSet

@java.lang.SuppressWarnings*/
public static java.util.Set toSet(boolean[] array)


toSet

@java.lang.SuppressWarnings* @return a Set
public static java.util.Set toSet(char[] array)


toSet

@java.lang.SuppressWarnings*
public static java.util.Set toSet(short[] array)


toSet

@java.lang.SuppressWarnings* @param self  an array object
public static java.util.Set toSet(int[] array)


toSet

@java.lang.SuppressWarnings
public static java.util.Set toSet(long[] array)


toSet

@java.lang.SuppressWarningsfor (Object value : indices) {
public static java.util.Set toSet(float[] array)
Implements the getAt(Collection) method for primitive type arrays. Each value in the collection argument is assumed to be a valid array index. The value at each index is then added to a list which is returned.
Parameters:
self - an array object
indices - the indices of interest
Returns:
the returned values from the array
Since:
1.0


toSet

@java.lang.SuppressWarnings/**
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)
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


toSet

public static java.util.Set toSet(java.util.Enumeration self)
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


toSet

@java.lang.Deprecated}
public static java.util.Set toSet(java.lang.CharSequence self)


toSet

@java.lang.Deprecated}
public static java.util.Set toSet(java.lang.String self)


toShort

@java.lang.Deprecated}
public static java.lang.Short toShort(java.lang.CharSequence self)


toShort

@java.lang.Deprecatedreturn SocketGroovyMethods.accept(serverSocket, runInANewThread, closure);
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)


toString

public static java.lang.String toString(int[] 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
maxSize - stop after approximately this many characters and append '...'
Returns:
the string representation
Since:
1.7.3


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)
Decrement a Number by one.
Parameters:
self - a Number
Returns:
a decremented Number
Since:
1.0


toString

public static java.lang.String toString(java.lang.Object[] self)


toString

public static java.lang.String toString(java.lang.Object value)


toURI

@java.lang.Deprecatedreturn ResourceGroovyMethods.size(self);
public static java.net.URI toURI(java.lang.CharSequence self)


toURI

@java.lang.Deprecatedreturn IOGroovyMethods.leftShift(self, value);
public static java.net.URI toURI(java.lang.String self)


toURL

@java.lang.DeprecatedIOGroovyMethods.write(self, writable);
public static java.net.URL toURL(java.lang.CharSequence self)


toURL

@java.lang.Deprecatedreturn IOGroovyMethods.leftShift(self, value);
public static java.net.URL toURL(java.lang.String self)


toUpperCase

public static char toUpperCase(java.lang.Character self)


tokenize

@java.lang.Deprecatedpublic static Process execute(final String self, final String[] envp, final File dir) throws IOException {
public static java.util.List tokenize(java.lang.CharSequence self)


tokenize

@java.lang.Deprecatedpublic static Process execute(final String self, final List envp, final File dir) throws IOException {
public static java.util.List tokenize(java.lang.CharSequence self, java.lang.Character token)


tokenize

@java.lang.Deprecatedpublic static Process execute(final String[] commandArray) throws IOException {
public static java.util.List tokenize(java.lang.CharSequence self, java.lang.CharSequence token)


tokenize

@java.lang.Deprecatedpublic static Process execute(final String[] commandArray, final String[] envp, final File dir) throws IOException {
@java.lang.SuppressWarningsreturn ProcessGroovyMethods.execute(commandArray, envp, dir);
public static java.util.List tokenize(java.lang.String self)


tokenize

@java.lang.Deprecatedreturn ProcessGroovyMethods.execute(commandArray, envp, dir);
public static java.util.List tokenize(java.lang.String self, java.lang.Character token)


tokenize

@java.lang.Deprecatedreturn ProcessGroovyMethods.execute(commands);
@java.lang.SuppressWarnings}
public static java.util.List tokenize(java.lang.String self, java.lang.String token)


tr

@java.lang.DeprecatedIOGroovyMethods.leftShift(self, value);
public static java.lang.CharSequence tr(java.lang.CharSequence self, java.lang.CharSequence sourceSet, java.lang.CharSequence replacementSet)


tr

@java.lang.Deprecatedreturn IOGroovyMethods.leftShift(self, in);
public static java.lang.String tr(java.lang.String self, java.lang.String sourceSet, java.lang.String replacementSet)


transformChar

@java.lang.Deprecated
public static void transformChar(java.io.Reader self, java.io.Writer writer, Closure closure)


transformLine

@java.lang.Deprecated
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

@java.lang.Deprecated}
public static void traverse(java.io.File self, java.util.Map options, Closure closure)


traverse

@java.lang.Deprecated
public static void traverse(java.io.File self, Closure closure)


traverse

@java.lang.Deprecated
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)
Transform a Number into an Integer
Parameters:
self - a Number
Returns:
an Integer
Since:
1.0


unaryMinus

public static java.lang.Number unaryMinus(java.lang.Number left)
Iterates from this number up to the given number, inclusive, incrementing by one each time.
Parameters:
self - a Float
to - the end number
closure - the code to execute for each number
Since:
1.0


unexpand

@java.lang.Deprecatedreturn IOGroovyMethods.leftShift(self, value);
public static java.lang.CharSequence unexpand(java.lang.CharSequence self)


unexpand

@java.lang.Deprecatedreturn ResourceGroovyMethods.newObjectOutputStream(file);
public static java.lang.CharSequence unexpand(java.lang.CharSequence self, int tabStop)


unexpand

@java.lang.Deprecatedreturn IOGroovyMethods.newObjectOutputStream(outputStream);
public static java.lang.String unexpand(java.lang.String self)


unexpand

@java.lang.Deprecatedreturn ResourceGroovyMethods.withObjectOutputStream(file, closure);
public static java.lang.String unexpand(java.lang.String self, int tabStop)


unexpandLine

@java.lang.Deprecatedreturn IOGroovyMethods.withObjectOutputStream(outputStream, closure);
public static java.lang.CharSequence unexpandLine(java.lang.CharSequence self, int tabStop)


unexpandLine

@java.lang.Deprecatedreturn ResourceGroovyMethods.newObjectInputStream(file);
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)


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

@java.lang.Deprecated}
public static java.lang.Object withDataInputStream(java.io.File file, Closure closure)


withDataOutputStream

@java.lang.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)
deprecated:
Use the Iterable version of sort instead
See Also:
sort(Iterable)
Since:
1.0


withInputStream

@java.lang.Deprecated}
public static java.lang.Object withInputStream(java.io.File file, Closure closure)


withInputStream

@java.lang.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

@java.lang.Deprecated}
public static java.lang.Object withObjectInputStream(java.io.File file, Closure closure)


withObjectInputStream

@java.lang.Deprecated}
public static java.lang.Object withObjectInputStream(java.io.File file, java.lang.ClassLoader classLoader, Closure closure)


withObjectInputStream

@java.lang.Deprecated}
public static java.lang.Object withObjectInputStream(java.io.InputStream inputStream, Closure closure)


withObjectInputStream

@java.lang.Deprecated}
public static java.lang.Object withObjectInputStream(java.io.InputStream inputStream, java.lang.ClassLoader classLoader, Closure closure)


withObjectOutputStream

@java.lang.Deprecated}
public static java.lang.Object withObjectOutputStream(java.io.File file, Closure closure)


withObjectOutputStream

@java.lang.Deprecated}
public static java.lang.Object withObjectOutputStream(java.io.OutputStream outputStream, Closure closure)


withObjectStreams

@java.lang.Deprecatedreturn ResourceGroovyMethods.eachLine(self, charset, closure);
public static java.lang.Object withObjectStreams(java.net.Socket socket, Closure closure)


withOutputStream

@java.lang.Deprecated}
public static java.lang.Object withOutputStream(java.io.File file, Closure closure)


withPrintWriter

@java.lang.Deprecated}
public static java.lang.Object withPrintWriter(java.io.File file, Closure closure)


withPrintWriter

@java.lang.Deprecated}
public static java.lang.Object withPrintWriter(java.io.File file, java.lang.String charset, Closure closure)


withPrintWriter

@java.lang.Deprecated}
public static java.lang.Object withPrintWriter(java.io.Writer writer, Closure closure)


withReader

@java.lang.Deprecated}
public static java.lang.Object withReader(java.io.File file, Closure closure)


withReader

@java.lang.Deprecated}
public static java.lang.Object withReader(java.io.File file, java.lang.String charset, Closure closure)


withReader

@java.lang.Deprecated}
public static java.lang.Object withReader(java.io.Reader reader, Closure closure)


withReader

@java.lang.Deprecated}
public static java.lang.Object withReader(java.net.URL url, Closure closure)


withReader

@java.lang.Deprecated}
public static java.lang.Object withReader(java.net.URL url, java.lang.String charset, Closure closure)


withReader

@java.lang.Deprecated}
public static java.lang.Object withReader(java.io.InputStream in, Closure closure)


withReader

@java.lang.Deprecated}
public static java.lang.Object withReader(java.io.InputStream in, java.lang.String charset, Closure closure)


withStream

@java.lang.Deprecated}
public static java.lang.Object withStream(java.io.InputStream stream, Closure closure)


withStream

@java.lang.Deprecated}
public static java.lang.Object withStream(java.io.OutputStream os, Closure closure)


withStreams

@java.lang.Deprecatedreturn ResourceGroovyMethods.eachLine(self, closure);
public static java.lang.Object withStreams(java.net.Socket socket, Closure closure)


withWriter

@java.lang.Deprecated}
public static java.lang.Object withWriter(java.io.File file, Closure closure)


withWriter

@java.lang.Deprecated}
public static java.lang.Object withWriter(java.io.File file, java.lang.String charset, Closure closure)


withWriter

@java.lang.Deprecated}
public static java.lang.Object withWriter(java.io.Writer writer, Closure closure)


withWriter

@java.lang.Deprecated}
public static java.lang.Object withWriter(java.io.OutputStream stream, Closure closure)


withWriter

@java.lang.Deprecated}
public static java.lang.Object withWriter(java.io.OutputStream stream, java.lang.String charset, Closure closure)


withWriterAppend

@java.lang.Deprecated}
public static java.lang.Object withWriterAppend(java.io.File file, java.lang.String charset, Closure closure)


withWriterAppend

@java.lang.Deprecated}
public static java.lang.Object withWriterAppend(java.io.File file, Closure closure)


write

@java.lang.Deprecated}
public static void write(java.io.Writer self, Writable writable)


write

@java.lang.Deprecatedreturn IOGroovyMethods.iterator(self);
public static void write(java.io.File file, java.lang.String text)


write

@java.lang.Deprecatedthrows FileNotFoundException, UnsupportedEncodingException {
public static void write(java.io.File file, java.lang.String text, java.lang.String charset)


writeLine

@java.lang.Deprecatedreturn IOGroovyMethods.iterator(self);
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