Groovy JDK
A B C D E F G H I J L M N O P R S T U W X

A

abs() - Method in class java.lang.Double
Get the absolute value  
accept(groovy.lang.Closure closure) - Method in class java.net.ServerSocket
Accepts a connection and passes the resulting Socket to the closure which runs in a new Thread  
addShutdownHook(groovy.lang.Closure closure) - Method in class java.lang.Object
Allows the usage of addShutdownHook without getting the runtime first  
and(java.lang.Boolean right) - Method in class java.lang.Boolean
 
and(java.lang.Number right) - Method in class java.lang.Number
Bitwise AND together two Numbers  
and(java.util.BitSet right) - Method in class java.util.BitSet
Bitwise AND together two BitSets  
any() - Method in class java.lang.Object
Iterates over the elements of a collection, and checks whether at least one element is true according to the Groovy Truth Equivalent to self  
any(groovy.lang.Closure closure) - Method in class java.lang.Object
Iterates over the contents of an object or collection, and checks whether a predicate is valid for at least one element  
append(byte[] bytes) - Method in class java.io.File
Append bytes to the end of a File  
append(java.lang.Object text) - Method in class java.io.File
Append the text at the end of the File  
append(java.lang.Object text, java.lang.String charset) - Method in class java.io.File
Append the text at the end of the File, using a specified encoding  
asImmutable() - Method in class java.util.Collection
A convenience method for creating an immutable Collection  
asList() - Method in class java.util.Collection
Converts this collection to a List  
asSynchronized() - Method in class java.util.Collection
A convenience method for creating a synchronized Collection  
asType(java.lang.Class c) - Method in class java.lang.Number
Transform this number to a the given type, using the 'as' operator following types are supported in addition to the default {@link #asType(Object,Class)}:  
asType(java.lang.Class clazz) - Method in class java.lang.Object[]
Converts the given array to either a List, Set, or SortedSet call is deferred to {link #asType(Object,Class)}  
asType(java.lang.Class type) - Method in class java.lang.Object
Converts a given object to a type the "as" operator and is overloadable as any other operator  
asWritable() - Method in class java.io.File
Converts this File to a {@link Writable}  
asWritable(java.lang.String encoding) - Method in class java.io.File
Allows a file to return a Writable implementation that can output itself to a Writer stream  

B

bitwiseNegate() - Method in class java.lang.String
Turns a String into a regular expression pattern  

C

center(java.lang.Number numberOfChars) - Method in class java.lang.String
Center a String and padd it with spaces appended around it  
center(java.lang.Number numberOfChars, java.lang.String padding) - Method in class java.lang.String
Center a String and padd it with the characters appended around it  
collect(groovy.lang.Closure closure) - Method in class java.lang.Object
Iterates through this object transforming each value into a new value using the closure as a transformer, returning a list of transformed values Example:
def list = [1, 'a', 1
def types = list
 
collect(java.util.Collection collection, groovy.lang.Closure closure) - Method in class java.lang.Object
Iterates through this object transforming each object into a new value using the closure as a transformer and adding it to the collection, returning the resulting collection  
collectAll(groovy.lang.Closure closure) - Method in class java.util.Collection
Recursively iterates through this collection transforming each non-Collection value into a new value using the closure as a transformer list of transformed values  
collectAll(java.util.Collection collection, groovy.lang.Closure closure) - Method in class java.util.Collection
Recursively iterates through this collection transforming each non-Collection value into a new value using the closure as a transformer collection of transformed values  
combinations() - Method in class java.util.Collection
Adds GroovyCollections#combinations(Collection) as a method on collections  
compareTo(java.lang.Character right) - Method in class java.lang.Character
Compare two Characters digit (i representation  
compareTo(java.lang.Number right) - Method in class java.lang.Character
Compare a Character and a Number digit (i representation  
consumeProcessErrorStream(java.io.OutputStream err) - Method in class java.lang.Process
Gets the error stream from a process and reads it to keep the process from blocking due to a full buffer The processed stream data is appended to the supplied OutputStream A new Thread is started, so this method will return immediately  
consumeProcessErrorStream(java.io.Writer err) - Method in class java.lang.Process
Gets the error stream from a process and reads it to keep the process from blocking due to a full buffer The processed stream data is appended to the supplied Writer A new Thread is started, so this method will return immediately  
consumeProcessErrorStream(java.lang.StringBuffer error) - Method in class java.lang.Process
Gets the error stream from a process and reads it to keep the process from blocking due to a full buffer The processed stream data is appended to the supplied StringBuffer A new Thread is started, so this method will return immediately  
consumeProcessOutput() - Method in class java.lang.Process
Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer two Threads are started, so this method will return immediately  
consumeProcessOutput(java.io.OutputStream output, java.io.OutputStream error) - Method in class java.lang.Process
Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer The processed stream data is appended to the supplied OutputStream For this, two Threads are started, so this method will return immediately  
consumeProcessOutput(java.lang.StringBuffer output, java.lang.StringBuffer error) - Method in class java.lang.Process
Gets the output and error streams from a process and reads them to keep the process from blocking due to a full output buffer The processed stream data is appended to the supplied StringBuffer For this, two Threads are started, so this method will return immediately  
consumeProcessOutputStream(java.io.OutputStream output) - Method in class java.lang.Process
Gets the output stream from a process and reads it to keep the process from blocking due to a full output buffer The processed stream data is appended to the supplied OutputStream A new Thread is started, so this method will return immediately  
consumeProcessOutputStream(java.io.Writer output) - Method in class java.lang.Process
Gets the output stream from a process and reads it to keep the process from blocking due to a full output buffer The processed stream data is appended to the supplied Writer A new Thread is started, so this method will return immediately  
consumeProcessOutputStream(java.lang.StringBuffer output) - Method in class java.lang.Process
Gets the output stream from a process and reads it to keep the process from blocking due to a full output buffer The processed stream data is appended to the supplied StringBuffer A new Thread is started, so this method will return immediately  
contains(java.lang.String text) - Method in class java.lang.String
Provide an implementation of contains() like {@link Collection#contains(Object)} to make Strings more polymorphic This method is not required on JDK 1  
count(java.lang.Object value) - Method in class java.util.Collection
Counts the number of occurrences of the given value inside this collection Comparison is done using Groovy's == operator (using compareTo(value) == 0 or equals(value) )  
count(java.lang.String text) - Method in class java.lang.String
Count the number of occurencies of a substring  

D

decodeBase64() - Method in class java.lang.String
Decode the String from Base64 into a byte array  
disjoint(java.util.Collection right) - Method in class java.util.Collection
Returns true if the intersection of two collections is empty  
div(java.lang.Character right) - Method in class java.lang.Character
Divide one Character by another digit (i representation  
div(java.lang.Number right) - Method in class java.lang.Character
Divide a Character by a Number digit (i representation  
downto(java.lang.Number to, groovy.lang.Closure closure) - Method in class java.lang.Double
Iterates from this number down to the given number, inclusive, decrementing by one each time  
dump() - Method in class java.lang.Object
Generates a detailed dump string of an object showing its class, hashCode and fields  

E

each(groovy.lang.Closure closure) - Method in class java.lang.Object
Iterates through an aggregate type or data structure, passing each item to the given closure method by simply providing an "iterator()" method from the resulting iterator will be passed to the closure  
eachByte(groovy.lang.Closure closure) - Method in class java.lang.Byte[]
Traverse through each byte of this Byte array  
eachDir(groovy.lang.Closure closure) - Method in class java.io.File
Invokes the closure for each directory in this directory, ignoring regular files  
eachDirMatch(java.lang.Object filter, groovy.lang.Closure closure) - Method in class java.io.File
Invokes the closure for each directory whose name (dir - calling the isCase() method to determine if a match occurs with different kinds of filters like regular expressions, classes, ranges etc  
eachDirRecurse(groovy.lang.Closure closure) - Method in class java.io.File
Invokes the closure for each descendant directory of this directory Sub-directories are recursively searched in a depth-first fashion Only directories are passed to the closure; regular files are ignored  
eachFile(groovy.lang.Closure closure) - Method in class java.io.File
Invokes the closure for each file in the given directory  
eachFileMatch(java.lang.Object filter, groovy.lang.Closure closure) - Method in class java.io.File
Invokes the closure for each file whose name (file - calling the isCase() method to determine if a match occurs with different kinds of filters like regular expressions, classes, ranges etc  
eachFileRecurse(groovy.lang.Closure closure) - Method in class java.io.File
Invokes the closure for each descendant file in this directory Sub-directories are recursively searched in a depth-first fashion  
eachLine(groovy.lang.Closure closure) - Method in class java.lang.String
Iterates through this String line by line to the given 1 or 2 arg closure the line count is passed as the second argument  
eachLine(int firstLine, groovy.lang.Closure closure) - Method in class java.lang.String
Iterates through this String line by line to the given 1 or 2 arg closure the line count is passed as the second argument  
eachLine(java.lang.String charset, groovy.lang.Closure closure) - Method in class java.io.InputStream
Iterates through this stream reading with the provided charset, passing each line to the given 1 or 2 arg closure  
eachLine(java.lang.String charset, int firstLine, groovy.lang.Closure closure) - Method in class java.io.InputStream
Iterates through this stream reading with the provided charset, passing each line to the given 1 or 2 arg closure  
eachMatch(java.lang.String regex, groovy.lang.Closure closure) - Method in class java.lang.String
Process each regex group matched substring of the given string parameter takes one argument, an array with all match groups is passed to it If the closure takes as many arguments as there are match groups, then each parameter will be one match group  
eachObject(groovy.lang.Closure closure) - Method in class java.io.File
Iterates through the given file object by object  
eachWithIndex(groovy.lang.Closure closure) - Method in class java.lang.Object
Iterates through an aggregate type or data structure, passing each item and the item's index (a counter starting at zero) to the given closure  
encodeBase64() - Method in class java.lang.Byte[]
Produce a Writable object which writes the Base64 encoding of the byte array Calling toString() on the result returns the encoding as a String information on Base64 encoding and chunking see RFC 4648  
encodeBase64(boolean chunked) - Method in class java.lang.Byte[]
Produce a Writable object which writes the Base64 encoding of the byte array Calling toString() on the result returns the encoding as a String information on Base64 encoding and chunking see RFC 4648  
equals(int[] right) - Method in class primitive-types.int[]
Compare the contents of this array to the contents of the given array  
equals(java.lang.Object[] right) - Method in class java.util.List
Determines if the contents of this list are equal to the contents of the given array in the same order false if either collection is null  
equals(java.util.List right) - Method in class java.lang.Object[]
Determines if the contents of this array are equal to the contents of the given list, in the same order false if either collection is null  
every() - Method in class java.lang.Object
Iterates over every element of a collection, and checks whether all elements are true according to the Groovy Truth Equivalent to self  
every(groovy.lang.Closure closure) - Method in class java.lang.Object
Used to determine if the given predicate closure is valid (i true for all items in this data structure) A simple example for a list:
def list = [3,4,5]
def greaterThanTwo = list
 
execute() - Method in class java.lang.String
Executes the given string as a command line process over the process mechanism in JDK 1  
execute(java.lang.String[] envp, java.io.File dir) - Method in class java.lang.String
Executes the command specified by the self with environments envp under the working directory dir For more control over the process mechanism in JDK 1  
execute(java.util.List envp, java.io.File dir) - Method in class java.lang.String
Executes the command specified by the self with environments envp under the working directory dir For more control over the process mechanism in JDK 1  

F

filterLine(groovy.lang.Closure closure) - Method in class java.io.File
Filters the lines of a File and creates a Writeable in return to stream the filtered lines  
filterLine(groovy.lang.Closure predicate) - Method in class java.io.InputStream
Filter lines from an input stream using a closure predicate will be passed each line as a String, and it should return true if the line should be passed to the writer  
filterLine(java.io.Writer writer, groovy.lang.Closure closure) - Method in class java.io.File
Filter the lines from this File, and write them to the given writer based on the given closure predicate  
filterLine(java.io.Writer writer, groovy.lang.Closure predicate) - Method in class java.io.InputStream
Uses a closure to filter lines from this InputStream and pass them to the given writer it should return true if the line should be passed to the writer  
find(groovy.lang.Closure closure) - Method in class java.lang.Object
Finds the first value matching the closure condition  
findAll(groovy.lang.Closure closure) - Method in class java.lang.Object
Finds all items matching the closure condition  
findIndexOf(groovy.lang.Closure closure) - Method in class java.lang.Object
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  
findIndexOf(int startIndex, groovy.lang.Closure closure) - Method in class java.lang.Object
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  
findIndexValues(groovy.lang.Closure closure) - Method in class java.lang.Object
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  
findIndexValues(int startIndex, groovy.lang.Closure closure) - Method in class java.lang.Object
Iterates over the elements of an iterable collection of items, starting from a specified startIndex, and returns the index values of the items that match the condition specified in the closure  
findLastIndexOf(groovy.lang.Closure closure) - Method in class java.lang.Object
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  
findLastIndexOf(int startIndex, groovy.lang.Closure closure) - Method in class java.lang.Object
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  
first() - Method in class java.util.List
Returns the first item from the List  
flatten() - Method in class java.util.Collection
Flatten a collection collections have their contents (recursively) added to the new collection WARNING: Any Maps found in the collection are flattened to the Map's values and merged into the flattened collection may change in a future release use flatten(Collection, Closure) with an identity closure  
flatten(groovy.lang.Closure flattenUsing) - Method in class java.util.Collection
Flatten a collection collections have their contents (recursively) added to the new collection For any non-Array, non-Collection object which represents some sort of collective type, the supplied closure should yield the contained items; otherwise, the closure should just return any element which corresponds to a leaf  
format(java.lang.String format) - Method in class java.util.Date
Return a String representing this date in the given format  

G

get(java.lang.Object key, java.lang.Object defaultValue) - Method in class java.util.Map
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  
getAt(groovy.lang.EmptyRange range) - Method in class java.lang.CharSequence
Support the range subscript operator for CharSequence or StringBuffer with EmptyRange  
getAt(groovy.lang.IntRange range) - Method in class java.lang.CharSequence
Support the range subscript operator for CharSequence or StringBuffer with IntRange  
getAt(groovy.lang.ObjectRange range) - Method in class java.lang.Object[]
 
getAt(groovy.lang.Range range) - Method in class java.lang.CharSequence
Support the range subscript operator for CharSequence  
getAt(int field) - Method in class java.util.Date
Support the subscript operator for a Date  
getAt(int idx) - Method in class java.lang.Object[]
Support the subscript operator for an Array  
getAt(int index) - Method in class java.lang.CharSequence
Support the subscript operator for CharSequence  
getAt(java.lang.Object key) - Method in class java.util.Map
Support the subscript operator for a Map  
getAt(java.lang.String property) - Method in class java.lang.Object
Allows the subscript operator to be used to lookup dynamic property values bean[somePropertyNameExpression] of groovy is neater and more concise but only works with compile-time known property names  
getAt(java.util.Collection indices) - Method in class java.lang.CharSequence
Allows a List to be used as the indices to be used on a CharSequence  
getChars() - Method in class java.lang.String
Converts the given String into an array of characters Alias for toCharArray  
getCount() - Method in class java.util.regex.Matcher
Find the number of Strings matched to the given Matcher  
getDateString() - Method in class java.util.Date
Return a string representation of the 'day' portion of this date according to the locale-specific format used by {@link DateFormat}  
getDateTimeString() - Method in class java.util.Date
Return a string representation of the date and time time portion of this Date instance, according to the locale-specific format used by {@link DateFormat} preset for the day portion and {@link DateFormat#MEDIUM} for the time portion of the string  
getErr() - Method in class java.lang.Process
An alias method so that a process appears similar to System you can use process  
getIn() - Method in class java.lang.Process
An alias method so that a process appears similar to System you can use process  
getLastMatcher() - Method in class java.util.regex.Matcher
Get the last hidden matcher that the system used to do a match  
getMetaClass() - Method in class java.lang.Class
Adds a "metaClass" property to all class objects so you can use the syntax String  
getMetaPropertyValues() - Method in class java.lang.Object
Retrieves the list of {@link MetaProperty} objects for 'self' and wraps it in a list of {@link PropertyValue} objects that additionally provide the value for each property of 'self'  
getOut() - Method in class java.lang.Process
An alias method so that a process appears similar to System you can use process  
getProperties() - Method in class java.lang.Object
Convenience method that calls {@link #getMetaPropertyValues(Object)}(self) and provides the data in form of simple key/value pairs, i type() information  
getRootLoader() - Method in class java.lang.ClassLoader
Iterates through the classloader parents until it finds a loader with a class named "org null will be returned a direct comparison using == may fail as the class may be loaded through different classloaders  
getText() - Method in class java.lang.Process
Read the text of the output stream of the Process  
getText(java.lang.String charset) - Method in class java.io.File
Read the content of the File using the specified encoding and return it as a String  
getTimeString() - Method in class java.util.Date
Return a string representation of the time portion of this date according to the locale-specific format used by {@link DateFormat}  
grep(java.lang.Object filter) - Method in class java.lang.Object
Iterates over every element of the collection and returns each item that matches the given filter - calling the {@link #isCase(Object,Object)} method used by switch statements kinds of filters like regular expressions, classes, ranges etc Example:
def list = ['a', 'b', 'aa', 'bc' ]
def filtered = list
 
groupBy(groovy.lang.Closure closure) - Method in class java.util.Collection
Sorts all collection members into groups determined by the supplied mapping closure item should be grouped by distinct key returned from the closure, with each value being a list of items for that group  
groupEntriesBy(groovy.lang.Closure closure) - Method in class java.util.Map
Groups all map entries into groups determined by the supplied mapping closure key and value (depending on the number of parameters the closure accepts) and should return the key that each item should be grouped under resulting map will have an entry for each 'group' key returned by the closure, with values being the list of map entries that belong to each group  

H

hasGroup() - Method in class java.util.regex.Matcher
Check whether a Matcher contains a group or not  
head() - Method in class java.util.List
Returns the first item from the List  

I

identity(groovy.lang.Closure closure) - Method in class java.lang.Object
Allows the closure to be called for the object reference self synonym for 'with()'  
inject(java.lang.Object initialValue, groovy.lang.Closure closure) - Method in class java.lang.Object[]
Iterates through the given array of objects, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure  
inject(java.lang.Object value, groovy.lang.Closure closure) - Method in class java.lang.Object
Iterates through the given object, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure  
inspect() - Method in class java.lang.Object
Inspects returns the String that matches what would be typed into a terminal to create this object  
intdiv(java.lang.Character right) - Method in class java.lang.Character
Integer Divide two Characters  
intdiv(java.lang.Number right) - Method in class java.lang.Character
Integer Divide a Character by a Number  
intersect(java.util.Collection right) - Method in class java.util.Collection
Create a Collection composed of the intersection of both collections elements that exist in both collections are added to the resultant collection  
invokeMethod(java.lang.String method, java.lang.Object arguments) - Method in class java.lang.Object
Provide a dynamic method invocation method which can be overloaded in classes to implement dynamic proxies easily  
is(java.lang.Object other) - Method in class java.lang.Object
Identity check we need some fallback to check for object identity 'is' operator, like so: def same = (this is that)  
isBigDecimal() - Method in class java.lang.String
Determine if a String can be parsed into a BigDecimal  
isBigInteger() - Method in class java.lang.String
Determine if a String can be parsed into a BigInteger  
isCase(java.lang.Number switchValue) - Method in class java.lang.Number
Special 'case' implementation for all numbers, which delegates to the compareTo() method for comparing numbers of different types  
isCase(java.lang.Object switchValue) - Method in class java.lang.Class
Special 'Case' implementation for Class, which allows testing for a certain class in a switch statement For example:
switch( obj ) {
case List :
// obj is a list
break;
case Set :
// etc
}
             
            
            
            
isDigit() - Method in class java.lang.Character
Determines if a character is a digit Synonym for 'Character  
isDouble() - Method in class java.lang.String
Determine if a String can be parsed into a Double  
isFloat() - Method in class java.lang.String
Determine if a String can be parsed into a Float  
isInteger() - Method in class java.lang.String
Determine if a String can be parsed into an Integer  
isLetter() - Method in class java.lang.Character
Determines if a character is a letter Synonym for 'Character  
isLetterOrDigit() - Method in class java.lang.Character
Determines if a character is a letter or digit Synonym for 'Character  
isLong() - Method in class java.lang.String
Determine if a String can be parsed into a Long  
isLowerCase() - Method in class java.lang.Character
Determine if a Character is lowercase Synonym for 'Character  
isNumber() - Method in class java.lang.String
Determine if a String can be parsed into a Number Synonym for 'isBigDecimal()'  
isUpperCase() - Method in class java.lang.Character
Determine if a Character is uppercase Synonym for 'Character  
isWhitespace() - Method in class java.lang.Character
Determines if a character is a whitespace character Synonym for 'Character  
iterator() - Method in class java.lang.Object
Attempts to create an Iterator for the given object by first converting it to a Collection  

J

join(java.lang.String separator) - Method in class java.lang.Object[]
Concatenates the toString() representation of each items in this array, with the given String as a separator between each item  

L

last() - Method in class java.util.List
Returns the last item from the List  
leftShift(byte[] bytes) - Method in class java.io.File
Write bytes to a File  
leftShift(byte[] value) - Method in class java.lang.Process
Overloads the left shift operator to provide an append mechanism to pipe into a Process  
leftShift(java.io.InputStream in) - Method in class java.io.OutputStream
Pipe an InputStream into an OutputStream for efficient stream copying  
leftShift(java.lang.Number operand) - Method in class java.lang.Number
Implementation of the left shift operator for integral types Number types throw UnsupportedOperationException  
leftShift(java.lang.Object text) - Method in class java.io.File
Write the text to the File  
leftShift(java.lang.Object value) - Method in class java.lang.Process
Overloads the left shift operator (<<) to provide an append mechanism to pipe data to a Process  
leftShift(java.util.Map$Entry entry) - Method in class java.util.Map
Overloads the left shift operator to provide an easy way to append Map  

M

max() - Method in class java.lang.Object[]
Adds max() method to Object arrays  
max(groovy.lang.Closure closure) - Method in class java.lang.Object[]
Selects the maximum value found from the Object array using the given closure as a comparator number) for each item passed  
max(java.util.Comparator comparator) - Method in class java.lang.Object[]
Selects the maximum value found from the Object array using the given comparator  
min() - Method in class java.lang.Object[]
Adds min() method to Object arrays  
min(groovy.lang.Closure closure) - Method in class java.lang.Object[]
Selects the minimum value found from the Object array using the given closure as a comparator number) for each item passed  
min(java.util.Comparator comparator) - Method in class java.lang.Object[]
Selects the minimum value found from the Object array using the given comparator  
minus(int days) - Method in class java.util.Date
Subtract a number of days from this date and returns the new date  
minus(java.lang.Character right) - Method in class java.lang.Character
Subtract one Characters from another by converting them both to their Integer representations digit (i representation  
minus(java.lang.Number right) - Method in class java.lang.Character
Subtract a Number from a Character digit (i representation  
minus(java.lang.Object operand) - Method in class java.lang.Object[]
Create a new object array composed of the elements of the first array minus the operand  
minus(java.lang.Object target) - Method in class java.lang.String
Remove a part of a String of target within self with '' and returns the result target is a regex Pattern, the first occurrence of that pattern will be removed (using regex matching), otherwise the first occurrence of target  
minus(java.lang.Object[] removeMe) - Method in class java.lang.Object[]
Create an array composed of the elements of the first array minus the elements of the given array  
minus(java.util.Collection operands) - Method in class java.util.Set
Create a Set composed of the elements of the first set minus the elements of the given collection

TODO: remove using number comparator?  

minus(java.util.Collection removeMe) - Method in class java.lang.Object[]
Create an array composed of the elements of the first array minus the elements of the given collection  
mod(java.lang.Number right) - Method in class java.lang.Number
Performs a division modulus operation  
multiply(java.lang.Character right) - Method in class java.lang.Character
Multiply two Characters digit (i representation  
multiply(java.lang.Double right) - Method in class java.math.BigDecimal
Multiply a BigDecimal and a Double Note: This method was added to enforce the Groovy rule of BigDecimal*Double == Double multiply(BigDecimal) method in BigDecimal would respond and return a BigDecimal instead over Number, the Number*Number method is not choosen as in older versions of Groovy  
multiply(java.lang.Number factor) - Method in class java.lang.String
Repeat a String a certain number of times  
multiply(java.lang.Number right) - Method in class java.lang.Character
Multiply a Character by a Number digit (i representation  
multiply(java.math.BigInteger right) - Method in class java.math.BigDecimal
Multiply a BigDecimal and a BigInteger Note: This method was added to enforce the Groovy rule of BigDecimal*long == long multiply(BigDecimal) method in BigDecimal would respond and return a BigDecimal instead over Number, the Number*Number method is not choosen as in older versions of Groovy types in Groovy  

N

newDataInputStream() - Method in class java.io.File
Create a data input stream for this file  
newDataOutputStream() - Method in class java.io.File
Creates a new data output stream for this file  
newInputStream() - Method in class java.io.File
Creates a buffered input stream for this file  
newInstance() - Method in class java.lang.Class
Convenience method to dynamically create a new instance of this class  
newInstance(java.lang.Object[] args) - Method in class java.lang.Class
Helper to construct a new instance from the given arguments The constructor is called based on the number and types in the args array newInstance() for the default (no-arg) constructor  
newObjectInputStream() - Method in class java.io.File
Create an object input stream for this file  
newObjectOutputStream() - Method in class java.io.File
Create an object output stream for this file  
newOutputStream() - Method in class java.io.File
Create a buffered output stream for this file  
newPrintWriter() - Method in class java.io.File
Create a new PrintWriter for this file  
newPrintWriter(java.lang.String charset) - Method in class java.io.File
Create a new PrintWriter for this file, using specified charset  
newReader() - Method in class java.io.File
Create a buffered reader for this file  
newReader(java.lang.String charset) - Method in class java.io.File
Create a buffered reader for this file, using the specified charset as the encoding  
newWriter() - Method in class java.io.File
Create a buffered writer for this file  
newWriter(boolean append) - Method in class java.io.File
Creates a buffered writer for this file, optionally appending to the existing file content  
newWriter(java.lang.String charset) - Method in class java.io.File
Creates a buffered writer for this file, writing data using the given encoding  
newWriter(java.lang.String charset, boolean append) - Method in class java.io.File
Helper method to create a buffered writer for a file charset is "UTF-16BE" or "UTF-16LE", the requisite byte order mark is written to the stream before the writer is returned  
next() - Method in class java.lang.Character
Increment a Character by one  
numberAwareCompareTo(java.lang.Comparable other) - Method in class java.lang.Comparable
Provides a method that compares two comparables using Groovy's default number aware comparator  

O

or(java.lang.Boolean right) - Method in class java.lang.Boolean
 
or(java.lang.Number right) - Method in class java.lang.Number
Bitwise OR together two numbers  
or(java.lang.Process right) - Method in class java.lang.Process
Overrides the or operator to allow one Process to asynchronously pipe data to another Process  
or(java.util.BitSet right) - Method in class java.util.BitSet
Bitwise OR together two BitSets between two bit sets  

P

padLeft(java.lang.Number numberOfChars) - Method in class java.lang.String
Pad a String with the spaces appended to the left  
padLeft(java.lang.Number numberOfChars, java.lang.String padding) - Method in class java.lang.String
Pad a String with the characters appended to the left  
padRight(java.lang.Number numberOfChars) - Method in class java.lang.String
Pad a String with the spaces appended to the right  
padRight(java.lang.Number numberOfChars, java.lang.String padding) - Method in class java.lang.String
Pad a String with the characters appended to the right  
parse(java.lang.String format, java.lang.String input) - Method in class java.util.Date
This convenience method acts as a wrapper for {@link SimpleDateFormat}  
pipeTo(java.lang.Process right) - Method in class java.lang.Process
Allows one Process to asynchronously pipe data to another Process  
plus(int days) - Method in class java.util.Date
Add a number of days to this date and returns the new date  
plus(java.lang.Character right) - Method in class java.lang.Character
Add two Characters through '9') and add the results This operation will always create a new object for the result, while the operands remain unchanged  
plus(java.lang.Number right) - Method in class java.lang.Character
Add a Character and a Number This operation will always create a new object for the result, while the operands remain unchanged of the digits '0' through '9', and the result is addition of the integer conversion of this character plus the operand  
plus(java.lang.Object right) - Method in class java.util.Collection
Create a collection as a union of a Collection and an Object 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  
plus(java.lang.Object value) - Method in class java.lang.String
Appends the String representation of the given operand to this string  
plus(java.lang.String right) - Method in class java.lang.Number
Appends a String to the string representation of this number  
plus(java.lang.String value) - Method in class java.lang.StringBuffer
Appends a String to this StringBuffer  
plus(java.util.Collection right) - Method in class java.util.Collection
Create a Collection as a union of two collections 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  
plus(java.util.Map right) - Method in class java.util.Map

Returns a new Map containing all entries from left and right, giving precedence to right will appear in the resultant map with values from the right operand or Properties, the returned Map will preserve that type, otherwise a HashMap will be returned

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

 
pop() - Method in class java.util.List
Removes the last item from the List is similar to push and pop on a Stack  
power(java.lang.Number exponent) - Method in class java.lang.Number
Power of a Number to a certain exponent  
previous() - Method in class java.lang.Character
Decrement a Character by one  
print(java.io.PrintWriter out) - Method in class java.lang.Object
Print to a console in interactive format  
print(java.lang.Object value) - Method in class java.lang.Object
Print a value to the standard output stream  
printf(java.lang.String format, java.lang.Object arg) - Method in class java.lang.Object
Prints a formatted string using the specified format string and arguments (Only works with JDK1

For examples,

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

( 1 ( 1 ( 0x41 ( 07 ( 7 ( 7 ( 7 ( 7

 

printf(java.lang.String format, java.lang.Object[] values) - Method in class java.lang.Object
Printf to a console (Only works with JDK1  
println() - Method in class java.lang.Object
Print a linebreak to the standard output stream  
println(java.io.PrintWriter out) - Method in class java.lang.Object
Print to a console in interactive format  
println(java.lang.Object value) - Method in class java.lang.Object
Print a value (followed by a newline) to the standard output stream  
push(java.lang.Object value) - Method in class java.util.List
Appends an item to the List  
putAt(groovy.lang.EmptyRange range, java.lang.Object value) - Method in class java.lang.StringBuffer
Support the range subscript operator for StringBuffer  
putAt(groovy.lang.IntRange range, boolean value) - Method in class java.util.BitSet
Support assigning a range of values with a single assignment statement  
putAt(groovy.lang.IntRange range, java.lang.Object value) - Method in class java.lang.StringBuffer
Support the range subscript operator for StringBuffer treated as characters within the buffer  
putAt(groovy.lang.IntRange range, java.util.Collection col) - Method in class java.util.List
List subscript assignment operator when given a range as the index and the assignment operand is a collection Example: myList[3 range are relaced with items from the collection  
putAt(int idx, java.lang.Boolean newValue) - Method in class primitive-types.boolean[]
 
putAt(int idx, java.lang.Object newValue) - Method in class primitive-types.byte[]
 
putAt(int idx, java.lang.Object value) - Method in class java.lang.Object[]
Support the subscript operator for an Array  
putAt(int index, boolean value) - Method in class java.util.BitSet
Support subscript-style assignment for a BitSet  
putAt(java.lang.Object key, java.lang.Object value) - Method in class java.util.Map
A helper method to allow lists to work with subscript operators  
putAt(java.lang.String property, java.lang.Object newValue) - Method in class java.lang.Object
Allows the subscript operator to be used to set dynamically named property values bean[somePropertyNameExpression] = foo of groovy is neater and more concise but only works with property names which are known at compile time  
putAt(java.util.List splice, java.lang.Object value) - Method in class java.util.List
A helper method to allow lists to work with subscript operators  
putAt(java.util.List splice, java.util.List values) - Method in class java.util.List
A helper method to allow lists to work with subscript operators  

R

readBytes() - Method in class java.io.File
Reads the content of the file into a byte array  
readLine() - Method in class java.io.InputStream
Just throws a DeprecationException  
readLines() - Method in class java.lang.String
Return the lines of a String as a List of Strings  
replaceAll(java.lang.String regex, groovy.lang.Closure closure) - Method in class java.lang.String
Replaces all occurrencies of a captured group by the result of a closure on that text

For examples,

assert "FOOBAR-FOOBAR-" == "foobar-FooBar-"

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

assert "FOO-FOO-" == "foobar-FooBar-"

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

 
reverse() - Method in class java.lang.Object[]
Reverse the items in an Object array  
reverseEach(groovy.lang.Closure closure) - Method in class java.lang.Object[]
Iterate over each element of the array in the reverse order  
rightShift(java.lang.Number operand) - Method in class java.lang.Number
Implementation of the right shift operator for integral types Number types throw UnsupportedOperationException  
rightShiftUnsigned(java.lang.Number operand) - Method in class java.lang.Number
Implementation of the right shift (unsigned) operator for integral types Number types throw UnsupportedOperationException  
round() - Method in class java.lang.Double
Round the value  
runAfter(int delay, groovy.lang.Closure closure) - Method in class java.util.Timer
Allows a simple syntax for using timers given closure after the given delay  

S

setIndex(int idx) - Method in class java.util.regex.Matcher
Set the position of the given Matcher to the given index  
setText(java.lang.String text) - Method in class java.io.File
Synonym for write(text) allowing file  
size() - Method in class java.lang.Object[]
Provide the standard Groovy size() method for an array  
sleep(long milliseconds) - Method in class java.lang.Object
Sleep for so many milliseconds, even if interrupted  
sleep(long milliseconds, groovy.lang.Closure onInterrupt) - Method in class java.lang.Object
Sleep for so many milliseconds, using a given closure for interrupt processing  
sort() - Method in class java.lang.Object[]
Sorts the given Object array into sorted order assumed to be comparable  
sort(groovy.lang.Closure closure) - Method in class java.lang.Object[]
Sorts the given Object array into a newly created array using the given comparator  
sort(java.util.Comparator comparator) - Method in class java.lang.Object[]
Sorts the given Object array into sorted order using the given comparator  
split() - Method in class java.lang.String
Convenience method to split a string (with whitespace as delimiter) Like tokenize, but returns an Array of Strings instead of a List  
splitEachLine(java.lang.String sep, groovy.lang.Closure closure) - Method in class java.lang.String
Iterates through the given String line by line, splitting each line using the given separator the given closure  
splitEachLine(java.lang.String sep, java.lang.String charset, groovy.lang.Closure closure) - Method in class java.io.InputStream
Iterates through the given InputStream line by line using the specified encoding, splitting each line using the given separator for each line is then passed to the given closure is closed  
spread() - Method in class java.util.Map
Synonym for {@link #toSpreadMap(Map)}  
sprintf(java.lang.String format, java.lang.Object arg) - Method in class java.lang.Object
Returns a formatted string using the specified format string and arguments

TODO: remove duplication with printf  

sprintf(java.lang.String format, java.lang.Object[] values) - Method in class java.lang.Object
Sprintf to a string (Only works with JDK1  
start(groovy.lang.Closure closure) - Method in class java.lang.Thread
Start a Thread with the given closure as a Runnable instance  
start(java.lang.String name, groovy.lang.Closure closure) - Method in class java.lang.Thread
Start a Thread with a given name and the given closure as a Runnable instance  
startDaemon(groovy.lang.Closure closure) - Method in class java.lang.Thread
Start a daemon Thread with the given closure as a Runnable instance  
startDaemon(java.lang.String name, groovy.lang.Closure closure) - Method in class java.lang.Thread
Start a daemon Thread with a given name and the given closure as a Runnable instance  
step(java.lang.Number to, java.lang.Number stepNumber, groovy.lang.Closure closure) - Method in class java.lang.Number
Iterates from this number up to the given number using a step increment Each intermediate number is passed to the given closure
0
println it
}
Prints even numbers 0 through 8  
subMap(java.util.Collection keys) - Method in class java.util.Map
Creates a sub-Map containing the given keys List  
sum() - Method in class java.util.Collection
Sums the items in a collection "plus" method on all items in the collection  
sum(groovy.lang.Closure closure) - Method in class java.util.Collection
Sums the result of apply a closure to each item of a collection coll coll  
sum(java.lang.Object initialValue) - Method in class java.util.Collection
Sums the items in a collection, adding the result to some initial value  
sum(java.lang.Object initialValue, groovy.lang.Closure closure) - Method in class java.util.Collection
Sums the result of apply a closure to each item of a collection to sum intial value coll coll  

T

tail() - Method in class java.util.List
Returns the items from the List excluding the first item  
times(groovy.lang.Closure closure) - Method in class java.lang.Number
Executes the closure this many times, starting from zero index is passed to the closure each time Example:
10
println it
}
Prints the numbers 0 through 9  
toArrayString() - Method in class java.lang.Object[]
Returns the string representation of the given array displays the contents of the array, similar to an array literal, i {1, 2, "a"}  
toBigDecimal() - Method in class java.lang.Number
Transform a Number into a BigDecimal  
toBigInteger() - Method in class java.lang.Number
Transform this Number into a BigInteger  
toBoolean() - Method in class java.lang.String
Converts the given string into a Boolean object If the trimmed string is "true", "y" or "1" (ignoring case) then the result is true othewrwise it is false  
toCharacter() - Method in class java.lang.String
Converts the given string into a Character object using the first character in the string  
toDouble() - Method in class java.lang.Number
Transform a Number into a Double  
toFloat() - Method in class java.lang.Number
Transform a Number into a Float  
toInteger() - Method in class java.lang.Number
Transform a Number into an Integer  
toList() - Method in class java.lang.Object[]
Allows conversion of arrays into a mutable List  
toListString() - Method in class java.util.Collection
Returns the string representation of the given list displays the contents of the list, similar to a list literal, i [1, 2, a]  
toLong() - Method in class java.lang.Number
Transform a Number into a Long  
toLowerCase() - Method in class java.lang.Character
Converts the character to lowercase Synonym for 'Character  
toMapString() - Method in class java.util.Map
Returns the string representation of this map contents of the map, i  
toRowResult() - Method in class java.sql.ResultSet
Returns a GroovyRowResult given a ResultSet  
toShort() - Method in class java.lang.String
Parse a String into a Short  
toSpreadMap() - Method in class java.lang.Object[]
Creates a spreadable map from this array  
toString() - Method in class java.lang.Object[]
Returns the string representation of this array's contents  
toURI() - Method in class java.lang.String
Transforms a String representing a URI into a URI object  
toURL() - Method in class java.lang.String
Transforms a String representing a URL into a URL object  
toUpperCase() - Method in class java.lang.Character
Converts the character to uppercase Synonym for 'Character  
tokenize() - Method in class java.lang.String
Tokenize a String (with a whitespace as the delimiter)  
tokenize(java.lang.String token) - Method in class java.lang.String
Tokenize a String based on the given string delimiter  
transformChar(java.io.Writer writer, groovy.lang.Closure closure) - Method in class java.io.Reader
Transforms each character from this reader by passing it to the given closure will be passed to the Writer closed before this method returns  
transformLine(java.io.Writer writer, groovy.lang.Closure closure) - Method in class java.io.Reader
Transforms the lines from a reader with a Closure and write them to a writer closed after the operation  
transpose() - Method in class java.util.Collection
Adds GroovyCollections#transpose(Collection) as a method on collections  

U

unaryMinus() - Method in class java.lang.Number
Negates the number a single operand, i  
unique() - Method in class java.util.Collection
Modifies this collection to remove all duplicated items, using the default comparator  
unique(groovy.lang.Closure closure) - Method in class java.util.Collection
A convenience method for making a collection unique using a closure as a comparator argument passed will be each element, and the closure should return a value used for comparison (either using {@link Comparable#compareTo(Object)} or Object#equals() ) closure takes two parameters, two items from the collection will be passed as arguments, and the closure should return an int value (with 0 indicating the items are not unique)  
unique(java.util.Comparator comparator) - Method in class java.util.Collection
Remove all duplicates from a given Collection Works on the receiver object and returns it The order of members in the Collection are compared by the given Comparator For each duplicate, the first member which is returned by the given Collection's iterator is retained, but all other ones are removed The given Collection's original order is preserved

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

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

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

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

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

 
upto(java.lang.Number to, groovy.lang.Closure closure) - Method in class java.lang.Double
Iterates from this number up to the given number, inclusive, incrementing by one each time  
use(java.lang.Class categoryClass, groovy.lang.Closure closure) - Method in class java.lang.Object
Scoped use method  
use(java.lang.Object[] array) - Method in class java.lang.Object
Allows you to use a list of categories, specifying the list as varargs use(CategoryClass1, CategoryClass2) { This method saves having to wrap the the category classes in a list  
use(java.util.List categoryClassList, groovy.lang.Closure closure) - Method in class java.lang.Object
Scoped use method with list of categories  

W

waitForOrKill(long numberOfMillis) - Method in class java.lang.Process
Wait for the process to finish during a certain amount of time, otherwise stops the process  
with(groovy.lang.Closure closure) - Method in class java.lang.Object
Allows the closure to be called for the object reference self  
withDataInputStream(groovy.lang.Closure closure) - Method in class java.io.File
Create a new DataInputStream for this file and passes it into the closure This method ensures the stream is closed after the closure returns  
withDataOutputStream(groovy.lang.Closure closure) - Method in class java.io.File
Create a new DataOutputStream for this file and passes it into the closure This method ensures the stream is closed after the closure returns  
withInputStream(groovy.lang.Closure closure) - Method in class java.io.File
Create a new InputStream for this file and passes it into the closure This method ensures the stream is closed after the closure returns  
withObjectInputStream(groovy.lang.Closure closure) - Method in class java.io.File
Create a new ObjectInputStream for this file and pass it to the closure This method ensures the stream is closed after the closure returns  
withObjectOutputStream(groovy.lang.Closure closure) - Method in class java.io.File
Create a new ObjectOutputStream for this file and then pass it to the closure returns  
withObjectStreams(groovy.lang.Closure closure) - Method in class java.net.Socket
Creates an InputObjectStream and an OutputObjectStream from a Socket, and passes them to the closure returns, even if an exception is thrown  
withOutputStream(groovy.lang.Closure closure) - Method in class java.lang.Process
Creates a new buffered OutputStream as stdin for this process, passes it to the closure, and ensures the stream is flushed and closed after the closure returns A new Thread is started, so this method will return immediately  
withPrintWriter(groovy.lang.Closure closure) - Method in class java.io.File
Create a new PrintWriter for this file which is then passed it into the given closure is closed after the closure returns  
withPrintWriter(java.lang.String charset, groovy.lang.Closure closure) - Method in class java.io.File
Create a new PrintWriter with a specified charset for this file before this method returns  
withReader(groovy.lang.Closure closure) - Method in class java.io.File
Create a new BufferedReader for this file and then passes it into the closure, ensuring the reader is closed after the closure returns  
withReader(java.lang.String charset, groovy.lang.Closure closure) - Method in class java.io.File
Create a new BufferedReader for this file using the specified charset and then passes it into the closure, ensuring the reader is closed after the closure returns  
withStream(groovy.lang.Closure closure) - Method in class java.io.InputStream
Allows this input stream to be used within the closure, ensuring that it is flushed and closed before this method returns  
withStreams(groovy.lang.Closure closure) - Method in class java.net.Socket
Passes the Socket's InputStream and OutputStream to the closure streams will be closed after the closure returns, even if an exception is thrown  
withWriter(groovy.lang.Closure closure) - Method in class java.lang.Process
Creates a new BufferedWriter as stdin for this process, passes it to the closure, and ensures the stream is flushed and closed after the closure returns A new Thread is started, so this method will return immediately  
withWriter(java.lang.String charset, groovy.lang.Closure closure) - Method in class java.io.File
Creates a new BufferedWriter for this file, passes it to the closure, and ensures the stream is flushed and closed after the closure returns The writer will use the given charset encoding  
withWriterAppend(groovy.lang.Closure closure) - Method in class java.io.File
Create a new BufferedWriter for this file in append mode is passed to the closure and is closed after the closure returns  
withWriterAppend(java.lang.String charset, groovy.lang.Closure closure) - Method in class java.io.File
Create a new BufferedWriter which will append to this file this method returns  
write(groovy.lang.Writable writable) - Method in class java.io.Writer
A helper method so that dynamic dispatch of the writer will always use the more efficient Writable object implements the Writable interface  
write(java.lang.String text) - Method in class java.io.File
Write the text to the File  
write(java.lang.String text, java.lang.String charset) - Method in class java.io.File
Write the text to the File, using the specified encoding  
writeLine(java.lang.String line) - Method in class java.io.BufferedWriter
Write the text and append a newline (using the platform's line-ending)  

X

xor(java.lang.Boolean right) - Method in class java.lang.Boolean
 
xor(java.lang.Number right) - Method in class java.lang.Number
Bitwise XOR together two Numbers  
xor(java.util.BitSet right) - Method in class java.util.BitSet
Bitwise XOR together two BitSets between two bit sets  

A B C D E F G H I J L M N O P R S T U W X
Groovy JDK