|
Groovy 2.1.9 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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.
Field Summary | |
---|---|
static Class[] |
DGM_LIKE_CLASSES
|
static Class[] |
additionals
|
Method Summary | |
---|---|
static int
|
abs(Number number)
Truncate the value |
static long
|
abs(Long number)
Truncate the value |
static float
|
abs(Float number)
Determine if a Character is uppercase. |
static double
|
abs(Double number)
|
static Socket
|
accept(ServerSocket serverSocket, Closure closure)
|
static Socket
|
accept(ServerSocket serverSocket, boolean runInANewThread, Closure closure)
|
static boolean
|
addAll(Collection self, Object[] items)
|
static boolean
|
addAll(List self, int index, Object[] items)
Splits all items into two lists based on the closure condition. |
static void
|
addShutdownHook(Object self, Closure closure)
|
static Number
|
and(Number left, Number right)
|
static BitSet
|
and(BitSet left, BitSet right)
|
static Boolean
|
and(Boolean left, 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(Object self, Closure closure)
|
static boolean
|
any(Map self, Closure closure)
|
static boolean
|
any(Object self)
|
static void
|
append(File file, Object text)
|
static void
|
append(File file, byte[] bytes)
|
static void
|
append(File self, InputStream stream)
|
static void
|
append(File file, Object text, String charset)
|
static boolean
|
asBoolean(Object object)
Coerce a collection instance to a boolean value. |
static boolean
|
asBoolean(Boolean bool)
|
static boolean
|
asBoolean(Collection collection)
Coerce an iterator instance to a boolean value. |
static boolean
|
asBoolean(Map map)
Coerce an enumeration instance to a boolean value. |
static boolean
|
asBoolean(Iterator iterator)
Coerce an Object array to a boolean value. |
static boolean
|
asBoolean(Enumeration enumeration)
Coerces a byte array to a boolean value. |
static boolean
|
asBoolean(Object[] array)
Coerces a short array to a boolean value. |
static boolean
|
asBoolean(byte[] array)
Coerces an int array to a boolean value. |
static boolean
|
asBoolean(short[] array)
Coerces a long array to a boolean value. |
static boolean
|
asBoolean(int[] array)
Coerces a float array to a boolean value. |
static boolean
|
asBoolean(long[] array)
Coerces a double array to a boolean value. |
static boolean
|
asBoolean(float[] array)
Coerces a boolean array to a boolean value. |
static boolean
|
asBoolean(double[] array)
Coerces a char array to a boolean value. |
static boolean
|
asBoolean(boolean[] array)
Coerce a character to a boolean value. |
static boolean
|
asBoolean(char[] array)
Coerce a number to a boolean value. |
static boolean
|
asBoolean(Character character)
|
static boolean
|
asBoolean(Number number)
|
static boolean
|
asBoolean(CharSequence string)
|
static boolean
|
asBoolean(Matcher matcher)
|
static Map
|
asImmutable(Map self)
A convenience method for creating an immutable sorted map. |
static SortedMap
|
asImmutable(SortedMap self)
|
static List
|
asImmutable(List self)
|
static Set
|
asImmutable(Set self)
|
static SortedSet
|
asImmutable(SortedSet self)
|
static Collection
|
asImmutable(Collection self)
A convenience method for creating a synchronized SortedMap. |
static List
|
asList(Collection self)
Coerce an object instance to a boolean value. |
static Map
|
asSynchronized(Map self)
|
static SortedMap
|
asSynchronized(SortedMap self)
|
static Collection
|
asSynchronized(Collection self)
|
static List
|
asSynchronized(List self)
|
static Set
|
asSynchronized(Set self)
|
static SortedSet
|
asSynchronized(SortedSet self)
|
static Object
|
asType(Collection col, Class clazz)
|
static Object
|
asType(Object[] ary, Class clazz)
Converts the given array to either a List, Set, or SortedSet. |
static Object
|
asType(Closure cl, Class clazz)
Coerces this map to the given type, using the map's keys as the public method names, and values as the implementation. |
static Object
|
asType(Map map, Class clazz)
|
static Object
|
asType(Number self, Class c)
Traverse through each byte of this Byte array. |
static Object
|
asType(Object obj, Class type)
Adds a "metaClass" property to all class objects so you can use the syntax
|
static Object
|
asType(CharSequence self, Class c)
|
static Object
|
asType(GString self, Class c)
|
static Object
|
asType(String self, Class c)
|
static Object
|
asType(File f, Class c)
|
static File
|
asWritable(File file)
|
static File
|
asWritable(File file, String encoding)
|
static BitSet
|
bitwiseNegate(BitSet self)
Iterates from this number up to the given number, inclusive, incrementing by one each time. |
static Pattern
|
bitwiseNegate(CharSequence self)
|
static Pattern
|
bitwiseNegate(String self)
|
protected static Object
|
callClosureForLine(Closure closure, String line, int counter)
|
protected static Object
|
callClosureForMapEntry(Closure closure, Map.Entry entry)
|
protected static Object
|
callClosureForMapEntryAndCounter(Closure closure, Map.Entry entry, int counter)
|
static CharSequence
|
capitalize(CharSequence self)
|
static String
|
capitalize(String self)
|
static CharSequence
|
center(CharSequence self, Number numberOfChars)
|
static CharSequence
|
center(CharSequence self, Number numberOfChars, CharSequence padding)
|
static String
|
center(String self, Number numberOfChars)
|
static String
|
center(String self, Number numberOfChars, String padding)
|
static List
|
collate(List self, int size)
|
static List
|
collate(List self, int size, int step)
|
static List
|
collate(List self, int size, boolean keepRemainder)
|
static List
|
collate(List self, int size, int step, boolean keepRemainder)
|
static List
|
collect(Object self, Closure transform)
Iterates through this aggregate Object transforming each item into a new value using the
|
static Collection
|
collect(Object self)
Iterates through this aggregate Object transforming each item into a new value using the |
static Collection
|
collect(Object self, Collection collector, Closure transform)
|
static List
|
collect(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 List
|
collect(Collection self)
Iterates through this collection transforming each value into a new value using the |
static Collection
|
collect(Collection self, Collection collector, Closure transform)
|
static Collection
|
collect(Map self, Collection collector, Closure transform)
|
static List
|
collect(Map self, Closure transform)
|
static List
|
collectAll(Collection self, Closure transform)
|
static Collection
|
collectAll(Collection self, Collection collector, Closure transform)
|
static Map
|
collectEntries(Map self, Map collector, Closure transform)
|
static Map
|
collectEntries(Map self, Closure transform)
|
static Map
|
collectEntries(Collection self, Closure transform)
A variant of collectEntries for Iterators. |
static Map
|
collectEntries(Iterator self, Closure transform)
A variant of collectEntries for Iterables. |
static Map
|
collectEntries(Iterable self, Closure transform)
|
static Map
|
collectEntries(Collection self)
A variant of collectEntries for Iterators using the identity closure as the transform. |
static Map
|
collectEntries(Iterator self)
A variant of collectEntries for Iterables using the identity closure as the transform. |
static Map
|
collectEntries(Iterable self)
|
static Map
|
collectEntries(Collection self, Map collector, Closure transform)
|
static Map
|
collectEntries(Iterator self, Map collector, Closure transform)
|
static Map
|
collectEntries(Iterable self, Map collector, Closure transform)
A variant of collectEntries for Collections using the identity closure as the transform and a supplied map as the destination of transformed entries. |
static Map
|
collectEntries(Collection self, Map collector)
A variant of collectEntries for Iterators using the identity closure as the transform and a supplied map as the destination of transformed entries. |
static Map
|
collectEntries(Iterator self, 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 Map
|
collectEntries(Iterable self, Map collector)
|
static Map
|
collectEntries(Object[] self, Map collector, Closure transform)
A variant of collectEntries using the identity closure as the transform. |
static Map
|
collectEntries(Object[] self, Map collector)
|
static Map
|
collectEntries(Object[] self, Closure transform)
A variant of collectEntries using the identity closure as the transform. |
static Map
|
collectEntries(Object[] self)
|
static List
|
collectMany(Collection self, Closure projection)
Projects each item from a source collection to a collection and concatenates (flattens) the resulting collections into a single list. |
static Collection
|
collectMany(Collection self, Collection collector, Closure projection)
|
static Collection
|
collectMany(Map self, Collection collector, Closure projection)
|
static Collection
|
collectMany(Map self, Closure projection)
|
static List
|
collectMany(Object[] self, Closure projection)
|
static List
|
collectMany(Iterator self, Closure projection)
|
static List
|
collectNested(Collection self, Closure transform)
Deprecated alias for collectNested |
static Collection
|
collectNested(Collection self, Collection collector, Closure transform)
|
static List
|
combinations(Collection self)
Finds all non-null subsequences of a list. |
static int
|
compareTo(Character left, Number right)
|
static int
|
compareTo(Number left, Character right)
|
static int
|
compareTo(Character left, Character right)
|
static int
|
compareTo(Number left, Number right)
|
static boolean
|
contains(int[] self, Object value)
Checks whether the array contains the given value. |
static boolean
|
contains(long[] self, Object value)
Checks whether the array contains the given value. |
static boolean
|
contains(short[] self, Object value)
Returns the string representation of the given array. |
static boolean
|
contains(char[] self, Object value)
Returns the string representation of the given array. |
static boolean
|
contains(boolean[] self, Object value)
Returns the string representation of the given array. |
static boolean
|
contains(double[] self, Object value)
Returns the string representation of the given array. |
static boolean
|
contains(float[] self, Object value)
|
static boolean
|
contains(byte[] self, Object value)
Returns the string representation of the given array. |
static boolean
|
contains(Object[] self, Object value)
Returns the string representation of the given map. |
static boolean
|
contains(CharSequence self, CharSequence text)
|
static boolean
|
contains(String self, String text)
|
static boolean
|
containsAll(Collection self, Object[] items)
Modifies this collection by removing its elements that are contained within the specified object array. |
static Number
|
count(Iterator self, Object value)
|
static Number
|
count(Iterator self, Closure closure)
Counts the number of occurrences which satisfy the given closure from the items within this Iterator. |
static Number
|
count(Collection self, Object value)
Counts the number of occurrences of the given value inside this collection. |
static Number
|
count(Collection self, Closure closure)
|
static Number
|
count(Map self, Closure closure)
|
static Number
|
count(Object[] self, Object value)
Counts the number of occurrences of the given value inside this array. |
static Number
|
count(Object[] self, Closure closure)
Counts the number of occurrences of the given value inside this array. |
static Number
|
count(int[] self, Object value)
Counts the number of occurrences of the given value inside this array. |
static Number
|
count(long[] self, Object value)
Counts the number of occurrences of the given value inside this array. |
static Number
|
count(short[] self, Object value)
Counts the number of occurrences of the given value inside this array. |
static Number
|
count(char[] self, Object value)
Counts the number of occurrences of the given value inside this array. |
static Number
|
count(boolean[] self, Object value)
Counts the number of occurrences of the given value inside this array. |
static Number
|
count(double[] self, Object value)
Counts the number of occurrences of the given value inside this array. |
static Number
|
count(float[] self, Object value)
Counts the number of occurrences of the given value inside this array. |
static Number
|
count(byte[] self, Object value)
|
static int
|
count(CharSequence self, CharSequence text)
|
static int
|
count(String self, String text)
|
static Map
|
countBy(Collection self, Closure closure)
Sorts all array members into groups determined by the supplied mapping closure and counts the group size. |
static Map
|
countBy(Object[] self, Closure closure)
Sorts all iterator items into groups determined by the supplied mapping closure and counts the group size. |
static Map
|
countBy(Iterator self, Closure closure)
|
static Map
|
countBy(Map self, Closure closure)
Groups the current element according to the value |
protected static StringBufferWriter
|
createStringBufferWriter(StringBuffer self)
|
protected static StringWriter
|
createStringWriter(String self)
|
static boolean
|
deleteDir(File self)
|
static CharSequence
|
denormalize(CharSequence self)
|
static String
|
denormalize(String self)
|
static boolean
|
disjoint(Collection left, Collection right)
Compare the contents of this array to the contents of the given array. |
static Number
|
div(Character left, Number right)
Bitwise AND together two Numbers. |
static Number
|
div(Number left, Character right)
Bitwise AND together two BitSets. |
static Number
|
div(Character left, Character right)
Bitwise XOR together two BitSets. |
static void
|
downto(Number self, Number to, Closure closure)
Iterates from this number down to the given number, inclusive, decrementing by one each time. |
static void
|
downto(long self, Number to, Closure closure)
|
static void
|
downto(Long self, Number to, Closure closure)
|
static void
|
downto(float self, Number to, Closure closure)
|
static void
|
downto(Float self, Number to, Closure closure)
|
static void
|
downto(double self, Number to, Closure closure)
|
static void
|
downto(Double self, Number to, Closure closure)
Iterates from this number up to the given number using a step increment. |
static void
|
downto(BigInteger self, Number to, Closure closure)
|
static void
|
downto(BigDecimal self, Number to, Closure closure)
Get the absolute value |
static List
|
drop(List self, int num)
|
static List
|
drop(Iterable self, int num)
Drops the given number of elements from the head of this array if they are available. |
static Object[]
|
drop(Object[] self, int num)
|
static Map
|
drop(Map self, int num)
|
static Iterator
|
drop(Iterator self, int num)
Returns the longest prefix of this list where each element passed to the given closure condition evaluates to true. |
static CharSequence
|
drop(CharSequence self, int num)
|
static List
|
dropWhile(List self, Closure condition)
|
static List
|
dropWhile(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 Map
|
dropWhile(Map self, Closure condition)
|
static Object[]
|
dropWhile(Object[] self, Closure condition)
|
static Iterator
|
dropWhile(Iterator self, Closure condition)
|
static String
|
dump(Object self)
|
static Object
|
each(Object self, Closure closure)
Iterates through an aggregate type or data structure, passing each item to the given closure. |
static Map
|
each(Map self, Closure closure)
|
static void
|
eachByte(Byte[] self, Closure closure)
|
static void
|
eachByte(byte[] self, Closure closure)
|
static void
|
eachByte(File self, Closure closure)
|
static void
|
eachByte(File self, int bufferLen, Closure closure)
|
static void
|
eachByte(InputStream is, Closure closure)
|
static void
|
eachByte(InputStream is, int bufferLen, Closure closure)
|
static void
|
eachByte(URL url, Closure closure)
|
static void
|
eachByte(URL url, int bufferLen, Closure closure)
|
static void
|
eachDir(File self, Closure closure)
|
static void
|
eachDirMatch(File self, Object nameFilter, Closure closure)
|
static void
|
eachDirRecurse(File self, Closure closure)
|
static void
|
eachFile(File self, FileType fileType, Closure closure)
|
static void
|
eachFile(File self, Closure closure)
|
static void
|
eachFileMatch(File self, FileType fileType, Object nameFilter, Closure closure)
|
static void
|
eachFileMatch(File self, Object nameFilter, Closure closure)
|
static void
|
eachFileRecurse(File self, FileType fileType, Closure closure)
|
static void
|
eachFileRecurse(File self, Closure closure)
|
static Object
|
eachLine(CharSequence self, Closure closure)
|
static Object
|
eachLine(CharSequence self, int firstLine, Closure closure)
|
static Object
|
eachLine(String self, Closure closure)
|
static Object
|
eachLine(String self, int firstLine, Closure closure)
|
static Object
|
eachLine(File self, Closure closure)
|
static Object
|
eachLine(File self, String charset, Closure closure)
|
static Object
|
eachLine(File self, int firstLine, Closure closure)
|
static Object
|
eachLine(File self, String charset, int firstLine, Closure closure)
|
static Object
|
eachLine(InputStream stream, String charset, Closure closure)
|
static Object
|
eachLine(InputStream stream, String charset, int firstLine, Closure closure)
|
static Object
|
eachLine(InputStream stream, Closure closure)
|
static Object
|
eachLine(InputStream stream, int firstLine, Closure closure)
|
static Object
|
eachLine(URL url, Closure closure)
|
static Object
|
eachLine(URL url, int firstLine, Closure closure)
|
static Object
|
eachLine(URL url, String charset, Closure closure)
|
static Object
|
eachLine(URL url, String charset, int firstLine, Closure closure)
|
static Object
|
eachLine(Reader self, Closure closure)
|
static Object
|
eachLine(Reader self, int firstLine, Closure closure)
|
static String
|
eachMatch(CharSequence self, CharSequence regex, Closure closure)
|
static String
|
eachMatch(CharSequence self, Pattern pattern, Closure closure)
|
static String
|
eachMatch(String self, Pattern pattern, Closure closure)
|
static String
|
eachMatch(String self, String regex, Closure closure)
|
static void
|
eachObject(File self, Closure closure)
|
static void
|
eachObject(ObjectInputStream ois, Closure closure)
|
static Iterator
|
eachPermutation(Collection self, Closure closure)
|
static Object
|
eachWithIndex(Object self, Closure closure)
|
static Map
|
eachWithIndex(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(Object[] left, List right)
|
static boolean
|
equals(List left, Object[] right)
|
static boolean
|
equals(List left, List right)
|
static boolean
|
equals(Set self, Set other)
|
static boolean
|
equals(Map self, Map other)
Create a Set composed of the elements of the first Set minus the elements of the given Collection. |
static boolean
|
every(Object self, Closure closure)
|
static boolean
|
every(Map self, Closure closure)
|
static boolean
|
every(Object self)
|
static Process
|
execute(String self)
|
static Process
|
execute(String self, String[] envp, File dir)
|
static Process
|
execute(String self, List envp, File dir)
|
static Process
|
execute(String[] commandArray)
|
static Process
|
execute(String[] commandArray, String[] envp, File dir)
|
static Process
|
execute(String[] commandArray, List envp, File dir)
|
static Process
|
execute(List commands)
|
static Process
|
execute(List commands, String[] envp, File dir)
|
static Process
|
execute(List commands, List envp, File dir)
|
static CharSequence
|
expand(CharSequence self)
|
static CharSequence
|
expand(CharSequence self, int tabStop)
|
static String
|
expand(String self)
|
static String
|
expand(String self, int tabStop)
|
static CharSequence
|
expandLine(CharSequence self, int tabStop)
|
static String
|
expandLine(String self, int tabStop)
|
static void
|
filterLine(Reader reader, Writer writer, Closure closure)
|
static Writable
|
filterLine(File self, Closure closure)
|
static Writable
|
filterLine(File self, String charset, Closure closure)
|
static void
|
filterLine(File self, Writer writer, Closure closure)
|
static void
|
filterLine(File self, Writer writer, String charset, Closure closure)
|
static Writable
|
filterLine(Reader reader, Closure closure)
|
static Writable
|
filterLine(InputStream self, Closure predicate)
|
static Writable
|
filterLine(InputStream self, String charset, Closure predicate)
|
static void
|
filterLine(InputStream self, Writer writer, Closure predicate)
|
static void
|
filterLine(InputStream self, Writer writer, String charset, Closure predicate)
|
static Writable
|
filterLine(URL self, Closure predicate)
|
static Writable
|
filterLine(URL self, String charset, Closure predicate)
|
static void
|
filterLine(URL self, Writer writer, Closure predicate)
|
static void
|
filterLine(URL self, Writer writer, String charset, Closure predicate)
|
static Object
|
find(Object self, Closure closure)
|
static Object
|
find(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 Object
|
find(Collection self, Closure closure)
|
static Object
|
find(Object[] self, Closure condition)
|
static Object
|
find(Collection self)
|
static Map.Entry
|
find(Map self, Closure closure)
|
static CharSequence
|
find(CharSequence self, CharSequence regex)
|
static CharSequence
|
find(CharSequence self, CharSequence regex, Closure closure)
|
static CharSequence
|
find(CharSequence self, Pattern pattern)
|
static CharSequence
|
find(CharSequence self, Pattern pattern, Closure closure)
|
static String
|
find(String self, Pattern pattern)
|
static String
|
find(String self, Pattern pattern, Closure closure)
|
static String
|
find(String self, String regex)
|
static String
|
find(String self, String regex, Closure closure)
|
static Collection
|
findAll(Collection self, Closure closure)
Finds all elements of the array matching the given Closure condition. |
static Collection
|
findAll(Object[] self, Closure condition)
|
static Collection
|
findAll(Collection self)
Finds the elements of the array matching the IDENTITY Closure (i.e. matching Groovy truth). |
static Collection
|
findAll(Object[] self)
Finds all items matching the closure condition. |
static Collection
|
findAll(Object self, Closure closure)
|
static Collection
|
findAll(Object self)
|
static Map
|
findAll(Map self, Closure closure)
|
static List
|
findAll(CharSequence self, CharSequence regex)
|
static List
|
findAll(CharSequence self, CharSequence regex, Closure closure)
|
static List
|
findAll(CharSequence self, Pattern pattern)
|
static List
|
findAll(CharSequence self, Pattern pattern, Closure closure)
|
static List
|
findAll(String self, Pattern pattern)
|
static List
|
findAll(String self, Pattern pattern, Closure closure)
|
static List
|
findAll(String self, String regex)
|
static List
|
findAll(String self, String regex, Closure closure)
|
static int
|
findIndexOf(Object self, Closure closure)
|
static int
|
findIndexOf(Object self, int startIndex, Closure closure)
|
static List
|
findIndexValues(Object self, Closure closure)
|
static List
|
findIndexValues(Object self, Number startIndex, Closure closure)
|
static int
|
findLastIndexOf(Object self, Closure closure)
Converts a given object to a type. |
static int
|
findLastIndexOf(Object self, int startIndex, Closure closure)
|
static Object
|
findResult(Object self, 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 Object
|
findResult(Object self, Closure closure)
|
static Object
|
findResult(Collection self, Object defaultResult, Closure closure)
|
static Object
|
findResult(Collection self, Closure closure)
|
static Object
|
findResult(Map self, Object defaultResult, Closure closure)
|
static Object
|
findResult(Map self, Closure closure)
|
static Collection
|
findResults(Collection self, Closure filteringTransform)
|
static Collection
|
findResults(Map self, Closure filteringTransform)
|
static Object
|
first(List self)
|
static Object
|
first(Iterable self)
Returns the first item from the array. |
static Object
|
first(Object[] self)
|
static Collection
|
flatten(Collection self)
Flatten an array. |
static Collection
|
flatten(Object[] self)
|
static Collection
|
flatten(boolean[] self)
|
static Collection
|
flatten(byte[] self)
|
static Collection
|
flatten(char[] self)
|
static Collection
|
flatten(short[] self)
|
static Collection
|
flatten(int[] self)
|
static Collection
|
flatten(long[] self)
|
static Collection
|
flatten(float[] self)
Flatten a collection. |
static Collection
|
flatten(double[] self)
|
static Collection
|
flatten(Collection self, Closure flattenUsing)
Overloads the left shift operator to provide an easy way to append objects to a Collection. |
static Object
|
get(Map map, Object key, Object defaultValue)
Support the range subscript operator for an Array |
static Object
|
getAt(Object self, String property)
Allows the subscript operator to be used to lookup dynamic property values. |
static List
|
getAt(List self, Range range)
Support the range subscript operator for a List. |
static List
|
getAt(List self, EmptyRange range)
Select a List of items from a List using a Collection to identify the indices to be selected. |
static List
|
getAt(List self, Collection indices)
Select a List of items from an Object array using a Collection to identify the indices to be selected. |
static List
|
getAt(Object[] self, Collection indices)
Creates a sub-Map containing the given keys. |
static List
|
getAt(Object[] array, Range range)
@param array an Array of Objects |
static List
|
getAt(Object[] array, IntRange range)
@param array an Array of Objects |
static List
|
getAt(Object[] array, EmptyRange range)
|
static List
|
getAt(Object[] array, ObjectRange range)
|
static Object
|
getAt(List self, int idx)
|
static Object
|
getAt(Iterator self, int idx)
|
static Object
|
getAt(Iterable self, int idx)
A helper method to allow lists to work with subscript operators. |
static Object
|
getAt(Map self, Object key)
Support the subscript operator for a Map. |
static List
|
getAt(Collection coll, String property)
A convenience method for creating an immutable map. |
static List
|
getAt(byte[] array, Range range)
Support the subscript operator with a range for an int array |
static List
|
getAt(char[] array, Range range)
|
static List
|
getAt(short[] array, Range range)
|
static List
|
getAt(int[] array, Range range)
|
static List
|
getAt(long[] array, Range range)
|
static List
|
getAt(float[] array, Range range)
|
static List
|
getAt(double[] array, Range range)
|
static List
|
getAt(boolean[] array, Range range)
|
static List
|
getAt(byte[] array, IntRange range)
|
static List
|
getAt(char[] array, IntRange range)
|
static List
|
getAt(short[] array, IntRange range)
|
static List
|
getAt(int[] array, IntRange range)
|
static List
|
getAt(long[] array, IntRange range)
|
static List
|
getAt(float[] array, IntRange range)
|
static List
|
getAt(double[] array, IntRange range)
|
static List
|
getAt(boolean[] array, IntRange range)
|
static List
|
getAt(byte[] array, ObjectRange range)
|
static List
|
getAt(char[] array, ObjectRange range)
|
static List
|
getAt(short[] array, ObjectRange range)
|
static List
|
getAt(int[] array, ObjectRange range)
|
static List
|
getAt(long[] array, ObjectRange range)
|
static List
|
getAt(float[] array, ObjectRange range)
|
static List
|
getAt(double[] array, ObjectRange range)
|
static List
|
getAt(boolean[] array, ObjectRange range)
|
static List
|
getAt(byte[] array, Collection indices)
|
static List
|
getAt(char[] array, Collection indices)
|
static List
|
getAt(short[] array, Collection indices)
|
static List
|
getAt(int[] array, Collection indices)
|
static List
|
getAt(long[] array, Collection indices)
|
static List
|
getAt(float[] array, Collection indices)
|
static List
|
getAt(double[] array, Collection indices)
|
static List
|
getAt(boolean[] array, Collection indices)
|
static boolean
|
getAt(BitSet self, int index)
|
static BitSet
|
getAt(BitSet self, IntRange range)
|
static CharSequence
|
getAt(CharSequence self, Collection indices)
|
static CharSequence
|
getAt(CharSequence text, EmptyRange range)
|
static CharSequence
|
getAt(CharSequence text, int index)
|
static CharSequence
|
getAt(CharSequence text, IntRange range)
|
static CharSequence
|
getAt(CharSequence text, Range range)
|
static List
|
getAt(Matcher self, Collection indices)
|
static Object
|
getAt(Matcher matcher, int idx)
|
static String
|
getAt(String self, Collection indices)
|
static String
|
getAt(String text, EmptyRange range)
|
static String
|
getAt(String text, int index)
|
static String
|
getAt(String text, IntRange range)
|
static String
|
getAt(String text, Range range)
|
static byte[]
|
getBytes(File file)
|
static byte[]
|
getBytes(URL url)
|
static byte[]
|
getBytes(InputStream is)
|
static char[]
|
getChars(CharSequence self)
|
static char[]
|
getChars(String self)
|
static int
|
getCount(Matcher matcher)
|
static MetaClass
|
getMetaClass(Class c)
|
static MetaClass
|
getMetaClass(Object obj)
|
static MetaClass
|
getMetaClass(GroovyObject obj)
Sets/updates the metaclass for a given object to a closure. |
static List
|
getMetaPropertyValues(Object self)
Retrieves the list of MetaProperty objects for 'self' and wraps it in a list of PropertyValue objects that additionally provide the value for each property of 'self'. |
static Map
|
getProperties(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 ClassLoader
|
getRootLoader(ClassLoader self)
Convenience method to dynamically create a new instance of this class. |
protected static List
|
getSubList(List self, List splice)
|
static String
|
getText(File file, String charset)
|
static String
|
getText(File file)
|
static String
|
getText(URL url)
|
static String
|
getText(URL url, Map parameters)
|
static String
|
getText(URL url, String charset)
|
static String
|
getText(URL url, Map parameters, String charset)
|
static String
|
getText(InputStream is)
|
static String
|
getText(InputStream is, String charset)
|
static String
|
getText(Reader reader)
|
static String
|
getText(BufferedReader reader)
|
static Collection
|
grep(Object self, Object filter)
|
static Collection
|
grep(Collection self, Object filter)
Iterates over the collection of items and returns each item that matches
the given filter - calling the |
static Collection
|
grep(Object[] self, Object filter)
|
static Collection
|
grep(Object self)
|
static Collection
|
grep(Collection self)
|
static Collection
|
grep(Object[] self)
|
protected static void
|
groupAnswer(Map answer, Object element, Object value)
|
static Map
|
groupBy(Collection self, Closure closure)
|
static Map
|
groupBy(Collection self, Object... closures)
|
static Map
|
groupBy(Collection self, List closures)
Sorts all collection members into (sub)groups determined by the supplied mapping closures. |
static Map
|
groupBy(Map self, Closure closure)
|
static Map
|
groupBy(Map self, Object... closures)
|
static Map
|
groupBy(Map self, List closures)
Groups the members of a map into sub maps determined by the supplied mapping closures. |
static Map
|
groupEntriesBy(Map self, Closure closure)
|
static boolean
|
hasGroup(Matcher matcher)
|
static MetaProperty
|
hasProperty(Object self, String name)
|
static Object
|
head(List self)
Returns the items from the List excluding the first item. |
static Object
|
head(Object[] self)
|
static Object
|
identity(Object self, Closure closure)
|
static Boolean
|
implies(Boolean left, Boolean right)
|
static Object
|
inject(Collection self, Closure closure)
|
static Object
|
inject(Collection self, Object initialValue, Closure closure)
|
static Object
|
inject(Map self, Object initialValue, Closure closure)
|
static Object
|
inject(Iterator self, Object initialValue, Closure closure)
|
static Object
|
inject(Object self, Closure closure)
Iterates through the given Object, passing in the initial value to the closure along with the first item. |
static Object
|
inject(Object self, 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 Object
|
inject(Object[] self, Closure closure)
|
static Object
|
inject(Object[] self, Object initialValue, Closure closure)
Sums the items in a collection. |
static String
|
inspect(Object self)
Inspects returns the String that matches what would be typed into a terminal to create this object. |
static Number
|
intdiv(Character left, Number right)
Bitwise NEGATE a BitSet. |
static Number
|
intdiv(Number left, Character right)
Bitwise OR together two BitSets. |
static Number
|
intdiv(Character left, Character right)
Bitwise XOR together two Numbers. |
static Number
|
intdiv(Number left, Number right)
|
static Collection
|
intersect(Collection left, Collection right)
|
static Map
|
intersect(Map left, Map right)
Returns |
static Object
|
invokeMethod(Object object, String method, Object arguments)
|
static boolean
|
is(Object self, Object other)
Identity check. |
static boolean
|
isAllWhitespace(CharSequence self)
|
static boolean
|
isAllWhitespace(String self)
|
static boolean
|
isBigDecimal(CharSequence self)
|
static boolean
|
isBigDecimal(String self)
|
static boolean
|
isBigInteger(CharSequence self)
|
static boolean
|
isBigInteger(String self)
|
static boolean
|
isCase(Object caseValue, Object switchValue)
|
static boolean
|
isCase(Class caseValue, Object switchValue)
|
static boolean
|
isCase(Collection caseValue, Object switchValue)
|
static boolean
|
isCase(Map caseValue, Object switchValue)
|
static boolean
|
isCase(Number caseValue, Number switchValue)
|
static boolean
|
isCase(CharSequence caseValue, Object switchValue)
|
static boolean
|
isCase(GString caseValue, Object switchValue)
|
static boolean
|
isCase(Pattern caseValue, Object switchValue)
|
static boolean
|
isCase(String caseValue, Object switchValue)
|
static boolean
|
isDigit(Character self)
|
static boolean
|
isDouble(CharSequence self)
|
static boolean
|
isDouble(String self)
|
static boolean
|
isFloat(CharSequence self)
|
static boolean
|
isFloat(String self)
|
static boolean
|
isInteger(CharSequence self)
|
static boolean
|
isInteger(String self)
|
static boolean
|
isLetter(Character self)
Transform a Number into a Double |
static boolean
|
isLetterOrDigit(Character self)
Transform a Number into a BigDecimal |
static boolean
|
isLong(CharSequence self)
|
static boolean
|
isLong(String self)
|
static boolean
|
isLowerCase(Character self)
Transform a Number into a Float |
static boolean
|
isNumber(CharSequence self)
|
static boolean
|
isNumber(String self)
|
static boolean
|
isUpperCase(Character self)
|
static boolean
|
isWhitespace(Character self)
|
static Iterator
|
iterator(Object[] a)
|
static Iterator
|
iterator(Object o)
|
static Iterator
|
iterator(Enumeration enumeration)
|
static Iterator
|
iterator(Iterator self)
|
static Iterator
|
iterator(Matcher matcher)
|
static Iterator
|
iterator(Reader self)
|
static Iterator
|
iterator(InputStream self)
|
static Iterator
|
iterator(DataInputStream self)
|
static String
|
join(Iterator self, String separator)
Concatenates the |
static String
|
join(Collection self, String separator)
|
static String
|
join(Object[] self, String separator)
|
static Object
|
last(List self)
|
static Object
|
last(Iterable self)
Returns the last item from the array. |
static Object
|
last(Object[] self)
Returns the first item from the List. |
static Collection
|
leftShift(Collection self, Object value)
Overloads the left shift operator to provide an easy way to append Map.Entry values to a Map. |
static BlockingQueue
|
leftShift(BlockingQueue self, Object value)
|
static Map
|
leftShift(Map self, Map.Entry entry)
|
static Map
|
leftShift(Map self, Map other)
Implementation of the right shift (unsigned) operator for integral types. |
static Number
|
leftShift(Number self, Number operand)
Support the subscript operator with a range for a byte array |
static StringBuilder
|
leftShift(CharSequence self, Object value)
|
static StringBuffer
|
leftShift(String self, Object value)
|
static StringBuffer
|
leftShift(StringBuffer self, Object value)
|
static StringBuilder
|
leftShift(StringBuilder self, Object value)
|
static Writer
|
leftShift(Socket self, Object value)
|
static OutputStream
|
leftShift(Socket self, byte[] value)
|
static Writer
|
leftShift(Writer self, Object value)
|
static Writer
|
leftShift(OutputStream self, Object value)
|
static void
|
leftShift(ObjectOutputStream self, Object value)
|
static OutputStream
|
leftShift(OutputStream self, InputStream in)
|
static OutputStream
|
leftShift(OutputStream self, byte[] value)
|
static File
|
leftShift(File file, Object text)
|
static File
|
leftShift(File file, byte[] bytes)
|
static File
|
leftShift(File file, InputStream data)
|
static boolean
|
matches(CharSequence self, Pattern pattern)
|
static boolean
|
matches(String self, Pattern pattern)
|
static Map.Entry
|
max(Map self, Closure closure)
|
static Object
|
max(Collection self)
|
static Object
|
max(Iterator self)
|
static Object
|
max(Object[] self)
|
static Object
|
max(Collection self, Closure closure)
|
static Object
|
max(Iterator self, Closure closure)
Selects the maximum value found from the Object array using the closure to determine the correct ordering. |
static Object
|
max(Object[] self, Closure closure)
Selects the maximum value found in the collection using the given comparator. |
static Object
|
max(Collection self, Comparator comparator)
|
static Object
|
max(Iterator self, Comparator comparator)
Provide the standard Groovy |
static Object
|
max(Object[] self, Comparator comparator)
|
static MetaClass
|
metaClass(Class self, Closure closure)
Allows an Enumeration to behave like an Iterator. |
static MetaClass
|
metaClass(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 Object
|
min(Collection self)
Adds min() method to Iterator objects. |
static Object
|
min(Iterator self)
|
static Object
|
min(Object[] self)
|
static Object
|
min(Collection self, Comparator comparator)
|
static Object
|
min(Iterator self, Comparator comparator)
|
static Object
|
min(Object[] self, Comparator comparator)
|
static Object
|
min(Collection self, Closure closure)
|
static Map.Entry
|
min(Map self, Closure closure)
|
static Object
|
min(Iterator self, Closure closure)
Selects the minimum value found from the Object array using the closure to determine the correct ordering. |
static Object
|
min(Object[] self, Closure closure)
Adds max() method to Collection objects. |
static Set
|
minus(Set self, Collection removeMe)
Create a Set composed of the elements of the first Set minus the elements from the given Iterable. |
static Set
|
minus(Set self, Iterable removeMe)
Create an array composed of the elements of the first array minus the elements of the given Iterable. |
static Set
|
minus(Set self, Object removeMe)
Create an array composed of the elements of the first array minus the elements of the given array. |
static Object[]
|
minus(Object[] self, Iterable removeMe)
Create a List composed of the elements of the first list minus every occurrence of elements of the given Collection. |
static Object[]
|
minus(Object[] self, Object[] removeMe)
|
static List
|
minus(List self, Collection removeMe)
|
static List
|
minus(List self, Iterable removeMe)
Create a List composed of the elements of the first list minus every occurrence of elements of the given Iterable. |
static List
|
minus(List self, Object removeMe)
|
static Object[]
|
minus(Object[] self, Object removeMe)
Flatten a collection. |
static Map
|
minus(Map self, Map removeMe)
Flatten an array. |
static Number
|
minus(Character left, Number right)
|
static Number
|
minus(Number left, Character right)
Power of a Number to a certain exponent. |
static Number
|
minus(Character left, Character right)
|
static CharSequence
|
minus(CharSequence self, Object target)
|
static String
|
minus(String self, Object target)
|
static void
|
mixin(MetaClass self, List categoryClasses)
|
static void
|
mixin(Class self, List categoryClasses)
|
static void
|
mixin(Class self, Class categoryClass)
|
static void
|
mixin(Class self, Class[] categoryClass)
|
static void
|
mixin(MetaClass self, Class categoryClass)
|
static void
|
mixin(MetaClass self, Class[] categoryClass)
|
static Number
|
mod(Number left, Number right)
|
static List
|
multiply(Collection self, Number factor)
|
static Number
|
multiply(Character left, Number right)
|
static Number
|
multiply(Number left, Character right)
|
static Number
|
multiply(Character left, Character right)
Power of an integer to an integer certain exponent. |
static Number
|
multiply(BigDecimal left, Double right)
|
static Number
|
multiply(BigDecimal left, BigInteger right)
|
static CharSequence
|
multiply(CharSequence self, Number factor)
|
static String
|
multiply(String self, Number factor)
|
static DataInputStream
|
newDataInputStream(File file)
|
static DataOutputStream
|
newDataOutputStream(File file)
|
static BufferedInputStream
|
newInputStream(File file)
|
static BufferedInputStream
|
newInputStream(URL url)
|
static BufferedInputStream
|
newInputStream(URL url, Map parameters)
|
static Object
|
newInstance(Class c)
Sets the metaclass for a given class. |
static Object
|
newInstance(Class c, Object[] args)
Sets/updates the metaclass for a given class to a closure. |
static ObjectInputStream
|
newObjectInputStream(File file)
|
static ObjectInputStream
|
newObjectInputStream(InputStream inputStream)
|
static ObjectInputStream
|
newObjectInputStream(InputStream inputStream, ClassLoader classLoader)
|
static ObjectInputStream
|
newObjectInputStream(File file, ClassLoader classLoader)
|
static ObjectOutputStream
|
newObjectOutputStream(File file)
|
static ObjectOutputStream
|
newObjectOutputStream(OutputStream outputStream)
|
static BufferedOutputStream
|
newOutputStream(File file)
|
static PrintWriter
|
newPrintWriter(File file)
|
static PrintWriter
|
newPrintWriter(File file, String charset)
|
static PrintWriter
|
newPrintWriter(Writer writer)
|
static BufferedReader
|
newReader(File file)
|
static BufferedReader
|
newReader(File file, String charset)
|
static BufferedReader
|
newReader(InputStream self)
|
static BufferedReader
|
newReader(InputStream self, String charset)
|
static BufferedReader
|
newReader(URL url)
|
static BufferedReader
|
newReader(URL url, Map parameters)
|
static BufferedReader
|
newReader(URL url, String charset)
|
static BufferedReader
|
newReader(URL url, Map parameters, String charset)
|
static BufferedWriter
|
newWriter(File file)
|
static BufferedWriter
|
newWriter(File file, boolean append)
|
static BufferedWriter
|
newWriter(File file, String charset, boolean append)
|
static BufferedWriter
|
newWriter(File file, String charset)
|
static Character
|
next(Character self)
Compare a Number and a Character. |
static Number
|
next(Number self)
|
static CharSequence
|
next(CharSequence self)
|
static String
|
next(String self)
|
static CharSequence
|
normalize(CharSequence self)
|
static String
|
normalize(String self)
|
static int
|
numberAwareCompareTo(Comparable self, Comparable other)
Provides a method that compares two comparables using Groovy's default number aware comparator. |
static Number
|
or(Number left, Number right)
|
static BitSet
|
or(BitSet left, BitSet right)
|
static Boolean
|
or(Boolean left, 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 CharSequence
|
padLeft(CharSequence self, Number numberOfChars)
|
static CharSequence
|
padLeft(CharSequence self, Number numberOfChars, CharSequence padding)
|
static String
|
padLeft(String self, Number numberOfChars)
|
static String
|
padLeft(String self, Number numberOfChars, String padding)
|
static CharSequence
|
padRight(CharSequence self, Number numberOfChars)
|
static CharSequence
|
padRight(CharSequence self, Number numberOfChars, CharSequence padding)
|
static String
|
padRight(String self, Number numberOfChars)
|
static String
|
padRight(String self, Number numberOfChars, String padding)
|
static Set
|
permutations(List self)
|
static Map
|
plus(Map left, Map right)
A helper method to allow maps to work with subscript operators |
static Map
|
plus(Map self, Collection entries)
|
static Object[]
|
plus(Object[] left, Object[] right)
|
static Object[]
|
plus(Object[] left, Object right)
|
static Object[]
|
plus(Object[] left, Collection right)
|
static Object[]
|
plus(Object[] left, Iterable right)
|
static Collection
|
plus(Collection left, Collection right)
|
static Collection
|
plus(Collection left, Iterable right)
|
static List
|
plus(List self, int index, 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 List
|
plus(List self, int index, 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 List
|
plus(List self, int index, Iterable additions)
|
static Collection
|
plus(Collection left, Object right)
|
static Number
|
plus(Character left, Number right)
|
static Number
|
plus(Number left, Character right)
|
static Number
|
plus(Character left, Character right)
|
static CharSequence
|
plus(CharSequence left, Object value)
|
static String
|
plus(Number value, String right)
|
static String
|
plus(String left, Object value)
|
static String
|
plus(StringBuffer left, String value)
|
static Object
|
pop(List self)
|
static Number
|
power(Number self, Number exponent)
|
static Number
|
power(BigDecimal self, Integer exponent)
Divide one Character by another. |
static Number
|
power(BigInteger self, Integer exponent)
Integer Divide a Character by a Number. |
static Number
|
power(Integer self, Integer exponent)
Integer Divide a Number by a Character. |
static Number
|
power(Long self, Integer exponent)
Integer Divide two Numbers. |
static Character
|
previous(Character self)
|
static Number
|
previous(Number self)
@todo maybe a double dispatch thing to handle new large numbers? |
static CharSequence
|
previous(CharSequence self)
|
static String
|
previous(String self)
|
protected static Object
|
primitiveArrayGet(Object self, int idx)
|
protected static List
|
primitiveArrayGet(Object self, Range range)
|
protected static List
|
primitiveArrayGet(Object self, Collection indices)
Checks whether the array contains the given value. |
protected static Object
|
primitiveArrayPut(Object self, int idx, Object newValue)
Checks whether the array contains the given value. |
static void
|
print(Object self, Object value)
Print a value formatted Groovy style to self if it is a Writer, otherwise to the standard output stream. |
static void
|
print(PrintWriter self, Object value)
Print a value formatted Groovy style to the print writer. |
static void
|
print(PrintStream self, Object value)
|
static void
|
print(Closure self, Object value)
|
static void
|
print(Object self, PrintWriter out)
|
static void
|
printf(Object self, String format, Object[] values)
|
static void
|
printf(Object self, String format, Object arg)
|
static void
|
println(Object self)
|
static void
|
println(Closure self)
Print a linebreak to the standard output stream. |
static void
|
println(Object self, Object value)
Print a value formatted Groovy style (followed by a newline) to self if it is a Writer, otherwise to the standard output stream. |
static void
|
println(PrintWriter self, Object value)
Print a value formatted Groovy style (followed by a newline) to the print writer. |
static void
|
println(PrintStream self, Object value)
|
static void
|
println(Closure self, Object value)
|
static void
|
println(Object self, PrintWriter out)
|
static boolean
|
push(List self, Object value)
|
static Map
|
putAll(Map self, Collection entries)
|
static void
|
putAt(Object self, String property, Object newValue)
|
static void
|
putAt(List self, int idx, Object value)
A helper method to allow lists to work with subscript operators. |
static void
|
putAt(List self, EmptyRange range, Object value)
A helper method to allow lists to work with subscript operators. |
static void
|
putAt(List self, EmptyRange range, Collection value)
|
static void
|
putAt(List self, IntRange range, Collection col)
List subscript assignment operator when given a range as the index. |
static void
|
putAt(List self, IntRange range, Object value)
|
static void
|
putAt(List self, List splice, List values)
|
static void
|
putAt(List self, List splice, Object value)
|
static Object
|
putAt(Map self, Object key, Object value)
|
static void
|
putAt(BitSet self, IntRange range, boolean value)
Support assigning a range of values with a single assignment statement. |
static void
|
putAt(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(StringBuffer self, EmptyRange range, Object value)
|
static void
|
putAt(StringBuffer self, IntRange range, Object value)
|
static byte[]
|
readBytes(File file)
|
static String
|
readLine(Reader self)
|
static List
|
readLines(CharSequence self)
|
static List
|
readLines(String self)
|
static List
|
readLines(File file)
|
static List
|
readLines(File file, String charset)
|
static List
|
readLines(InputStream stream)
|
static List
|
readLines(InputStream stream, String charset)
|
static List
|
readLines(URL self)
|
static List
|
readLines(URL self, String charset)
|
static List
|
readLines(Reader reader)
|
static boolean
|
removeAll(Collection self, Object[] items)
|
static boolean
|
removeAll(Collection self, Closure condition)
|
static boolean
|
renameTo(File self, String newPathName)
|
static CharSequence
|
replaceAll(CharSequence self, CharSequence regex, CharSequence replacement)
|
static CharSequence
|
replaceAll(CharSequence self, CharSequence regex, Closure closure)
|
static CharSequence
|
replaceAll(CharSequence self, Pattern pattern, CharSequence replacement)
|
static String
|
replaceAll(CharSequence self, Pattern pattern, Closure closure)
|
static String
|
replaceAll(String self, Pattern pattern, Closure closure)
|
static String
|
replaceAll(String self, Pattern pattern, String replacement)
|
static String
|
replaceAll(String self, String regex, Closure closure)
|
static String
|
replaceFirst(CharSequence self, CharSequence regex, CharSequence replacement)
|
static String
|
replaceFirst(CharSequence self, CharSequence regex, Closure closure)
|
static CharSequence
|
replaceFirst(CharSequence self, Pattern pattern, CharSequence replacement)
|
static String
|
replaceFirst(CharSequence self, Pattern pattern, Closure closure)
|
static String
|
replaceFirst(String self, Pattern pattern, Closure closure)
|
static String
|
replaceFirst(String self, Pattern pattern, String replacement)
|
static String
|
replaceFirst(String self, String regex, Closure closure)
|
static List
|
respondsTo(Object self, String name, Object[] argTypes)
|
static List
|
respondsTo(Object self, String name)
|
static boolean
|
retainAll(Collection self, Object[] items)
|
static boolean
|
retainAll(Collection self, Closure condition)
|
static List
|
reverse(List self)
Reverses the elements in a list. |
static List
|
reverse(List self, boolean mutate)
Creates a new array containing items which are the same as this array but in reverse order. |
static Object[]
|
reverse(Object[] self)
|
static Object[]
|
reverse(Object[] self, boolean mutate)
|
static Iterator
|
reverse(Iterator self)
|
static CharSequence
|
reverse(CharSequence self)
|
static String
|
reverse(String self)
|
static Map
|
reverseEach(Map self, Closure closure)
|
static List
|
reverseEach(List self, Closure closure)
|
static Object[]
|
reverseEach(Object[] self, Closure closure)
|
static Number
|
rightShift(Number self, Number operand)
Support the subscript operator with a range for a char array |
static Number
|
rightShiftUnsigned(Number self, Number operand)
Support the subscript operator with a range for a short array |
static int
|
round(Float number)
|
static float
|
round(Float number, int precision)
|
static long
|
round(Double number)
|
static double
|
round(Double number, int precision)
Converts the character to uppercase. |
static TimerTask
|
runAfter(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(File file, byte[] bytes)
|
static void
|
setBytes(OutputStream os, byte[] bytes)
|
static void
|
setIndex(Matcher matcher, int idx)
|
static void
|
setMetaClass(Class self, MetaClass metaClass)
|
static void
|
setMetaClass(Object self, MetaClass metaClass)
|
static void
|
setMetaClass(GroovyObject self, MetaClass metaClass)
|
static void
|
setText(File file, String text)
|
static void
|
setText(File file, String text, String charset)
|
static int
|
size(Iterator self)
|
static int
|
size(Object[] self)
|
static int
|
size(boolean[] array)
|
static int
|
size(byte[] array)
|
static int
|
size(char[] array)
Converts this array to a List of the same size, with each element added to the list. |
static int
|
size(short[] array)
Converts this array to a List of the same size, with each element added to the list. |
static int
|
size(int[] array)
|
static int
|
size(long[] array)
|
static int
|
size(float[] array)
|
static int
|
size(double[] array)
|
static int
|
size(CharSequence text)
|
static long
|
size(Matcher self)
|
static int
|
size(String text)
|
static int
|
size(StringBuffer buffer)
|
static long
|
size(File self)
|
static List
|
sort(Collection self)
|
static List
|
sort(Collection self, boolean mutate)
Sorts the elements from the given map into a new ordered map using the closure as a comparator to determine the ordering. |
static Map
|
sort(Map self, Closure closure)
|
static Map
|
sort(Map self, Comparator comparator)
|
static Map
|
sort(Map self)
|
static Object[]
|
sort(Object[] self)
|
static Object[]
|
sort(Object[] self, boolean mutate)
Sorts the given iterator items into a sorted iterator. |
static Iterator
|
sort(Iterator self)
|
static Iterator
|
sort(Iterator self, Comparator comparator)
|
static List
|
sort(Collection self, Comparator comparator)
|
static List
|
sort(Collection self, boolean mutate, Comparator comparator)
Sorts the given array into sorted order using the given comparator. |
static Object[]
|
sort(Object[] self, Comparator comparator)
|
static Object[]
|
sort(Object[] self, boolean mutate, Comparator comparator)
Sorts the given iterator items into a sorted iterator using the Closure to determine the correct ordering. |
static Iterator
|
sort(Iterator self, Closure closure)
|
static Object[]
|
sort(Object[] self, Closure closure)
|
static Object[]
|
sort(Object[] self, boolean mutate, Closure closure)
|
static List
|
sort(Collection self, Closure closure)
|
static List
|
sort(Collection self, boolean mutate, Closure closure)
Avoids doing unnecessary work when sorting an already sorted set (i.e. an identity function for an already sorted set). |
static SortedSet
|
sort(SortedSet self)
Removes the last item from the List. |
static SortedMap
|
sort(SortedMap self)
|
static Collection
|
split(Object self, Closure closure)
|
static Collection
|
split(Collection self, Closure closure)
|
static CharSequence[]
|
split(CharSequence self)
|
static String[]
|
split(GString self)
|
static String[]
|
split(String self)
|
static Object
|
splitEachLine(CharSequence self, CharSequence regex, Closure closure)
|
static Object
|
splitEachLine(CharSequence self, Pattern pattern, Closure closure)
|
static Object
|
splitEachLine(String self, Pattern pattern, Closure closure)
|
static Object
|
splitEachLine(String self, String regex, Closure closure)
|
static Object
|
splitEachLine(File self, String regex, Closure closure)
|
static Object
|
splitEachLine(File self, Pattern pattern, Closure closure)
|
static Object
|
splitEachLine(File self, String regex, String charset, Closure closure)
|
static Object
|
splitEachLine(File self, Pattern pattern, String charset, Closure closure)
|
static Object
|
splitEachLine(URL self, String regex, Closure closure)
|
static Object
|
splitEachLine(URL self, Pattern pattern, Closure closure)
|
static Object
|
splitEachLine(URL self, String regex, String charset, Closure closure)
|
static Object
|
splitEachLine(URL self, Pattern pattern, String charset, Closure closure)
|
static Object
|
splitEachLine(Reader self, String regex, Closure closure)
|
static Object
|
splitEachLine(Reader self, Pattern pattern, Closure closure)
|
static Object
|
splitEachLine(InputStream stream, String regex, String charset, Closure closure)
|
static Object
|
splitEachLine(InputStream stream, Pattern pattern, String charset, Closure closure)
|
static Object
|
splitEachLine(InputStream stream, String regex, Closure closure)
|
static Object
|
splitEachLine(InputStream stream, Pattern pattern, Closure closure)
|
static SpreadMap
|
spread(Map self)
|
static String
|
sprintf(Object self, String format, Object[] values)
|
static String
|
sprintf(Object self, String format, Object arg)
|
static void
|
step(Number self, Number to, Number stepNumber, Closure closure)
Get the absolute value |
static CharSequence
|
stripIndent(CharSequence self)
|
static CharSequence
|
stripIndent(CharSequence self, int numChars)
|
static String
|
stripIndent(String self)
|
static String
|
stripIndent(String self, int numChars)
|
static CharSequence
|
stripMargin(CharSequence self)
|
static CharSequence
|
stripMargin(CharSequence self, char marginChar)
|
static String
|
stripMargin(CharSequence self, CharSequence marginChar)
|
static String
|
stripMargin(String self)
|
static String
|
stripMargin(String self, char marginChar)
|
static String
|
stripMargin(String self, String marginChar)
|
static Map
|
subMap(Map map, Collection keys)
Creates a sub-Map containing the given keys. |
static Map
|
subMap(Map map, 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 Set
|
subsequences(List self)
Finds all permutations of a collection. |
static Object
|
sum(Collection self)
Sums the items in an array. |
static Object
|
sum(Object[] self)
|
static Object
|
sum(Iterator self)
|
static Object
|
sum(Collection self, Object initialValue)
|
static Object
|
sum(Object[] self, Object initialValue)
|
static Object
|
sum(Iterator self, Object initialValue)
|
static Object
|
sum(Collection self, Closure closure)
Sums the result of apply a closure to each item of an array. |
static Object
|
sum(Object[] self, Closure closure)
|
static Object
|
sum(Iterator self, Closure closure)
|
static Object
|
sum(Collection self, Object initialValue, Closure closure)
|
static Object
|
sum(Object[] self, Object initialValue, Closure closure)
|
static Object
|
sum(Iterator self, Object initialValue, Closure closure)
|
static List
|
tail(List self)
|
static Object[]
|
tail(Object[] self)
Returns the first |
static List
|
take(List self, int num)
Returns the first |
static Object[]
|
take(Object[] self, int num)
|
static List
|
take(Iterable self, int num)
Returns a new map containing the first |
static Map
|
take(Map self, int num)
|
static Iterator
|
take(Iterator self, int num)
|
static CharSequence
|
take(CharSequence self, int num)
|
static List
|
takeWhile(List self, Closure condition)
|
static List
|
takeWhile(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 Map
|
takeWhile(Map self, Closure condition)
Returns the longest prefix of this array where each element passed to the given closure evaluates to true. |
static Object[]
|
takeWhile(Object[] self, Closure condition)
|
static Iterator
|
takeWhile(Iterator self, Closure condition)
|
static void
|
times(Number self, Closure closure)
|
static String
|
toArrayString(Object[] self)
|
static BigDecimal
|
toBigDecimal(Number self)
Logical implication of two boolean operators |
static BigDecimal
|
toBigDecimal(CharSequence self)
|
static BigDecimal
|
toBigDecimal(String self)
|
static BigInteger
|
toBigInteger(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 BigInteger
|
toBigInteger(CharSequence self)
|
static BigInteger
|
toBigInteger(String self)
|
static Boolean
|
toBoolean(Boolean self)
|
static Boolean
|
toBoolean(String self)
|
static Character
|
toCharacter(String self)
|
static Double
|
toDouble(Number self)
Logical disjunction of two boolean operators |
static Double
|
toDouble(CharSequence self)
|
static Double
|
toDouble(String self)
|
static Float
|
toFloat(Number self)
Logical conjunction of two boolean operators. |
static Float
|
toFloat(CharSequence self)
|
static Float
|
toFloat(String self)
|
static Integer
|
toInteger(Number self)
|
static Integer
|
toInteger(CharSequence self)
|
static Integer
|
toInteger(String self)
|
static List
|
toList(Collection self)
Convert an iterator to a List. |
static List
|
toList(Iterator self)
|
static List
|
toList(Iterable self)
Convert an enumeration to a List. |
static List
|
toList(Enumeration self)
|
static List
|
toList(Object[] array)
|
static List
|
toList(byte[] array)
Converts this array to a Set, with each unique element added to the set. |
static List
|
toList(boolean[] array)
Converts this array to a Set, with each unique element added to the set. |
static List
|
toList(char[] array)
Converts this array to a Set, with each unique element added to the set. |
static List
|
toList(short[] array)
Converts this array to a Set, with each unique element added to the set. |
static List
|
toList(int[] array)
Converts this array to a Set, with each unique element added to the set. |
static List
|
toList(long[] array)
Converts this array to a Set, with each unique element added to the set. |
static List
|
toList(float[] array)
Converts this array to a Set, with each unique element added to the set. |
static List
|
toList(double[] array)
Converts this array to a Set, with each unique element added to the set. |
static List
|
toList(CharSequence self)
|
static List
|
toList(String self)
|
static String
|
toListString(Collection self)
|
static String
|
toListString(Collection self, int maxSize)
|
static Long
|
toLong(Number self)
|
static Long
|
toLong(CharSequence self)
|
static Long
|
toLong(String self)
|
static char
|
toLowerCase(Character self)
|
static String
|
toMapString(Map self)
Increment a Character by one. |
static String
|
toMapString(Map self, int maxSize)
|
static Set
|
toSet(byte[] array)
|
static Set
|
toSet(boolean[] array)
|
static Set
|
toSet(char[] array)
|
static Set
|
toSet(short[] array)
|
static Set
|
toSet(int[] array)
Implements the getAt(int) method for primitive type arrays. |
static Set
|
toSet(long[] array)
Implements the getAt(Range) method for primitive type arrays. |
static Set
|
toSet(float[] array)
|
static Set
|
toSet(double[] array)
|
static Set
|
toSet(Collection self)
Implements the setAt(int idx) method for primitive type arrays. |
static Set
|
toSet(Iterator self)
|
static Set
|
toSet(Enumeration self)
|
static Set
|
toSet(CharSequence self)
|
static Set
|
toSet(String self)
|
static Short
|
toShort(CharSequence self)
|
static Short
|
toShort(String self)
|
static SpreadMap
|
toSpreadMap(Map self)
Creates a spreadable map from this array. |
static SpreadMap
|
toSpreadMap(Object[] self)
|
static SpreadMap
|
toSpreadMap(List self)
|
static String
|
toString(boolean[] self)
|
static String
|
toString(byte[] self)
|
static String
|
toString(char[] self)
|
static String
|
toString(short[] self)
Returns the string representation of the given list. |
static String
|
toString(int[] self)
|
static String
|
toString(long[] self)
|
static String
|
toString(float[] self)
|
static String
|
toString(double[] self)
|
static String
|
toString(AbstractMap self)
|
static String
|
toString(AbstractCollection self)
|
static String
|
toString(Object[] self)
|
static String
|
toString(Object value)
|
static URI
|
toURI(CharSequence self)
|
static URI
|
toURI(String self)
|
static URL
|
toURL(CharSequence self)
|
static URL
|
toURL(String self)
|
static char
|
toUpperCase(Character self)
|
static List
|
tokenize(CharSequence self)
|
static List
|
tokenize(CharSequence self, Character token)
|
static List
|
tokenize(CharSequence self, CharSequence token)
|
static List
|
tokenize(String self)
|
static List
|
tokenize(String self, Character token)
|
static List
|
tokenize(String self, String token)
|
static CharSequence
|
tr(CharSequence self, CharSequence sourceSet, CharSequence replacementSet)
|
static String
|
tr(String self, String sourceSet, String replacementSet)
|
static void
|
transformChar(Reader self, Writer writer, Closure closure)
|
static void
|
transformLine(Reader reader, Writer writer, Closure closure)
|
static List
|
transpose(List self)
|
static void
|
traverse(File self, Map options, Closure closure)
|
static void
|
traverse(File self, Closure closure)
|
static void
|
traverse(File self, Map options)
|
static float
|
trunc(Float number, int precision)
|
static float
|
trunc(Float number)
|
static double
|
trunc(Double number)
|
static double
|
trunc(Double number, int precision)
|
static Number
|
unaryMinus(Number left)
|
static CharSequence
|
unexpand(CharSequence self)
|
static CharSequence
|
unexpand(CharSequence self, int tabStop)
|
static String
|
unexpand(String self)
|
static String
|
unexpand(String self, int tabStop)
|
static CharSequence
|
unexpandLine(CharSequence self, int tabStop)
|
static String
|
unexpandLine(String self, int tabStop)
|
static Iterator
|
unique(Iterator self)
|
static Collection
|
unique(Collection self)
|
static Collection
|
unique(Collection self, boolean mutate)
|
static Iterator
|
unique(Iterator self, Closure closure)
|
static Collection
|
unique(Collection self, Closure closure)
|
static Collection
|
unique(Collection self, boolean mutate, Closure closure)
|
static Iterator
|
unique(Iterator self, Comparator comparator)
Returns an iterator equivalent to this iterator with all duplicated items removed by using the supplied comparator. |
static Collection
|
unique(Collection self, Comparator comparator)
|
static Collection
|
unique(Collection self, boolean mutate, Comparator comparator)
|
static void
|
upto(Number self, Number to, Closure closure)
|
static void
|
upto(long self, Number to, Closure closure)
|
static void
|
upto(Long self, Number to, Closure closure)
|
static void
|
upto(float self, Number to, Closure closure)
|
static void
|
upto(Float self, Number to, Closure closure)
Iterates from this number up to the given number, inclusive, incrementing by one each time. |
static void
|
upto(double self, Number to, Closure closure)
|
static void
|
upto(Double self, Number to, Closure closure)
Iterates from this number down to the given number, inclusive, decrementing by one each time. |
static void
|
upto(BigInteger self, Number to, Closure closure)
Iterates from this number down to the given number, inclusive, decrementing by one each time. |
static void
|
upto(BigDecimal self, Number to, Closure closure)
Iterates from this number down to the given number, inclusive, decrementing by one each time. |
static Object
|
use(Object self, Class categoryClass, Closure closure)
Scoped use method |
static Object
|
use(Object self, List categoryClassList, Closure closure)
|
static Object
|
use(Object self, Object[] array)
|
static Object
|
with(Object self, Closure closure)
|
static Object
|
withDataInputStream(File file, Closure closure)
|
static Object
|
withDataOutputStream(File file, Closure closure)
|
static Map
|
withDefault(Map self, Closure init)
An alias for |
static List
|
withDefault(List self, Closure init)
|
static List
|
withEagerDefault(List self, Closure init)
Sorts the Collection. |
static Object
|
withInputStream(File file, Closure closure)
|
static Object
|
withInputStream(URL url, Closure closure)
|
static List
|
withLazyDefault(List self, Closure init)
|
static Object
|
withObjectInputStream(File file, Closure closure)
|
static Object
|
withObjectInputStream(File file, ClassLoader classLoader, Closure closure)
|
static Object
|
withObjectInputStream(InputStream inputStream, Closure closure)
|
static Object
|
withObjectInputStream(InputStream inputStream, ClassLoader classLoader, Closure closure)
|
static Object
|
withObjectOutputStream(File file, Closure closure)
|
static Object
|
withObjectOutputStream(OutputStream outputStream, Closure closure)
|
static Object
|
withObjectStreams(Socket socket, Closure closure)
|
static Object
|
withOutputStream(File file, Closure closure)
|
static Object
|
withPrintWriter(File file, Closure closure)
|
static Object
|
withPrintWriter(File file, String charset, Closure closure)
|
static Object
|
withPrintWriter(Writer writer, Closure closure)
|
static Object
|
withReader(File file, Closure closure)
|
static Object
|
withReader(File file, String charset, Closure closure)
|
static Object
|
withReader(Reader reader, Closure closure)
|
static Object
|
withReader(URL url, Closure closure)
|
static Object
|
withReader(URL url, String charset, Closure closure)
|
static Object
|
withReader(InputStream in, Closure closure)
|
static Object
|
withReader(InputStream in, String charset, Closure closure)
|
static Object
|
withStream(InputStream stream, Closure closure)
|
static Object
|
withStream(OutputStream os, Closure closure)
|
static Object
|
withStreams(Socket socket, Closure closure)
|
static Object
|
withWriter(File file, Closure closure)
|
static Object
|
withWriter(File file, String charset, Closure closure)
|
static Object
|
withWriter(Writer writer, Closure closure)
|
static Object
|
withWriter(OutputStream stream, Closure closure)
|
static Object
|
withWriter(OutputStream stream, String charset, Closure closure)
|
static Object
|
withWriterAppend(File file, String charset, Closure closure)
|
static Object
|
withWriterAppend(File file, Closure closure)
|
static void
|
write(Writer self, Writable writable)
|
static void
|
write(File file, String text)
|
static void
|
write(File file, String text, String charset)
|
static void
|
writeLine(BufferedWriter writer, String line)
|
static BitSet
|
xor(BitSet left, BitSet right)
|
static Number
|
xor(Number left, Number right)
|
static Boolean
|
xor(Boolean left, Boolean right)
|
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
public static final Class[] DGM_LIKE_CLASSES
public static final Class[] additionals
Method Detail |
---|
public static int abs(Number number)
number
- a Floatprecision
- the number of decimal places to keep
public static long abs(Long number)
number
- a Doubleprecision
- the number of decimal places to keep
public static float abs(Float number)
self
- a Character
public static double abs(Double number)
@Deprecated public static Socket accept(ServerSocket serverSocket, Closure closure)
@Deprecated public static Socket accept(ServerSocket serverSocket, boolean runInANewThread, Closure closure)
public static boolean addAll(Collection self, Object[] items)
public static boolean addAll(List self, int index, Object[] items)
self
- an Object with an Iterator returning its valuesclosure
- a closure condition
public static void addShutdownHook(Object self, Closure closure)
public static Number and(Number left, Number right)
public static BitSet and(BitSet left, BitSet right)
public static Boolean and(Boolean left, Boolean right)
self
- the iteration object over which to iteratestartIndex
- start matching from this indexclosure
- the filter to perform a match on the collection
public static boolean any(Object self, Closure closure)
public static boolean any(Map self, Closure closure)
public static boolean any(Object self)
@Deprecated} public static void append(File file, Object text)
@Deprecated} public static void append(File file, byte[] bytes)
@Deprecated} public static void append(File self, InputStream stream)
@Deprecated} public static void append(File file, Object text, String charset)
public static boolean asBoolean(Object object)
assert [1,2].asBoolean() == true
assert [].asBoolean() == false
collection
- the collection
public static boolean asBoolean(Boolean bool)
public static boolean asBoolean(Collection collection)
iterator
- the iterator
public static boolean asBoolean(Map map)
enumeration
- the enumeration
public static boolean asBoolean(Iterator iterator)
array
- the array
public static boolean asBoolean(Enumeration enumeration)
array
- an array
public static boolean asBoolean(Object[] array)
array
- an array
public static boolean asBoolean(byte[] array)
array
- an array
public static boolean asBoolean(short[] array)
array
- an array
public static boolean asBoolean(int[] array)
array
- an array
public static boolean asBoolean(long[] array)
array
- an array
public static boolean asBoolean(float[] array)
array
- an array
public static boolean asBoolean(double[] array)
array
- an array
public static boolean asBoolean(boolean[] array)
character
- the character
public static boolean asBoolean(char[] array)
number
- the number
public static boolean asBoolean(Character character)
public static boolean asBoolean(Number number)
@Deprecated public static boolean asBoolean(CharSequence string)
@Deprecated public static boolean asBoolean(Matcher matcher)
public static Map asImmutable(Map self)
self
- a SortedMap
public static SortedMap asImmutable(SortedMap self)
public static List asImmutable(List self)
public static Set asImmutable(Set self)
public static SortedSet asImmutable(SortedSet self)
public static Collection asImmutable(Collection self)
self
- a SortedMap
public static List asList(Collection self)
object
- the object to coerce
public static Map asSynchronized(Map self)
public static SortedMap asSynchronized(SortedMap self)
public static Collection asSynchronized(Collection self)
public static List asSynchronized(List self)
public static Set asSynchronized(Set self)
public static SortedSet asSynchronized(SortedSet self)
@SuppressWarnings} catch (GroovyCastException e) { public static Object asType(Collection col, Class clazz)
@SuppressWarnings} public static Object asType(Object[] ary, Class clazz)
ary
- an arrayclazz
- the desired class
@SuppressWarningsif (!(clazz.isInstance(map)) && clazz.isInterface()) { public static Object asType(Closure cl, Class clazz)
map
- this mapclazz
- the target type
@SuppressWarnings* @since 1.0 public static Object asType(Map map, Class clazz)
@SuppressWarnings* Traverse through each byte of this byte array. Alias for each. public static Object asType(Number self, Class c)
self
- a Byte arrayclosure
- a closure
@SuppressWarningsif (mc instanceof ExpandoMetaClass public static Object asType(Object obj, Class type)
String.metaClass.myMethod = { println "foo" }
c
- The java.lang.Class instance
@Deprecated public static Object asType(CharSequence self, Class c)
@Deprecated @SuppressWarningspublic static String eachMatch(String self, String regex, Closure closure) { public static Object asType(GString self, Class c)
@Deprecatedpublic static CharSequence expand(CharSequence self) { @SuppressWarningsreturn StringGroovyMethods.expand(self); public static Object asType(String self, Class c)
@Deprecated public static Object asType(File f, Class c)
@Deprecated public static File asWritable(File file)
@Deprecated public static File asWritable(File file, String encoding)
public static BitSet bitwiseNegate(BitSet self)
self
- a longto
- the end numberclosure
- the code to execute for each number
@Deprecatedreturn StringGroovyMethods.expand(self, tabStop); public static Pattern bitwiseNegate(CharSequence self)
@Deprecatedreturn StringGroovyMethods.expand(self); public static Pattern bitwiseNegate(String self)
protected static Object callClosureForLine(Closure closure, String line, int counter)
protected static Object callClosureForMapEntry(Closure closure, Map.Entry entry)
protected static Object callClosureForMapEntryAndCounter(Closure closure, Map.Entry entry, int counter)
@Deprecatedreturn StringGroovyMethods.expand(self, tabStop); public static CharSequence capitalize(CharSequence self)
@Deprecatedreturn StringGroovyMethods.expandLine(self, tabStop); public static String capitalize(String self)
@Deprecatedreturn StringGroovyMethods.expandLine(self, tabStop); public static CharSequence center(CharSequence self, Number numberOfChars)
@Deprecatedreturn StringGroovyMethods.find(self, regex); public static CharSequence center(CharSequence self, Number numberOfChars, CharSequence padding)
@Deprecatedreturn StringGroovyMethods.find(self, regex, closure); public static String center(String self, Number numberOfChars)
@Deprecatedreturn StringGroovyMethods.find(self, pattern); public static String center(String self, Number numberOfChars, String padding)
public static List collate(List self, int size)
public static List collate(List self, int size, int step)
public static List collate(List self, int size, boolean keepRemainder)
public static List collate(List self, int size, int step, boolean keepRemainder)
public static List collect(Object self, Closure transform)
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]
self
- an aggregate Object with an Iterator returning its itemstransform
- the closure used to transform each item of the aggregate object
public static Collection collect(Object self)
transform
closure
and adding it to the supplied collector
.
self
- an aggregate Object with an Iterator returning its itemscollector
- the Collection to which the transformed values are addedtransform
- the closure used to transform each item of the aggregate object
public static Collection collect(Object self, Collection collector, Closure transform)
public static List collect(Collection self, Closure transform)
assert [1,2,3] == [1,2,3].collect()
self
- a collection
public static List collect(Collection self)
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) }
self
- a collectioncollector
- the Collection to which the transformed values are addedtransform
- the closure used to transform each item of the collection
public static Collection collect(Collection self, Collection collector, Closure transform)
public static Collection collect(Map self, Collection collector, Closure transform)
public static List collect(Map self, Closure transform)
public static List collectAll(Collection self, Closure transform)
public static Collection collectAll(Collection self, Collection collector, Closure transform)
public static Map collectEntries(Map self, Map collector, Closure transform)
public static Map collectEntries(Map self, Closure transform)
public static Map collectEntries(Collection self, Closure transform)
self
- an Iteratortransform
- the closure used for transforming, which has an item from self as the parameter and
should return a Map.Entry, a Map or a two-element list containing the resulting key and value
public static Map collectEntries(Iterator self, Closure transform)
self
- an Iterabletransform
- the closure used for transforming, which has an item from self as the parameter and
should return a Map.Entry, a Map or a two-element list containing the resulting key and value
public static Map collectEntries(Iterable self, Closure transform)
public static Map collectEntries(Collection self)
self
- an Iterator
public static Map collectEntries(Iterator self)
self
- an Iterable
public static Map collectEntries(Iterable self)
public static Map collectEntries(Collection self, Map collector, Closure transform)
public static Map collectEntries(Iterator self, Map collector, Closure transform)
public static Map collectEntries(Iterable self, Map collector, Closure transform)
self
- a Collectioncollector
- the Map into which the transformed entries are put
public static Map collectEntries(Collection self, Map collector)
self
- an Iteratorcollector
- the Map into which the transformed entries are put
public static Map collectEntries(Iterator self, Map collector)
self
- an Iterablecollector
- the Map into which the transformed entries are put
public static Map collectEntries(Iterable self, Map collector)
public static Map collectEntries(Object[] self, Map collector, Closure transform)
self
- an Object arraycollector
- the Map into which the transformed entries are put
public static Map collectEntries(Object[] self, Map collector)
public static Map collectEntries(Object[] self, Closure transform)
self
- an Object array
public static Map collectEntries(Object[] self)
public static List collectMany(Collection self, Closure projection)
def nums = 1..10 def squaresAndCubesOfEvens = nums.collectMany{ it % 2 ? [] : [it**2, it**3] } assert squaresAndCubesOfEvens == [4, 8, 16, 64, 36, 216, 64, 512, 100, 1000] def animals = ['CAT', 'DOG', 'ELEPHANT'] as Set def smallAnimals = animals.collectMany{ it.size() > 3 ? [] : [it.toLowerCase()] } assert smallAnimals == ['cat', 'dog'] def orig = nums as Set def origPlusIncrements = orig.collectMany{ [it, it+1] } assert origPlusIncrements.size() == orig.size() * 2 assert origPlusIncrements.unique().size() == orig.size() + 1
self
- a collectionprojection
- a projecting Closure returning a collection of items
public static Collection collectMany(Collection self, Collection collector, Closure projection)
public static Collection collectMany(Map self, Collection collector, Closure projection)
public static Collection collectMany(Map self, Closure projection)
public static List collectMany(Object[] self, Closure projection)
public static List collectMany(Iterator self, Closure projection)
public static List collectNested(Collection self, Closure transform)
public static Collection collectNested(Collection self, Collection collector, Closure transform)
public static List combinations(Collection self)
Example usage:
def result = [1, 2, 3].subsequences() assert result == [[1, 2, 3], [1, 3], [2, 3], [1, 2], [1], [2], [3]] as Set
self
- the List of items
public static int compareTo(Character left, Number right)
public static int compareTo(Number left, Character right)
public static int compareTo(Character left, Character right)
public static int compareTo(Number left, Number right)
public static boolean contains(int[] self, Object value)
self
- the array we are searchingvalue
- the value being searched for
public static boolean contains(long[] self, Object value)
self
- the array we are searchingvalue
- the value being searched for
public static boolean contains(short[] self, Object value)
self
- an array
public static boolean contains(char[] self, Object value)
self
- an array
public static boolean contains(boolean[] self, Object value)
self
- an array
public static boolean contains(double[] self, Object value)
self
- an array
public static boolean contains(float[] self, Object value)
public static boolean contains(byte[] self, Object value)
self
- an array
public static boolean contains(Object[] self, Object value)
self
- a Map
@Deprecatedreturn StringGroovyMethods.find(self, pattern, closure); public static boolean contains(CharSequence self, CharSequence text)
@Deprecatedreturn StringGroovyMethods.find(self, pattern); public static boolean contains(String self, String text)
public static boolean containsAll(Collection self, Object[] items)
findAll
and grep
when wanting to produce a new list
containing items which don't match some criteria while leaving the original collection unchanged.
self
- a Collection to be modifieditems
- array containing elements to be removed from this collection
public static Number count(Iterator self, Object value)
public static Number count(Iterator self, Closure closure)
Example usage:
assert [2,4,2,1,3,5,2,4,3].toSet().iterator().count{ it % 2 == 0 } == 2
self
- the Iterator from which we count the number of matching occurrencesclosure
- a closure condition
public static Number count(Collection self, Object value)
compareTo(value) == 0
or equals(value)
).
Example usage:
assert [2,4,2,1,3,5,2,4,3].count(4) == 2
self
- the collection within which we count the number of occurrencesvalue
- the value being searched for
public static Number count(Collection self, Closure closure)
public static Number count(Map self, Closure closure)
public static Number count(Object[] self, Object value)
compareTo(value) == 0
or equals(value)
).
self
- the array within which we count the number of occurrencesvalue
- the value being searched for
public static Number count(Object[] self, Closure closure)
compareTo(value) == 0
or equals(value)
).
self
- the array within which we count the number of occurrencesvalue
- the value being searched for
public static Number count(int[] self, Object value)
compareTo(value) == 0
or equals(value)
).
self
- the array within which we count the number of occurrencesvalue
- the value being searched for
public static Number count(long[] self, Object value)
compareTo(value) == 0
or equals(value)
).
self
- the array within which we count the number of occurrencesvalue
- the value being searched for
public static Number count(short[] self, Object value)
compareTo(value) == 0
or equals(value)
).
self
- the array within which we count the number of occurrencesvalue
- the value being searched for
public static Number count(char[] self, Object value)
compareTo(value) == 0
or equals(value)
).
self
- the array within which we count the number of occurrencesvalue
- the value being searched for
public static Number count(boolean[] self, Object value)
compareTo(value) == 0
or equals(value)
).
self
- the array within which we count the number of occurrencesvalue
- the value being searched for
public static Number count(double[] self, Object value)
compareTo(value) == 0
or equals(value)
).
self
- the array within which we count the number of occurrencesvalue
- the value being searched for
public static Number count(float[] self, Object value)
compareTo(value) == 0
or equals(value)
).
self
- the array within which we count the number of occurrencesvalue
- the value being searched for
public static Number count(byte[] self, Object value)
@Deprecatedreturn StringGroovyMethods.find(self, pattern, closure); public static int count(CharSequence self, CharSequence text)
@Deprecatedreturn StringGroovyMethods.find(self, regex); public static int count(String self, String text)
public static Map countBy(Collection self, Closure closure)
Example usage:
assert ([1,2,2,2,3] as Object[]).countBy{ it % 2 } == [1:2, 0:3]
self
- an object array to group and countclosure
- a closure mapping items to the frequency keys
public static Map countBy(Object[] self, Closure closure)
Example usage:
assert [1,2,2,2,3].toSet().iterator().countBy{ it % 2 } == [1:2, 0:1]
self
- an iterator to group and countclosure
- a closure mapping items to the frequency keys
public static Map countBy(Iterator self, Closure closure)
public static Map countBy(Map self, Closure closure)
answer
- the map containing the resultselement
- the element to be placedvalue
- the value according to which the element will be placed
@Deprecatedreturn StringGroovyMethods.find(self, regex, closure); protected static StringBufferWriter createStringBufferWriter(StringBuffer self)
@Deprecatedreturn StringGroovyMethods.findAll(self, regex); protected static StringWriter createStringWriter(String self)
@Deprecated public static boolean deleteDir(File self)
@Deprecated public static CharSequence denormalize(CharSequence self)
@Deprecated public static String denormalize(String self)
public static boolean disjoint(Collection left, Collection right)
left
- an int arrayright
- the array being compared
public static Number div(Character left, Number right)
left
- a Numberright
- another Number to bitwise AND
public static Number div(Number left, Character right)
left
- a BitSetright
- another BitSet to bitwise AND
public static Number div(Character left, Character right)
left
- a BitSetright
- another BitSet to bitwise AND
public static void downto(Number self, Number to, Closure closure)
self
- a doubleto
- the end numberclosure
- the code to execute for each number
public static void downto(long self, Number to, Closure closure)
public static void downto(Long self, Number to, Closure closure)
public static void downto(float self, Number to, Closure closure)
public static void downto(Float self, Number to, Closure closure)
public static void downto(double self, Number to, Closure closure)
public static void downto(Double self, Number to, Closure closure)
0.step( 10, 2 ) { println it }Prints even numbers 0 through 8.
self
- a Number to start withto
- a Number to go up to, exclusivestepNumber
- a Number representing the step incrementclosure
- the closure to call
public static void downto(BigInteger self, Number to, Closure closure)
public static void downto(BigDecimal self, Number to, Closure closure)
number
- a Number
public static List drop(List self, int num)
public static List drop(Iterable self, int num)
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[]
self
- the original arraynum
- the number of elements to drop from this arraynum
ones, or else the empty array, if this
array has less than num
elements.
public static Object[] drop(Object[] self, int num)
public static Map drop(Map self, int num)
public static Iterator drop(Iterator self, int num)
def nums = [ 1, 3, 2 ] assert nums.takeWhile{ it < 1 } == [] assert nums.takeWhile{ it < 3 } == [ 1 ] assert nums.takeWhile{ it < 4 } == [ 1, 3, 2 ]
self
- the original listcondition
- the closure that must evaluate to true to
continue taking elements
@Deprecated public static CharSequence drop(CharSequence self, int num)
public static List dropWhile(List self, Closure condition)
public static List dropWhile(Iterable self, Closure condition)
def shopping = [milk:1, bread:2, chocolate:3] assert shopping.dropWhile{ it.key.size() < 6 } == [chocolate:3] assert shopping.dropWhile{ it.value % 2 } == [bread:2, chocolate:3] assert shopping.dropWhile{ k, v -> k.size() + v <= 7 } == [chocolate:3]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.
self
- a Mapcondition
- a 1 (or 2) arg Closure that must evaluate to true for the
entry (or key and value) to continue dropping elements
public static Map dropWhile(Map self, Closure condition)
public static Object[] dropWhile(Object[] self, Closure condition)
public static Iterator dropWhile(Iterator self, Closure condition)
public static String dump(Object self)
public static Object each(Object self, Closure closure)
self
- the object over which we iterateclosure
- the closure applied on each element found
public static Map each(Map self, Closure closure)
public static void eachByte(Byte[] self, Closure closure)
public static void eachByte(byte[] self, Closure closure)
@Deprecated public static void eachByte(File self, Closure closure)
@Deprecated public static void eachByte(File self, int bufferLen, Closure closure)
@Deprecated public static void eachByte(InputStream is, Closure closure)
@Deprecated public static void eachByte(InputStream is, int bufferLen, Closure closure)
@Deprecated public static void eachByte(URL url, Closure closure)
@Deprecated public static void eachByte(URL url, int bufferLen, Closure closure)
@Deprecated public static void eachDir(File self, Closure closure)
@Deprecated public static void eachDirMatch(File self, Object nameFilter, Closure closure)
@Deprecatedreturn ResourceGroovyMethods.newWriter(file, append); public static void eachDirRecurse(File self, Closure closure)
@Deprecated} public static void eachFile(File self, FileType fileType, Closure closure)
@Deprecated public static void eachFile(File self, Closure closure)
@Deprecatedreturn ResourceGroovyMethods.newWriter(file, charset, append); public static void eachFileMatch(File self, FileType fileType, Object nameFilter, Closure closure)
@Deprecated} public static void eachFileMatch(File self, Object nameFilter, Closure closure)
@Deprecated public static void eachFileRecurse(File self, FileType fileType, Closure closure)
@Deprecatedreturn ResourceGroovyMethods.newWriter(file); public static void eachFileRecurse(File self, Closure closure)
@Deprecated public static Object eachLine(CharSequence self, Closure closure)
@Deprecated public static Object eachLine(CharSequence self, int firstLine, Closure closure)
@Deprecated public static Object eachLine(String self, Closure closure)
@Deprecated public static Object eachLine(String self, int firstLine, Closure closure)
@Deprecated public static Object eachLine(File self, Closure closure)
@Deprecated public static Object eachLine(File self, String charset, Closure closure)
@Deprecated public static Object eachLine(File self, int firstLine, Closure closure)
@Deprecated public static Object eachLine(File self, String charset, int firstLine, Closure closure)
@Deprecated public static Object eachLine(InputStream stream, String charset, Closure closure)
@Deprecated public static Object eachLine(InputStream stream, String charset, int firstLine, Closure closure)
@Deprecated public static Object eachLine(InputStream stream, Closure closure)
@Deprecated public static Object eachLine(InputStream stream, int firstLine, Closure closure)
@Deprecated public static Object eachLine(URL url, Closure closure)
@Deprecated public static Object eachLine(URL url, int firstLine, Closure closure)
@Deprecated public static Object eachLine(URL url, String charset, Closure closure)
@Deprecated public static Object eachLine(URL url, String charset, int firstLine, Closure closure)
@Deprecated public static Object eachLine(Reader self, Closure closure)
@Deprecated public static Object eachLine(Reader self, int firstLine, Closure closure)
@Deprecated public static String eachMatch(CharSequence self, CharSequence regex, Closure closure)
@Deprecated public static String eachMatch(CharSequence self, Pattern pattern, Closure closure)
@Deprecated public static String eachMatch(String self, Pattern pattern, Closure closure)
@Deprecated public static String eachMatch(String self, String regex, Closure closure)
@Deprecated public static void eachObject(File self, Closure closure)
@Deprecated public static void eachObject(ObjectInputStream ois, Closure closure)
public static Iterator eachPermutation(Collection self, Closure closure)
public static Object eachWithIndex(Object self, Closure closure)
public static Map eachWithIndex(Map self, Closure closure)
public static boolean equals(int[] left, int[] right)
false
if either collection is null
.
left
- an arrayright
- the List being compared
public static boolean equals(Object[] left, List right)
public static boolean equals(List left, Object[] right)
public static boolean equals(List left, List right)
public static boolean equals(Set self, Set other)
public static boolean equals(Map self, Map other)
self
- a Set objectremoveMe
- the items to remove from the Set
public static boolean every(Object self, Closure closure)
public static boolean every(Map self, Closure closure)
public static boolean every(Object self)
@Deprecated public static Process execute(String self)
@Deprecated public static Process execute(String self, String[] envp, File dir)
@Deprecated public static Process execute(String self, List envp, File dir)
@Deprecated public static Process execute(String[] commandArray)
@Deprecated public static Process execute(String[] commandArray, String[] envp, File dir)
@Deprecated public static Process execute(String[] commandArray, List envp, File dir)
@Deprecated public static Process execute(List commands)
@Deprecated public static Process execute(List commands, String[] envp, File dir)
@Deprecated public static Process execute(List commands, List envp, File dir)
@Deprecated public static CharSequence expand(CharSequence self)
@Deprecated public static CharSequence expand(CharSequence self, int tabStop)
@Deprecated public static String expand(String self)
@Deprecated public static String expand(String self, int tabStop)
@Deprecated public static CharSequence expandLine(CharSequence self, int tabStop)
@Deprecated public static String expandLine(String self, int tabStop)
@Deprecated public static void filterLine(Reader reader, Writer writer, Closure closure)
@Deprecated public static Writable filterLine(File self, Closure closure)
@Deprecated public static Writable filterLine(File self, String charset, Closure closure)
@Deprecated public static void filterLine(File self, Writer writer, Closure closure)
@Deprecated public static void filterLine(File self, Writer writer, String charset, Closure closure)
@Deprecated public static Writable filterLine(Reader reader, Closure closure)
@Deprecated public static Writable filterLine(InputStream self, Closure predicate)
@Deprecated public static Writable filterLine(InputStream self, String charset, Closure predicate)
@Deprecated public static void filterLine(InputStream self, Writer writer, Closure predicate)
@Deprecated public static void filterLine(InputStream self, Writer writer, String charset, Closure predicate)
@Deprecated public static Writable filterLine(URL self, Closure predicate)
@Deprecated public static Writable filterLine(URL self, String charset, Closure predicate)
@Deprecated public static void filterLine(URL self, Writer writer, Closure predicate)
@Deprecated public static void filterLine(URL self, Writer writer, String charset, Closure predicate)
public static Object find(Object self, Closure closure)
public static Object find(Object self)
self
- an Object with an iterator returning its valuesdefaultResult
- an Object that should be returned if all closure results are nullclosure
- a closure that returns a non-null value when processing should stop
public static Object find(Collection self, Closure closure)
public static Object find(Object[] self, Closure condition)
public static Object find(Collection self)
public static Map.Entry find(Map self, Closure closure)
@Deprecated public static CharSequence find(CharSequence self, CharSequence regex)
@Deprecated public static CharSequence find(CharSequence self, CharSequence regex, Closure closure)
@Deprecated public static CharSequence find(CharSequence self, Pattern pattern)
@Deprecated public static CharSequence find(CharSequence self, Pattern pattern, Closure closure)
@Deprecated public static String find(String self, Pattern pattern)
@Deprecated public static String find(String self, Pattern pattern, Closure closure)
@Deprecated public static String find(String self, String regex)
@Deprecated public static String find(String self, String regex, Closure closure)
public static Collection findAll(Collection self, Closure closure)
def items = [1,2,3,4] as Integer[] assert [2,4] == items.findAll { it % 2 == 0 }
self
- an arraycondition
- a closure condition
public static Collection findAll(Object[] self, Closure condition)
public static Collection findAll(Collection self)
Example:
def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null] as Object[] assert items.findAll() == [1, 2, true, 'foo', [4, 5]]
self
- an array
public static Collection findAll(Object[] self)
self
- an Object with an Iterator returning its valuesclosure
- a closure condition
public static Collection findAll(Object self, Closure closure)
public static Collection findAll(Object self)
public static Map findAll(Map self, Closure closure)
@Deprecated public static List findAll(CharSequence self, CharSequence regex)
@Deprecated public static List findAll(CharSequence self, CharSequence regex, Closure closure)
@Deprecated public static List findAll(CharSequence self, Pattern pattern)
@Deprecated public static List findAll(CharSequence self, Pattern pattern, Closure closure)
@Deprecated public static List findAll(String self, Pattern pattern)
@Deprecated public static List findAll(String self, Pattern pattern, Closure closure)
@Deprecated public static List findAll(String self, String regex)
@Deprecated public static List findAll(String self, String regex, Closure closure)
public static int findIndexOf(Object self, Closure closure)
public static int findIndexOf(Object self, int startIndex, Closure closure)
public static List findIndexValues(Object self, Closure closure)
public static List findIndexValues(Object self, Number startIndex, Closure closure)
public static int findLastIndexOf(Object self, Closure closure)
obj
- the object to converttype
- the goal type
public static int findLastIndexOf(Object self, int startIndex, Closure closure)
public static Object findResult(Object self, Object defaultResult, Closure closure)
self
- an Object with an iterator returning its valuesclosure
- a closure that returns a non-null value when processing should stop
public static Object findResult(Object self, Closure closure)
public static Object findResult(Collection self, Object defaultResult, Closure closure)
public static Object findResult(Collection self, Closure closure)
public static Object findResult(Map self, Object defaultResult, Closure closure)
public static Object findResult(Map self, Closure closure)
public static Collection findResults(Collection self, Closure filteringTransform)
public static Collection findResults(Map self, Closure filteringTransform)
public static Object first(List self)
public static Object first(Iterable self)
def array = [3, 4, 2].toArray() assert array.first() == 3
self
- an array
public static Object first(Object[] self)
public static Collection flatten(Collection self)
self
- a byte Array to flatten
public static Collection flatten(Object[] self)
public static Collection flatten(boolean[] self)
public static Collection flatten(byte[] self)
public static Collection flatten(char[] self)
public static Collection flatten(short[] self)
public static Collection flatten(int[] self)
public static Collection flatten(long[] self)
public static Collection flatten(float[] self)
self
- a CollectionflattenUsing
- a closure to determine how to flatten non-Array, non-Collection elements
public static Collection flatten(double[] self)
public static Collection flatten(Collection self, Closure flattenUsing)
def list = [1,2] list << 3 assert list == [1,2,3]
self
- a Collectionvalue
- an Object to be added to the collection.
public static Object get(Map map, Object key, Object defaultValue)
array
- an Array of Objectsrange
- a Range
public static Object getAt(Object self, String property)
bean[somePropertyNameExpression]
. The normal property notation
of groovy is neater and more concise but only works with compile-time known
property names.
self
- the object to act uponproperty
- the property name of interest
public static List getAt(List self, Range range)
def list = [true, 1, 3.4] assert list[0..<0] == []
self
- a Listrange
- a Range indicating the items to get
public static List getAt(List self, EmptyRange range)
def list = [true, 1, 3.4, false] assert list[1,0,2] == [1, true, 3.4]
self
- a Listindices
- a Collection of indices
public static List getAt(List self, Collection indices)
self
- an Array of Objectsindices
- a Collection of indices
public static List getAt(Object[] self, Collection indices)
assert [1:10, 2:20, 4:40].subMap( [2, 4] ) == [2:20, 4:40]
map
- a Mapkeys
- a Collection of keys
public static List getAt(Object[] array, Range range)
array
- an Array of Objectsrange
- an EmptyRange
public static List getAt(Object[] array, IntRange range)
array
- an Array of Objectsrange
- an ObjectRange
public static List getAt(Object[] array, EmptyRange range)
public static List getAt(Object[] array, ObjectRange range)
public static Object getAt(List self, int idx)
public static Object getAt(Iterator self, int idx)
public static Object getAt(Iterable self, int idx)
def list = [2, 3] list[0] = 1 assert list == [1, 3]
self
- a Listidx
- an indexvalue
- the value to put at the given index
public static Object getAt(Map self, Object key)
def map = [a:10] assert map["a"] == 10
self
- a Mapkey
- an Object as a key for the map
public static List getAt(Collection coll, String property)
self
- a Map
@SuppressWarnings* Support the subscript operator with a range for a long array public static List getAt(byte[] array, Range range)
array
- an int arrayrange
- a range indicating the indices for the items to retrieve
@SuppressWarnings* Support the subscript operator with a range for a float array public static List getAt(char[] array, Range range)
@SuppressWarnings* Support the subscript operator with a range for a double array public static List getAt(short[] array, Range range)
@SuppressWarnings* Support the subscript operator with a range for a boolean array public static List getAt(int[] array, Range range)
@SuppressWarnings* Support the subscript operator with an IntRange for a byte array public static List getAt(long[] array, Range range)
@SuppressWarnings* Support the subscript operator with an IntRange for a char array public static List getAt(float[] array, Range range)
@SuppressWarnings* Support the subscript operator with an IntRange for a short array public static List getAt(double[] array, Range range)
@SuppressWarnings* Support the subscript operator with an IntRange for an int array public static List getAt(boolean[] array, Range range)
@SuppressWarnings* Support the subscript operator with an IntRange for a long array public static List getAt(byte[] array, IntRange range)
@SuppressWarnings* Support the subscript operator with an IntRange for a float array public static List getAt(char[] array, IntRange range)
@SuppressWarnings* Support the subscript operator with an IntRange for a double array public static List getAt(short[] array, IntRange range)
@SuppressWarnings* Support the subscript operator with an IntRange for a boolean array public static List getAt(int[] array, IntRange range)
@SuppressWarnings* Support the subscript operator with an ObjectRange for a byte array public static List getAt(long[] array, IntRange range)
@SuppressWarnings* Support the subscript operator with an ObjectRange for a char array public static List getAt(float[] array, IntRange range)
@SuppressWarnings* Support the subscript operator with an ObjectRange for a short array public static List getAt(double[] array, IntRange range)
@SuppressWarnings* Support the subscript operator with an ObjectRange for an int array public static List getAt(boolean[] array, IntRange range)
@SuppressWarnings* Support the subscript operator with an ObjectRange for a long array public static List getAt(byte[] array, ObjectRange range)
@SuppressWarnings* Support the subscript operator with an ObjectRange for a float array public static List getAt(char[] array, ObjectRange range)
@SuppressWarnings* Support the subscript operator with an ObjectRange for a double array public static List getAt(short[] array, ObjectRange range)
@SuppressWarnings* Support the subscript operator with an ObjectRange for a byte array public static List getAt(int[] array, ObjectRange range)
@SuppressWarnings* Support the subscript operator with a collection for a byte array public static List getAt(long[] array, ObjectRange range)
@SuppressWarnings* Support the subscript operator with a collection for a char array public static List getAt(float[] array, ObjectRange range)
@SuppressWarnings* Support the subscript operator with a collection for a short array public static List getAt(double[] array, ObjectRange range)
@SuppressWarnings* Support the subscript operator with a collection for an int array public static List getAt(boolean[] array, ObjectRange range)
@SuppressWarnings* Support the subscript operator with a collection for a long array public static List getAt(byte[] array, Collection indices)
@SuppressWarnings* Support the subscript operator with a collection for a float array public static List getAt(char[] array, Collection indices)
@SuppressWarnings* Support the subscript operator with a collection for a double array public static List getAt(short[] array, Collection indices)
@SuppressWarnings* Support the subscript operator with a collection for a boolean array public static List getAt(int[] array, Collection indices)
@SuppressWarnings* Support the subscript operator for a Bitset public static List getAt(long[] array, Collection indices)
@SuppressWarnings* Support retrieving a subset of a BitSet using a Range public static List getAt(float[] array, Collection indices)
@SuppressWarningsBitSet result = new BitSet(); public static List getAt(double[] array, Collection indices)
@SuppressWarnings} public static List getAt(boolean[] array, Collection indices)
public static boolean getAt(BitSet self, int index)
public static BitSet getAt(BitSet self, IntRange range)
@Deprecated public static CharSequence getAt(CharSequence self, Collection indices)
@Deprecated public static CharSequence getAt(CharSequence text, EmptyRange range)
@Deprecated public static CharSequence getAt(CharSequence text, int index)
@Deprecated public static CharSequence getAt(CharSequence text, IntRange range)
@Deprecated public static CharSequence getAt(CharSequence text, Range range)
@Deprecated public static List getAt(Matcher self, Collection indices)
@Deprecated public static Object getAt(Matcher matcher, int idx)
@Deprecated public static String getAt(String self, Collection indices)
@Deprecated public static String getAt(String text, EmptyRange range)
@Deprecated public static String getAt(String text, int index)
@Deprecated public static String getAt(String text, IntRange range)
@Deprecated public static String getAt(String text, Range range)
@Deprecatedpublic static void eachFileMatch(final File self, final FileType fileType, final Object nameFilter, final Closure closure) public static byte[] getBytes(File file)
@Deprecated public static byte[] getBytes(URL url)
@Deprecated public static byte[] getBytes(InputStream is)
@Deprecated public static char[] getChars(CharSequence self)
@Deprecated public static char[] getChars(String self)
@Deprecated public static int getCount(Matcher matcher)
public static MetaClass getMetaClass(Class c)
public static MetaClass getMetaClass(Object obj)
public static MetaClass getMetaClass(GroovyObject obj)
self
- the object whose metaclass we wish to updateclosure
- the closure representing the new metaclass
public static List getMetaPropertyValues(Object self)
self
- the receiver object
public static Map getProperties(Object self)
self
- the receiver object
public static ClassLoader getRootLoader(ClassLoader self)
c
- a class
protected static List getSubList(List self, List splice)
@Deprecated public static String getText(File file, String charset)
@Deprecated public static String getText(File file)
@Deprecated public static String getText(URL url)
@Deprecated public static String getText(URL url, Map parameters)
@Deprecated} public static String getText(URL url, String charset)
@DeprecatedResourceGroovyMethods.traverse(self, options, closure); public static String getText(URL url, Map parameters, String charset)
@DeprecatedResourceGroovyMethods.traverse(self, closure); public static String getText(InputStream is)
@Deprecatedthrows FileNotFoundException, IllegalArgumentException { public static String getText(InputStream is, String charset)
@Deprecatedpublic static void eachFileRecurse(File self, Closure closure) throws FileNotFoundException, IllegalArgumentException { public static String getText(Reader reader)
@Deprecatedpublic static void eachDirRecurse(final File self, final Closure closure) throws FileNotFoundException, IllegalArgumentException { public static String getText(BufferedReader reader)
public static Collection grep(Object self, Object filter)
public static Collection grep(Collection self, Object filter)
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 ]
self
- a collectionfilter
- the filter to perform on each element of the collection (using the isCase(java.lang.Object, java.lang.Object) method)
public static Collection grep(Object[] self, Object filter)
public static Collection grep(Object self)
@SuppressWarnings* assert items.grep() == [1, 2, true, 'foo', [4, 5]] public static Collection grep(Collection self)
@SuppressWarnings* @param self the Iterator from which we count the number of matching occurrences public static Collection grep(Object[] self)
protected static void groupAnswer(Map answer, Object element, Object value)
public static Map groupBy(Collection self, Closure closure)
public static Map groupBy(Collection self, Object... closures)
public static Map groupBy(Collection self, List closures)
Example usage:
def result = [1,2,3,4,5,6].groupBy([{ it % 2 }, { it < 4 }]) assert result == [1:[(true):[1, 3], (false):[5]], 0:[(true):[2], (false):[4, 6]]]Another example:
def sql = groovy.sql.Sql.newInstance(/* ... */) def data = sql.rows("SELECT * FROM a_table").groupBy([{ it.column1 }, { it.column2 }, { it.column3 }]) if (data.val1.val2.val3) { // there exists a record where: // a_table.column1 == val1 // a_table.column2 == val2, and // a_table.column3 == val3 } else { // there is no such record }If an empty list of closures is supplied the IDENTITY Closure will be used.
self
- a collection to groupclosures
- a list of closures, each mapping entries on keys
public static Map groupBy(Map self, Closure closure)
public static Map groupBy(Map self, Object... closures)
public static Map groupBy(Map self, List closures)
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.
self
- a map to groupclosures
- a list of closures that map entries on keys
public static Map groupEntriesBy(Map self, Closure closure)
@Deprecated public static boolean hasGroup(Matcher matcher)
public static MetaProperty hasProperty(Object self, String name)
public static Object head(List self)
def list = [3, 4, 2] assert list.tail() == [4, 2] assert list == [3, 4, 2]
self
- a List
public static Object head(Object[] self)
public static Object identity(Object self, Closure closure)
public static Boolean implies(Boolean left, Boolean right)
public static Object inject(Collection self, Closure closure)
public static Object inject(Collection self, Object initialValue, Closure closure)
public static Object inject(Map self, Object initialValue, Closure closure)
public static Object inject(Iterator self, Object initialValue, Closure closure)
public static Object inject(Object self, Closure closure)
self
- an ObjectinitialValue
- some initial valueclosure
- a closure
public static Object inject(Object self, Object initialValue, Closure closure)
self
- an Object[]closure
- a closure
public static Object inject(Object[] self, Closure closure)
public static Object inject(Object[] self, Object initialValue, Closure closure)
assert 1+2+3+4 == [1,2,3,4].sum()
self
- Collection of values to add together
public static String inspect(Object self)
self
- any Object
public static Number intdiv(Character left, Number right)
self
- a BitSet
public static Number intdiv(Number left, Character right)
left
- a BitSetright
- another BitSet to bitwise AND
public static Number intdiv(Character left, Character right)
left
- a Numberright
- another Number to bitwse XOR
public static Number intdiv(Number left, Number right)
public static Collection intersect(Collection left, Collection right)
public static Map intersect(Map left, Map right)
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
left
- a Collectionright
- a Collectiontrue
if the intersection of two collections
is empty, false
otherwise.
public static Object invokeMethod(Object object, String method, Object arguments)
public static boolean is(Object self, Object other)
def same = this.is(that)
self
- an objectother
- an object to compare identity with
@Deprecated public static boolean isAllWhitespace(CharSequence self)
@Deprecated public static boolean isAllWhitespace(String self)
@Deprecated public static boolean isBigDecimal(CharSequence self)
@Deprecated public static boolean isBigDecimal(String self)
@Deprecated public static boolean isBigInteger(CharSequence self)
@Deprecated public static boolean isBigInteger(String self)
public static boolean isCase(Object caseValue, Object switchValue)
public static boolean isCase(Class caseValue, Object switchValue)
public static boolean isCase(Collection caseValue, Object switchValue)
public static boolean isCase(Map caseValue, Object switchValue)
public static boolean isCase(Number caseValue, Number switchValue)
@Deprecated public static boolean isCase(CharSequence caseValue, Object switchValue)
@Deprecated public static boolean isCase(GString caseValue, Object switchValue)
@Deprecated public static boolean isCase(Pattern caseValue, Object switchValue)
@Deprecated public static boolean isCase(String caseValue, Object switchValue)
public static boolean isDigit(Character self)
@Deprecated public static boolean isDouble(CharSequence self)
@Deprecated public static boolean isDouble(String self)
@Deprecated public static boolean isFloat(CharSequence self)
@Deprecated public static boolean isFloat(String self)
@Deprecated public static boolean isInteger(CharSequence self)
@Deprecated public static boolean isInteger(String self)
public static boolean isLetter(Character self)
self
- a Number
public static boolean isLetterOrDigit(Character self)
self
- a Number
@Deprecated public static boolean isLong(CharSequence self)
@Deprecated public static boolean isLong(String self)
public static boolean isLowerCase(Character self)
self
- a Number
@Deprecated public static boolean isNumber(CharSequence self)
@Deprecated public static boolean isNumber(String self)
public static boolean isUpperCase(Character self)
public static boolean isWhitespace(Character self)
public static Iterator iterator(Object[] a)
public static Iterator iterator(Object o)
public static Iterator iterator(Enumeration enumeration)
public static Iterator iterator(Iterator self)
@Deprecated public static Iterator iterator(Matcher matcher)
@Deprecated public static Iterator iterator(Reader self)
@Deprecated public static Iterator iterator(InputStream self)
@Deprecated public static Iterator iterator(DataInputStream self)
public static String join(Iterator self, String separator)
toString()
representation of each
item in this collection, with the given String as a separator between
each item.
assert "1, 2, 3" == [1,2,3].join(", ")
self
- a Collection of objectsseparator
- a String separator
public static String join(Collection self, String separator)
public static String join(Object[] self, String separator)
public static Object last(List self)
public static Object last(Iterable self)
def array = [3, 4, 2].toArray() assert array.last() == 2
self
- an array
public static Object last(Object[] self)
def list = [3, 4, 2] assert list.first() == 3 // check original is unaltered assert list == [3, 4, 2]
self
- a List
public static Collection leftShift(Collection self, Object value)
self
- a Mapentry
- a Map.Entry to be added to the Map.
public static BlockingQueue leftShift(BlockingQueue self, Object value)
public static Map leftShift(Map self, Map.Entry entry)
public static Map leftShift(Map self, Map other)
self
- a Number objectoperand
- the shift distance by which to right shift (unsigned) the number
public static Number leftShift(Number self, Number operand)
array
- a byte arrayrange
- a range indicating the indices for the items to retrieve
@Deprecated public static StringBuilder leftShift(CharSequence self, Object value)
@Deprecated public static StringBuffer leftShift(String self, Object value)
@Deprecated public static StringBuffer leftShift(StringBuffer self, Object value)
@Deprecated public static StringBuilder leftShift(StringBuilder self, Object value)
@Deprecated public static Writer leftShift(Socket self, Object value)
@Deprecated public static OutputStream leftShift(Socket self, byte[] value)
@Deprecated public static Writer leftShift(Writer self, Object value)
@Deprecated public static Writer leftShift(OutputStream self, Object value)
@Deprecated public static void leftShift(ObjectOutputStream self, Object value)
@Deprecated public static OutputStream leftShift(OutputStream self, InputStream in)
@Deprecated public static OutputStream leftShift(OutputStream self, byte[] value)
@Deprecated public static File leftShift(File file, Object text)
@Deprecated public static File leftShift(File file, byte[] bytes)
@Deprecated public static File leftShift(File file, InputStream data)
@Deprecated public static boolean matches(CharSequence self, Pattern pattern)
@Deprecated public static boolean matches(String self, Pattern pattern)
public static Map.Entry max(Map self, Closure closure)
public static Object max(Collection self)
public static Object max(Iterator self)
public static Object max(Object[] self)
public static Object max(Collection self, Closure closure)
public static Object max(Iterator self, Closure closure)
self
- an Object arrayclosure
- a Closure used to determine the correct ordering
public static Object max(Object[] self, Closure closure)
assert "hello" == ["hello","hi","hey"].max( { a, b -> a.length() <=> b.length() } as Comparator )
self
- a Collectioncomparator
- a Comparator
public static Object max(Collection self, Comparator comparator)
public static Object max(Iterator self, Comparator comparator)
size()
method for Iterator
.
The iterator will become exhausted of elements after determining the size value.
self
- an Iterator
public static Object max(Object[] self, Comparator comparator)
public static MetaClass metaClass(Class self, Closure closure)
enumeration
- an Enumeration object
public static MetaClass metaClass(Object self, Closure closure)
self
- an iterator object
public static Object min(Collection self)
self
- an Iterator
public static Object min(Iterator self)
public static Object min(Object[] self)
public static Object min(Collection self, Comparator comparator)
public static Object min(Iterator self, Comparator comparator)
public static Object min(Object[] self, Comparator comparator)
public static Object min(Collection self, Closure closure)
public static Map.Entry min(Map self, Closure closure)
public static Object min(Iterator self, Closure closure)
self
- an Object arrayclosure
- a Closure used to determine the correct ordering
public static Object min(Object[] self, Closure closure)
assert 5 == [2,3,1,5,4].max()
self
- a Collection
public static Set minus(Set self, Collection removeMe)
self
- a Set objectremoveMe
- the items to remove from the Set
public static Set minus(Set self, Iterable removeMe)
self
- an object arrayremoveMe
- a Collection of elements to remove
public static Set minus(Set self, Object removeMe)
self
- an object arrayremoveMe
- an array of elements to remove
@SuppressWarnings public static Object[] minus(Object[] self, Iterable removeMe)
assert [1, "a", true, true, false, 5.3] - [true, 5.3] == [1, "a", false]
self
- a ListremoveMe
- a Collection of elements to remove
@SuppressWarningsif (Number.class.isInstance(t)) { public static Object[] minus(Object[] self, Object[] removeMe)
public static List minus(List self, Collection removeMe)
public static List minus(List self, Iterable removeMe)
class AbcIterable implements Iterable{ Iterator iterator() { "abc".iterator() } } assert "backtrack".toList() - new AbcIterable() == ["k", "t", "r", "k"]
self
- a ListremoveMe
- an Iterable of elements to remove
public static List minus(List self, Object removeMe)
@SuppressWarnings/** public static Object[] minus(Object[] self, Object removeMe)
assert [1,2,3,4,5] == [1,[2,3],[[4]],[],5].flatten()
self
- a Collection to flatten
public static Map minus(Map self, Map removeMe)
self
- an Array to flatten
public static Number minus(Character left, Number right)
public static Number minus(Number left, Character right)
self
- a Numberexponent
- a Number exponent
public static Number minus(Character left, Character right)
@Deprecated public static CharSequence minus(CharSequence self, Object target)
@Deprecated public static String minus(String self, Object target)
public static void mixin(MetaClass self, List categoryClasses)
public static void mixin(Class self, List categoryClasses)
public static void mixin(Class self, Class categoryClass)
public static void mixin(Class self, Class[] categoryClass)
public static void mixin(MetaClass self, Class categoryClass)
public static void mixin(MetaClass self, Class[] categoryClass)
public static Number mod(Number left, Number right)
public static List multiply(Collection self, Number factor)
public static Number multiply(Character left, Number right)
public static Number multiply(Number left, Character right)
public static Number multiply(Character left, Character right)
self
- an Integerexponent
- an Integer exponent
public static Number multiply(BigDecimal left, Double right)
public static Number multiply(BigDecimal left, BigInteger right)
@Deprecated public static CharSequence multiply(CharSequence self, Number factor)
@Deprecated public static String multiply(String self, Number factor)
@Deprecated public static DataInputStream newDataInputStream(File file)
@Deprecated public static DataOutputStream newDataOutputStream(File file)
@Deprecated public static BufferedInputStream newInputStream(File file)
@Deprecated public static BufferedInputStream newInputStream(URL url)
@Deprecated public static BufferedInputStream newInputStream(URL url, Map parameters)
@SuppressWarnings} public static Object newInstance(Class c)
self
- the class whose metaclass we wish to setmetaClass
- the new MetaClass
@SuppressWarnings((ExpandoMetaClass) mc).define(closure); public static Object newInstance(Class c, Object[] args)
self
- the class whose metaclass we wish to updateclosure
- the closure representing the new metaclass
@Deprecated public static ObjectInputStream newObjectInputStream(File file)
@Deprecated public static ObjectInputStream newObjectInputStream(InputStream inputStream)
@Deprecated public static ObjectInputStream newObjectInputStream(InputStream inputStream, ClassLoader classLoader)
@Deprecated public static ObjectInputStream newObjectInputStream(File file, ClassLoader classLoader)
@Deprecated public static ObjectOutputStream newObjectOutputStream(File file)
@Deprecated public static ObjectOutputStream newObjectOutputStream(OutputStream outputStream)
@Deprecated public static BufferedOutputStream newOutputStream(File file)
@Deprecated public static PrintWriter newPrintWriter(File file)
@Deprecated public static PrintWriter newPrintWriter(File file, String charset)
@Deprecated public static PrintWriter newPrintWriter(Writer writer)
@Deprecated public static BufferedReader newReader(File file)
@Deprecated public static BufferedReader newReader(File file, String charset)
@Deprecated public static BufferedReader newReader(InputStream self)
@Deprecated public static BufferedReader newReader(InputStream self, String charset)
@Deprecated public static BufferedReader newReader(URL url)
@Deprecated} public static BufferedReader newReader(URL url, Map parameters)
@Deprecated public static BufferedReader newReader(URL url, String charset)
@Deprecated public static BufferedReader newReader(URL url, Map parameters, String charset)
@Deprecated public static BufferedWriter newWriter(File file)
@Deprecated public static BufferedWriter newWriter(File file, boolean append)
@Deprecated public static BufferedWriter newWriter(File file, String charset, boolean append)
@Deprecated public static BufferedWriter newWriter(File file, String charset)
public static Character next(Character self)
left
- a Numberright
- a Character
public static Number next(Number self)
@Deprecated public static CharSequence next(CharSequence self)
@Deprecated public static String next(String self)
@Deprecated public static CharSequence normalize(CharSequence self)
@Deprecated public static String normalize(String self)
public static int numberAwareCompareTo(Comparable self, Comparable other)
self
- a Comparableother
- another Comparable
public static Number or(Number left, Number right)
public static BitSet or(BitSet left, BitSet right)
public static Boolean or(Boolean left, Boolean right)
self
- the iteration object over which to iterateclosure
- the filter to perform a match on the collection
@Deprecated public static CharSequence padLeft(CharSequence self, Number numberOfChars)
@Deprecated public static CharSequence padLeft(CharSequence self, Number numberOfChars, CharSequence padding)
@Deprecated public static String padLeft(String self, Number numberOfChars)
@Deprecated public static String padLeft(String self, Number numberOfChars, String padding)
@Deprecated public static CharSequence padRight(CharSequence self, Number numberOfChars)
@Deprecated public static CharSequence padRight(CharSequence self, Number numberOfChars, CharSequence padding)
@Deprecated public static String padRight(String self, Number numberOfChars)
@Deprecated public static String padRight(String self, Number numberOfChars, String padding)
public static Set permutations(List self)
public static Map plus(Map left, Map right)
self
- a Mapkey
- an Object as a key for the mapvalue
- the value to put into the map
public static Map plus(Map self, Collection entries)
@SuppressWarnings* @param right a Collection to be appended public static Object[] plus(Object[] left, Object[] right)
@SuppressWarnings* assert result.class.array public static Object[] plus(Object[] left, Object right)
@SuppressWarnings*assert [1,2,3,4] == [1,2] + [3,4]public static Object[] plus(Object[] left, Collection right)
@SuppressWarnings* @since 1.8.7 public static Object[] plus(Object[] left, Iterable right)
public static Collection plus(Collection left, Collection right)
public static Collection plus(Collection left, Iterable right)
public static List plus(List self, int index, Object[] items)
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.
self
- an original Listadditions
- a List containing elements to be merged with elements from the original Listindex
- index at which to insert the first element from the given additions List
public static List plus(List self, int index, List additions)
self
- an original listadditions
- an Iterable containing elements to be merged with the elements from the original Listindex
- index at which to insert the first element from the given additions Iterable
public static List plus(List self, int index, Iterable additions)
public static Collection plus(Collection left, Object right)
public static Number plus(Character left, Number right)
public static Number plus(Number left, Character right)
public static Number plus(Character left, Character right)
@Deprecated public static CharSequence plus(CharSequence left, Object value)
@Deprecated public static String plus(Number value, String right)
@Deprecated public static String plus(String left, Object value)
@Deprecated public static String plus(StringBuffer left, String value)
public static Object pop(List self)
public static Number power(Number self, Number exponent)
public static Number power(BigDecimal self, Integer exponent)
left
- a Characterright
- another Character
public static Number power(BigInteger self, Integer exponent)
left
- a Characterright
- a Number
public static Number power(Integer self, Integer exponent)
left
- a Numberright
- a Character
public static Number power(Long self, Integer exponent)
left
- a Numberright
- another Number
public static Character previous(Character self)
public static Number previous(Number self)
@Deprecated public static CharSequence previous(CharSequence self)
@Deprecated public static String previous(String self)
protected static Object primitiveArrayGet(Object self, int idx)
protected static List primitiveArrayGet(Object self, Range range)
protected static List primitiveArrayGet(Object self, Collection indices)
self
- the array within which we count the number of occurrencesvalue
- the value being searched for
protected static Object primitiveArrayPut(Object self, int idx, Object newValue)
self
- the array we are searchingvalue
- the value being searched for
public static void print(Object self, Object value)
self
- any Objectvalue
- the value to print
public static void print(PrintWriter self, Object value)
self
- a PrintWritervalue
- the value to print
public static void print(PrintStream self, Object value)
public static void print(Closure self, Object value)
public static void print(Object self, PrintWriter out)
public static void printf(Object self, String format, Object[] values)
public static void printf(Object self, String format, Object arg)
public static void println(Object self)
public static void println(Closure self)
self
- a closure
public static void println(Object self, Object value)
self
- any Objectvalue
- the value to print
public static void println(PrintWriter self, Object value)
self
- a PrintWritervalue
- the value to print
public static void println(PrintStream self, Object value)
public static void println(Closure self, Object value)
public static void println(Object self, PrintWriter out)
public static boolean push(List self, Object value)
public static Map putAll(Map self, Collection entries)
public static void putAt(Object self, String property, Object newValue)
public static void putAt(List self, int idx, Object value)
def list = ["a", true] list[1..<1] = 5 assert list == ["a", 5, true]
self
- a Listrange
- the (in this case empty) subset of the list to setvalue
- the values to put at the given sublist or a Collection of values
public static void putAt(List self, EmptyRange range, Object value)
def list = ["a", true] list[1..<1] = [4, 3, 2] assert list == ["a", 4, 3, 2, true]
self
- a Listrange
- the (in this case empty) subset of the list to setvalue
- the Collection of values
public static void putAt(List self, EmptyRange range, Collection value)
public static void putAt(List self, IntRange range, Collection col)
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.
self
- a Listrange
- the subset of the list to setvalue
- the value to put at the given sublist
public static void putAt(List self, IntRange range, Object value)
public static void putAt(List self, List splice, List values)
public static void putAt(List self, List splice, Object value)
public static Object putAt(Map self, Object key, Object value)
public static void putAt(BitSet self, IntRange range, boolean value)
self
- a BitSetrange
- the range of values to setvalue
- value
public static void putAt(BitSet self, int index, boolean value)
array
- a byte array
@Deprecated public static void putAt(StringBuffer self, EmptyRange range, Object value)
@Deprecated public static void putAt(StringBuffer self, IntRange range, Object value)
@Deprecated public static byte[] readBytes(File file)
@Deprecated public static String readLine(Reader self)
@Deprecated public static List readLines(CharSequence self)
@Deprecated public static List readLines(String self)
@Deprecated public static List readLines(File file)
@Deprecated public static List readLines(File file, String charset)
@Deprecated public static List readLines(InputStream stream)
@Deprecated public static List readLines(InputStream stream, String charset)
@Deprecated public static List readLines(URL self)
@Deprecated public static List readLines(URL self, String charset)
@Deprecated public static List readLines(Reader reader)
public static boolean removeAll(Collection self, Object[] items)
public static boolean removeAll(Collection self, Closure condition)
@Deprecated public static boolean renameTo(File self, String newPathName)
@Deprecated public static CharSequence replaceAll(CharSequence self, CharSequence regex, CharSequence replacement)
@Deprecated public static CharSequence replaceAll(CharSequence self, CharSequence regex, Closure closure)
@Deprecated public static CharSequence replaceAll(CharSequence self, Pattern pattern, CharSequence replacement)
@Deprecated public static String replaceAll(CharSequence self, Pattern pattern, Closure closure)
@Deprecated public static String replaceAll(String self, Pattern pattern, Closure closure)
@Deprecated public static String replaceAll(String self, Pattern pattern, String replacement)
@Deprecated public static String replaceAll(String self, String regex, Closure closure)
@Deprecated public static String replaceFirst(CharSequence self, CharSequence regex, CharSequence replacement)
@Deprecated public static String replaceFirst(CharSequence self, CharSequence regex, Closure closure)
@Deprecated public static CharSequence replaceFirst(CharSequence self, Pattern pattern, CharSequence replacement)
@Deprecated public static String replaceFirst(CharSequence self, Pattern pattern, Closure closure)
@Deprecated public static String replaceFirst(String self, Pattern pattern, Closure closure)
@Deprecated public static String replaceFirst(String self, Pattern pattern, String replacement)
@Deprecated public static String replaceFirst(String self, String regex, Closure closure)
public static List respondsTo(Object self, String name, Object[] argTypes)
public static List respondsTo(Object self, String name)
public static boolean retainAll(Collection self, Object[] items)
public static boolean retainAll(Collection self, Closure condition)
public static List reverse(List self)
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"]
self
- a Listmutate
- true if the list itself should be reversed in place and returned, false if a new list should be created
public static List reverse(List self, boolean mutate)
self
- an array
@SuppressWarnings* @since 1.5.5 public static Object[] reverse(Object[] self)
@SuppressWarnings* @param left the left Array public static Object[] reverse(Object[] self, boolean mutate)
public static Iterator reverse(Iterator self)
@Deprecated public static CharSequence reverse(CharSequence self)
@Deprecated public static String reverse(String self)
public static Map reverseEach(Map self, Closure closure)
public static List reverseEach(List self, Closure closure)
public static Object[] reverseEach(Object[] self, Closure closure)
public static Number rightShift(Number self, Number operand)
array
- a char arrayrange
- a range indicating the indices for the items to retrieve
public static Number rightShiftUnsigned(Number self, Number operand)
array
- a short arrayrange
- a range indicating the indices for the items to retrieve
public static int round(Float number)
public static float round(Float number, int precision)
public static long round(Double number)
public static double round(Double number, int precision)
self
- a Character to convert
public static TimerTask runAfter(Timer timer, int delay, Closure closure)
self
- the iteration object over which to iterateclosure
- the filter to perform a match on the collection
@Deprecated public static void setBytes(File file, byte[] bytes)
@Deprecated public static void setBytes(OutputStream os, byte[] bytes)
@Deprecated public static void setIndex(Matcher matcher, int idx)
public static void setMetaClass(Class self, MetaClass metaClass)
public static void setMetaClass(Object self, MetaClass metaClass)
public static void setMetaClass(GroovyObject self, MetaClass metaClass)
@Deprecated public static void setText(File file, String text)
@Deprecated public static void setText(File file, String text, String charset)
public static int size(Iterator self)
public static int size(Object[] self)
public static int size(boolean[] array)
public static int size(byte[] array)
public static int size(char[] array)
array
- a short array
public static int size(short[] array)
array
- an int array
public static int size(int[] array)
public static int size(long[] array)
public static int size(float[] array)
public static int size(double[] array)
@Deprecated public static int size(CharSequence text)
@Deprecated public static long size(Matcher self)
@Deprecated public static int size(String text)
@Deprecated public static int size(StringBuffer buffer)
@Deprecated public static long size(File self)
public static List sort(Collection self)
public static List sort(Collection self, boolean mutate)
def map = [a:5, b:3, c:6, d:4].sort { a, b -> a.value <=> b.value } assert map == [b:3, d:4, a:5, c:6]
self
- the original unsorted mapclosure
- a Closure used as a comparator
public static Map sort(Map self, Closure closure)
public static Map sort(Map self, Comparator comparator)
public static Map sort(Map self)
public static Object[] sort(Object[] self)
public static Object[] sort(Object[] self, boolean mutate)
self
- the Iterator to be sorted
public static Iterator sort(Iterator self)
public static Iterator sort(Iterator self, Comparator comparator)
public static List sort(Collection self, Comparator comparator)
public static List sort(Collection self, boolean mutate, Comparator comparator)
self
- the array to be sortedcomparator
- a Comparator used for the comparison
public static Object[] sort(Object[] self, Comparator comparator)
public static Object[] sort(Object[] self, boolean mutate, Comparator comparator)
self
- the Iterator to be sortedclosure
- a Closure used to determine the correct ordering
public static Iterator sort(Iterator self, Closure closure)
@SuppressWarnings*/ public static Object[] sort(Object[] self, Closure closure)
@SuppressWarnings* @since 1.0 public static Object[] sort(Object[] self, boolean mutate, Closure closure)
public static List sort(Collection self, Closure closure)
public static List sort(Collection self, boolean mutate, Closure closure)
self
- an already sorted set
public static SortedSet sort(SortedSet self)
def list = ["a", false, 2] assert list.pop() == 2 assert list == ["a", false]
self
- a List
public static SortedMap sort(SortedMap self)
public static Collection split(Object self, Closure closure)
public static Collection split(Collection self, Closure closure)
@Deprecated public static CharSequence[] split(CharSequence self)
@Deprecated public static String[] split(GString self)
@Deprecated public static String[] split(String self)
@Deprecated public static Object splitEachLine(CharSequence self, CharSequence regex, Closure closure)
@Deprecated public static Object splitEachLine(CharSequence self, Pattern pattern, Closure closure)
@Deprecated public static Object splitEachLine(String self, Pattern pattern, Closure closure)
@Deprecated public static Object splitEachLine(String self, String regex, Closure closure)
@Deprecated public static Object splitEachLine(File self, String regex, Closure closure)
@Deprecated public static Object splitEachLine(File self, Pattern pattern, Closure closure)
@Deprecated public static Object splitEachLine(File self, String regex, String charset, Closure closure)
@Deprecated public static Object splitEachLine(File self, Pattern pattern, String charset, Closure closure)
@Deprecated public static Object splitEachLine(URL self, String regex, Closure closure)
@Deprecated public static Object splitEachLine(URL self, Pattern pattern, Closure closure)
@Deprecated public static Object splitEachLine(URL self, String regex, String charset, Closure closure)
@Deprecated public static Object splitEachLine(URL self, Pattern pattern, String charset, Closure closure)
@Deprecated public static Object splitEachLine(Reader self, String regex, Closure closure)
@Deprecated public static Object splitEachLine(Reader self, Pattern pattern, Closure closure)
@Deprecated public static Object splitEachLine(InputStream stream, String regex, String charset, Closure closure)
@Deprecated public static Object splitEachLine(InputStream stream, Pattern pattern, String charset, Closure closure)
@Deprecated public static Object splitEachLine(InputStream stream, String regex, Closure closure)
@Deprecated public static Object splitEachLine(InputStream stream, Pattern pattern, Closure closure)
public static SpreadMap spread(Map self)
public static String sprintf(Object self, String format, Object[] values)
public static String sprintf(Object self, String format, Object arg)
public static void step(Number self, Number to, Number stepNumber, Closure closure)
number
- a Float
@Deprecated public static CharSequence stripIndent(CharSequence self)
@Deprecated} public static CharSequence stripIndent(CharSequence self, int numChars)
@Deprecated} public static String stripIndent(String self)
@Deprecated} public static String stripIndent(String self, int numChars)
@Deprecated} public static CharSequence stripMargin(CharSequence self)
@Deprecated} public static CharSequence stripMargin(CharSequence self, char marginChar)
@Deprecated} public static String stripMargin(CharSequence self, CharSequence marginChar)
@Deprecated} public static String stripMargin(String self)
@Deprecated} public static String stripMargin(String self, char marginChar)
@Deprecated} public static String stripMargin(String self, String marginChar)
public static Map subMap(Map map, Collection keys)
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
map
- a Mapkeys
- an array of keys
public static Map subMap(Map map, Object[] keys)
def map=[:] map.get("a", []) << 5 assert map == [a:[5]]
map
- a Mapkey
- the key to lookup the value ofdefaultValue
- the value to return and add to the map for this key if
there is no entry for the given key
public static Set subsequences(List self)
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
self
- the Collection of items
public static Object sum(Collection self)
self
- The array of values to add together
public static Object sum(Object[] self)
public static Object sum(Iterator self)
public static Object sum(Collection self, Object initialValue)
public static Object sum(Object[] self, Object initialValue)
public static Object sum(Iterator self, Object initialValue)
public static Object sum(Collection self, Closure closure)
array.sum(closure)
is equivalent to:
array.collect(closure).sum()
.
self
- An arrayclosure
- a single parameter closure that returns a numeric value.
public static Object sum(Object[] self, Closure closure)
public static Object sum(Iterator self, Closure closure)
public static Object sum(Collection self, Object initialValue, Closure closure)
public static Object sum(Object[] self, Object initialValue, Closure closure)
public static Object sum(Iterator self, Object initialValue, Closure closure)
public static List tail(List self)
public static Object[] tail(Object[] self)
num
elements from the head of this list.
def strings = [ 'a', 'b', 'c' ] assert strings.take( 0 ) == [] assert strings.take( 2 ) == [ 'a', 'b' ] assert strings.take( 5 ) == [ 'a', 'b', 'c' ]Similar to take(Iterable, int) except that it attempts to preserve the type of the original list.
self
- the original listnum
- the number of elements to take from this listnum
elements of this list,
or else the whole list if it has less then num
elements.
public static List take(List self, int num)
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[]
self
- the original arraynum
- the number of elements to take from this arraynum
elements of this array,
or else the whole array if it has less then num
elements.
public static Object[] take(Object[] self, int num)
public static List take(Iterable self, int num)
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 ]
self
- the original mapnum
- the number of elements to take from this mapnum
elements of this map,
or else the whole map if it has less then num
elements.
public static Map take(Map self, int num)
@SuppressWarningspublic static CharSequence take(CharSequence self, int num) { public static Iterator take(Iterator self, int num)
@Deprecatedret.addAll(self); public static CharSequence take(CharSequence self, int num)
public static List takeWhile(List self, Closure condition)
public static List takeWhile(Iterable self, Closure condition)
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.
self
- a Mapcondition
- a 1 (or 2) arg Closure that must evaluate to true for the
entry (or key and value) to continue taking elements
public static Map takeWhile(Map self, Closure condition)
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[]
self
- the original arraycondition
- the closure that must evaluate to true to
continue taking elements
public static Object[] takeWhile(Object[] self, Closure condition)
public static Iterator takeWhile(Iterator self, Closure condition)
public static void times(Number self, Closure closure)
public static String toArrayString(Object[] self)
public static BigDecimal toBigDecimal(Number self)
left
- left operatorright
- right operator
@Deprecated} public static BigDecimal toBigDecimal(CharSequence self)
@Deprecated} public static BigDecimal toBigDecimal(String self)
public static BigInteger toBigInteger(Number self)
self
- the iteration object over which to iterateclosure
- the filter to perform a match on the collection
@Deprecated} public static BigInteger toBigInteger(CharSequence self)
@Deprecated} public static BigInteger toBigInteger(String self)
public static Boolean toBoolean(Boolean self)
@Deprecated} public static Boolean toBoolean(String self)
@Deprecated} public static Character toCharacter(String self)
public static Double toDouble(Number self)
left
- left operatorright
- right operator
@Deprecated} public static Double toDouble(CharSequence self)
@Deprecated} public static Double toDouble(String self)
public static Float toFloat(Number self)
left
- left operatorright
- right operator
@Deprecated} public static Float toFloat(CharSequence self)
@Deprecated} public static Float toFloat(String self)
public static Integer toInteger(Number self)
@Deprecated} public static Integer toInteger(CharSequence self)
@Deprecated} public static Integer toInteger(String self)
public static List toList(Collection self)
self
- an iterator
public static List toList(Iterator self)
public static List toList(Iterable self)
self
- an enumeration
public static List toList(Enumeration self)
public static List toList(Object[] array)
@SuppressWarnings public static List toList(byte[] array)
array
- a byte array
@SuppressWarnings public static List toList(boolean[] array)
array
- a boolean array
@SuppressWarnings public static List toList(char[] array)
array
- a char array
@SuppressWarnings public static List toList(short[] array)
array
- a short array
@SuppressWarnings public static List toList(int[] array)
array
- an int array
@SuppressWarnings public static List toList(long[] array)
array
- a long array
@SuppressWarnings public static List toList(float[] array)
array
- a float array
@SuppressWarnings public static List toList(double[] array)
array
- a double array
@Deprecated public static List toList(CharSequence self)
@Deprecated public static List toList(String self)
public static String toListString(Collection self)
public static String toListString(Collection self, int maxSize)
public static Long toLong(Number self)
@Deprecated public static Long toLong(CharSequence self)
@Deprecated public static Long toLong(String self)
public static char toLowerCase(Character self)
public static String toMapString(Map self)
self
- a Character
public static String toMapString(Map self, int maxSize)
@SuppressWarnings* @return a Set public static Set toSet(byte[] array)
@SuppressWarnings* @param self an iterator public static Set toSet(boolean[] array)
@SuppressWarnings* Convert an enumeration to a Set. public static Set toSet(char[] array)
@SuppressWarnings public static Set toSet(short[] array)
@SuppressWarnings/** public static Set toSet(int[] array)
self
- an array objectidx
- the index of interest
@SuppressWarnings} public static Set toSet(long[] array)
self
- an array objectrange
- the range of indices of interest
@SuppressWarnings*/ public static Set toSet(float[] array)
@SuppressWarningsreturn answer; public static Set toSet(double[] array)
public static Set toSet(Collection self)
self
- an objectidx
- the index of interestnewValue
- the new value to be put into the index of interest
public static Set toSet(Iterator self)
public static Set toSet(Enumeration self)
@Deprecated public static Set toSet(CharSequence self)
@Deprecated public static Set toSet(String self)
@Deprecated public static Short toShort(CharSequence self)
@Deprecated public static Short toShort(String self)
public static SpreadMap toSpreadMap(Map self)
self
- an object array
public static SpreadMap toSpreadMap(Object[] self)
public static SpreadMap toSpreadMap(List self)
public static String toString(boolean[] self)
public static String toString(byte[] self)
public static String toString(char[] self)
public static String toString(short[] self)
[1, 2, a]
.
self
- a Collection
public static String toString(int[] self)
public static String toString(long[] self)
public static String toString(float[] self)
public static String toString(double[] self)
public static String toString(AbstractMap self)
public static String toString(AbstractCollection self)
public static String toString(Object[] self)
public static String toString(Object value)
@Deprecated public static URI toURI(CharSequence self)
@Deprecated public static URI toURI(String self)
@Deprecated public static URL toURL(CharSequence self)
@Deprecated public static URL toURL(String self)
public static char toUpperCase(Character self)
@Deprecated} public static List tokenize(CharSequence self)
@Deprecated} public static List tokenize(CharSequence self, Character token)
@Deprecated} public static List tokenize(CharSequence self, CharSequence token)
@Deprecated} @SuppressWarnings public static List tokenize(String self)
@Deprecated public static List tokenize(String self, Character token)
@Deprecated @SuppressWarnings@Deprecated public static List tokenize(String self, String token)
@Deprecated public static CharSequence tr(CharSequence self, CharSequence sourceSet, CharSequence replacementSet)
@Deprecated public static String tr(String self, String sourceSet, String replacementSet)
@Deprecated public static void transformChar(Reader self, Writer writer, Closure closure)
@Deprecated public static void transformLine(Reader reader, Writer writer, Closure closure)
public static List transpose(List self)
@Deprecated public static void traverse(File self, Map options, Closure closure)
@Deprecatedpublic staticT withDataOutputStream(File file, Closure closure) throws IOException { public static void traverse(File self, Closure closure)
@Deprecatedpublic staticT withDataInputStream(File file, Closure closure) throws IOException { public static void traverse(File self, Map options)
public static float trunc(Float number, int precision)
public static float trunc(Float number)
public static double trunc(Double number)
public static double trunc(Double number, int precision)
public static Number unaryMinus(Number left)
@Deprecated public static CharSequence unexpand(CharSequence self)
@Deprecated public static CharSequence unexpand(CharSequence self, int tabStop)
@Deprecated public static String unexpand(String self)
@Deprecated public static String unexpand(String self, int tabStop)
@Deprecated public static CharSequence unexpandLine(CharSequence self, int tabStop)
@Deprecated public static String unexpandLine(String self, int tabStop)
public static Iterator unique(Iterator self)
public static Collection unique(Collection self)
public static Collection unique(Collection self, boolean mutate)
public static Iterator unique(Iterator self, Closure closure)
public static Collection unique(Collection self, Closure closure)
public static Collection unique(Collection self, boolean mutate, Closure closure)
public static Iterator unique(Iterator self, Comparator comparator)
self
- an Iteratorcomparator
- a Comparator
public static Collection unique(Collection self, Comparator comparator)
public static Collection unique(Collection self, boolean mutate, Comparator comparator)
public static void upto(Number self, Number to, Closure closure)
public static void upto(long self, Number to, Closure closure)
public static void upto(Long self, Number to, Closure closure)
public static void upto(float self, Number to, Closure closure)
public static void upto(Float self, Number to, Closure closure)
0.1.upto( 10 ) { println it }Prints numbers 0.1, 1.1, 2.1... to 9.1
self
- a BigDecimalto
- the end numberclosure
- the code to execute for each number
public static void upto(double self, Number to, Closure closure)
public static void upto(Double self, Number to, Closure closure)
self
- a Numberto
- another Number to go down toclosure
- the closure to call
public static void upto(BigInteger self, Number to, Closure closure)
self
- a longto
- the end numberclosure
- the code to execute for each number
public static void upto(BigDecimal self, Number to, Closure closure)
self
- a Longto
- the end numberclosure
- the code to execute for each number
public static Object use(Object self, Class categoryClass, Closure closure)
self
- any ObjectcategoryClass
- a category class to useclosure
- the closure to invoke with the category in place
public static Object use(Object self, List categoryClassList, Closure closure)
public static Object use(Object self, Object[] array)
public static Object with(Object self, Closure closure)
@Deprecated public static Object withDataInputStream(File file, Closure closure)
@Deprecated public static Object withDataOutputStream(File file, Closure closure)
public static Map withDefault(Map self, Closure init)
withLazyDefault
which decorates a list allowing
it to grow when called with index values outside the normal list bounds.
self
- a Listinit
- a Closure with the target index as parameter which generates the default value
public static List withDefault(List self, Closure init)
public static List withEagerDefault(List self, Closure init)
assert [1,2,3] == [3,1,2].sort()
self
- the collection to be sorted
@Deprecated public static Object withInputStream(File file, Closure closure)
@Deprecated public static Object withInputStream(URL url, Closure closure)
public static List withLazyDefault(List self, Closure init)
@Deprecated public static Object withObjectInputStream(File file, Closure closure)
@Deprecated public static Object withObjectInputStream(File file, ClassLoader classLoader, Closure closure)
@Deprecated public static Object withObjectInputStream(InputStream inputStream, Closure closure)
@Deprecated public static Object withObjectInputStream(InputStream inputStream, ClassLoader classLoader, Closure closure)
@Deprecated public static Object withObjectOutputStream(File file, Closure closure)
@Deprecated public static Object withObjectOutputStream(OutputStream outputStream, Closure closure)
@Deprecated public static Object withObjectStreams(Socket socket, Closure closure)
@Deprecated public static Object withOutputStream(File file, Closure closure)
@Deprecated public static Object withPrintWriter(File file, Closure closure)
@Deprecated public static Object withPrintWriter(File file, String charset, Closure closure)
@Deprecated public static Object withPrintWriter(Writer writer, Closure closure)
@Deprecated public static Object withReader(File file, Closure closure)
@Deprecated public static Object withReader(File file, String charset, Closure closure)
@Deprecated public static Object withReader(Reader reader, Closure closure)
@Deprecated public static Object withReader(URL url, Closure closure)
@Deprecated public static Object withReader(URL url, String charset, Closure closure)
@Deprecated public static Object withReader(InputStream in, Closure closure)
@Deprecated public static Object withReader(InputStream in, String charset, Closure closure)
@Deprecated public static Object withStream(InputStream stream, Closure closure)
@Deprecated public static Object withStream(OutputStream os, Closure closure)
@Deprecated public static Object withStreams(Socket socket, Closure closure)
@Deprecated public static Object withWriter(File file, Closure closure)
@Deprecated public static Object withWriter(File file, String charset, Closure closure)
@Deprecated public static Object withWriter(Writer writer, Closure closure)
@Deprecated public static Object withWriter(OutputStream stream, Closure closure)
@Deprecated public static Object withWriter(OutputStream stream, String charset, Closure closure)
@Deprecated public static Object withWriterAppend(File file, String charset, Closure closure)
@Deprecated public static Object withWriterAppend(File file, Closure closure)
@Deprecated public static void write(Writer self, Writable writable)
@Deprecated public static void write(File file, String text)
@Deprecated public static void write(File file, String text, String charset)
@Deprecated public static void writeLine(BufferedWriter writer, String line)
public static BitSet xor(BitSet left, BitSet right)
public static Number xor(Number left, Number right)
public static Boolean xor(Boolean left, Boolean right)
Copyright © 2003-2013 The Codehaus. All rights reserved.