|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.runtime.DefaultGroovyMethods
This class defines all the new groovy methods which appear on normal JDK classes inside the Groovy environment. Static methods are used with the first parameter the destination class.
Nested Class Summary | |
protected static class |
DefaultGroovyMethods.ProcessRunner
A Runnable which waits for a process to complete together with a notification scheme allowing another thread to wait a maximum number of seconds for the process to complete before killing it. |
protected static class |
DefaultGroovyMethods.RangeInfo
|
Constructor Summary | |
DefaultGroovyMethods()
|
Method Summary | |
static double |
abs(Double number)
Get the absolute value |
static float |
abs(Float number)
Get the absolute value |
static long |
abs(Long number)
Get the absolute value |
static int |
abs(Number number)
Get the absolute value |
static Socket |
accept(ServerSocket serverSocket,
Closure closure)
Allow to pass a Closure to the accept methods of ServerSocket |
static List |
allProperties(Object self)
|
static Number |
and(Number left,
Number right)
Bitwise AND together two Numbers |
static boolean |
any(Object self,
Closure closure)
Iterates over every element of a collection, and check whether a predicate is valid for at least one element |
static void |
append(File file,
String text)
Append the text at the end of the File |
static void |
append(File file,
String text,
String charset)
Append the text at the end of the File with a specified encoding |
static Collection |
asImmutable(Collection self)
A convenience method for creating an immutable Collection |
static List |
asImmutable(List self)
A convenience method for creating an immutable list |
static Map |
asImmutable(Map self)
A convenience method for creating an immutable map |
static Set |
asImmutable(Set self)
A convenience method for creating an immutable list |
static SortedMap |
asImmutable(SortedMap self)
A convenience method for creating an immutable sorted map |
static SortedSet |
asImmutable(SortedSet self)
A convenience method for creating an immutable sorted set |
static List |
asList(Collection self)
Converts the given collection into a List |
static Collection |
asSynchronized(Collection self)
A convenience method for creating a synchronized Collection |
static List |
asSynchronized(List self)
A convenience method for creating a synchronized List |
static Map |
asSynchronized(Map self)
A convenience method for creating a synchronized Map |
static Set |
asSynchronized(Set self)
A convenience method for creating a synchronized Set |
static SortedMap |
asSynchronized(SortedMap self)
A convenience method for creating a synchronized SortedMap |
static SortedSet |
asSynchronized(SortedSet self)
A convenience method for creating a synchronized SortedSet |
static File |
asWritable(File file)
|
static File |
asWritable(File file,
String encoding)
|
protected static Object |
callClosureForMapEntry(Closure closure,
Map.Entry entry)
|
static String |
center(String self,
Number numberOfChars)
Center a String and padd it with spaces appended around it |
static String |
center(String self,
Number numberOfChars,
String padding)
Center a String and padd it with the characters appended around it |
static List |
collect(Collection self,
Closure closure)
Iterates through this collection transforming each entry into a new value using the closure as a transformer, returning a list of transformed values. |
static Collection |
collect(Collection self,
Collection collection,
Closure closure)
Iterates through this collection transforming each entry into a new value using the closure as a transformer, returning a list of transformed values. |
static List |
collect(Map self,
Closure closure)
Iterates through this Map transforming each entry into a new value using the closure as a transformer, returning a list of transformed values. |
static Collection |
collect(Map self,
Collection collection,
Closure closure)
Iterates through this Map transforming each entry into a new value using the closure as a transformer, returning a list of transformed values. |
static List |
collect(Object self,
Closure closure)
Iterates through this object transforming each object into a new value using the closure as a transformer, returning a list of transformed values. |
static Collection |
collect(Object self,
Collection collection,
Closure closure)
Iterates through this object transforming each object into a new value using the closure as a transformer and adding it to the collection, returning the resulting collection. |
static int |
compareTo(Character left,
Character right)
Compare two Characters |
static int |
compareTo(Character left,
Number right)
Compare a Character and a Number |
static int |
compareTo(Number left,
Character right)
Compare a Number and a Character |
static int |
compareTo(Number left,
Number right)
Compare two Numbers |
static boolean |
contains(String self,
String text)
Provide an implementation of contains() like Collection to make Strings more polymorphic This method is not required on JDK 1.5 onwards |
static int |
count(Collection self,
Object value)
Counts the number of occurencies of the given value inside this collection |
static int |
count(String self,
String text)
Count the number of occurencies of a substring |
protected static StringBufferWriter |
createStringBufferWriter(StringBuffer self)
|
protected static StringWriter |
createStringWriter(String self)
|
static byte[] |
decodeBase64(String value)
Decode the Sting from base64 into a byte array |
static Number |
div(Character left,
Character right)
Divide two Characters |
static Number |
div(Character left,
Number right)
Divide a Character by a Number |
static Number |
div(Number left,
Character right)
Divide a Number by a Character |
static Number |
div(Number left,
Number right)
Divide two Numbers |
static void |
downto(BigDecimal self,
Number to,
Closure closure)
|
static void |
downto(BigInteger self,
Number to,
Closure closure)
|
static void |
downto(double self,
Number to,
Closure closure)
|
static void |
downto(Double 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(long self,
Number to,
Closure closure)
|
static void |
downto(Long self,
Number to,
Closure closure)
|
static void |
downto(Number self,
Number to,
Closure closure)
Iterates from this number down to the given number |
static String |
dump(Object self)
Generates a detailed dump string of an object showing its class, hashCode and fields |
static void |
each(Collection self,
Closure closure)
Allows objects to be iterated through using a closure |
static void |
each(Map self,
Closure closure)
Allows a Map to be iterated through using a closure. |
static void |
each(Matcher self,
Closure closure)
Process each matched substring of the given group matcher. |
static void |
each(Object self,
Closure closure)
Allows objects to be iterated through using a closure |
static void |
eachByte(File self,
Closure closure)
Traverse through each byte of the specified File |
static void |
eachByte(InputStream is,
Closure closure)
Traverse through each byte of the specified stream |
static void |
eachByte(URL url,
Closure closure)
Traverse through each byte of the specified URL |
static void |
eachDir(File self,
Closure closure)
Invokes the closure for each directory in the given directory, ignoring regular files. |
static void |
eachFile(File self,
Closure closure)
Invokes the closure for each file in the given directory |
static void |
eachFileMatch(File self,
Object filter,
Closure closure)
Invokes the closure for each file matching the given filter in the given directory - calling the isCase() method used by switch statements. |
static void |
eachFileRecurse(File self,
Closure closure)
Invokes the closure for each file in the given directory and recursively. |
static void |
eachLine(File self,
Closure closure)
Iterates through the given file line by line |
static void |
eachLine(InputStream stream,
Closure closure)
Iterates through the given stream line by line |
static void |
eachLine(Reader self,
Closure closure)
Iterates through the given reader line by line |
static void |
eachLine(URL url,
Closure closure)
Iterates through the lines read from the URL's associated input stream |
static void |
eachMatch(String self,
String regex,
Closure closure)
Process each regex group matched substring of the given string. |
static void |
eachObject(File self,
Closure closure)
Iterates through the given file object by object |
static void |
eachObject(ObjectInputStream ois,
Closure closure)
Iterates through the given object stream object by object |
static void |
eachProperty(Object self,
Closure closure)
|
static void |
eachPropertyName(Object self,
Closure closure)
|
static void |
eachWithIndex(Object self,
Closure closure)
Allows object to be iterated through a closure with a counter |
static Writable |
encodeBase64(byte[] data)
Produce a Writable object which writes the base64 encoding of the byte array Calling toString() on the result rerurns the encoding as a String |
static Writable |
encodeBase64(Byte[] data)
|
static boolean |
every(Object self,
Closure closure)
Iterates over every element of a collection, and check whether a predicate is valid for all elements. |
static Process |
execute(List commandList)
Executes the command specified by the String list that is the parameter. |
static Process |
execute(String self)
Executes the given string as a command line process. |
static Process |
execute(String[] commandArray)
Executes the command specified by the String array that is the parameter. |
static Writable |
filterLine(File self,
Closure closure)
Filters the lines of a File and creates a Writeable in return to stream the filtered lines |
static void |
filterLine(File self,
Writer writer,
Closure closure)
Filter the lines from a File and write them on a writer, according to a closure which returns true or false |
static Writable |
filterLine(InputStream self,
Closure predicate)
Filter lines from an input stream using a closure predicate |
static void |
filterLine(InputStream self,
Writer writer,
Closure predicate)
Filters lines from an input stream, writing to a writer, using a closure which returns boolean and takes a line. |
static Writable |
filterLine(Reader reader,
Closure closure)
Filter the lines of a Reader and create a Writable in return to stream the filtered lines |
static void |
filterLine(Reader reader,
Writer writer,
Closure closure)
Filter the lines from a reader and write them on the writer, according to a closure which returns true or false. |
static Object |
find(Collection self,
Closure closure)
Finds the first value matching the closure condition |
static Object |
find(Map self,
Closure closure)
Finds the first value matching the closure condition |
static Object |
find(Object self,
Closure closure)
Finds the first value matching the closure condition |
static List |
findAll(Collection self,
Closure closure)
Finds all values matching the closure condition |
static Map |
findAll(Map self,
Closure closure)
Finds all entries matching the closure condition. |
static List |
findAll(Object self,
Closure closure)
Finds all values matching the closure condition |
static int |
findIndexOf(Object self,
Closure closure)
Iterates over every element of the collection and return the index of the first object that matches the condition specified in the closure |
static List |
flatten(List self)
Flatten a list |
static Object |
get(Map map,
Object key,
Object defaultValue)
Looks up an item in a Map for the given key and returns the value - unless there is no entry for the given key in which case add the default value to the map and return that. |
static Object |
getAt(boolean[] array,
Collection indices)
|
static Object |
getAt(boolean[] array,
int idx)
|
static Object |
getAt(boolean[] array,
IntRange range)
|
static Object |
getAt(boolean[] array,
ObjectRange range)
|
static Object |
getAt(boolean[] array,
Range range)
|
static Object |
getAt(byte[] array,
Collection indices)
|
static Object |
getAt(byte[] array,
int idx)
|
static Object |
getAt(byte[] array,
IntRange range)
|
static Object |
getAt(byte[] array,
ObjectRange range)
|
static Object |
getAt(byte[] array,
Range range)
|
static Object |
getAt(char[] array,
Collection indices)
|
static Object |
getAt(char[] array,
int idx)
|
static Object |
getAt(char[] array,
IntRange range)
|
static Object |
getAt(char[] array,
ObjectRange range)
|
static Object |
getAt(char[] array,
Range range)
|
static CharSequence |
getAt(CharSequence self,
Collection indices)
Allows a List to be used as the indices to be used on a CharSequence |
static CharSequence |
getAt(CharSequence text,
int index)
Support the subscript operator for String. |
static CharSequence |
getAt(CharSequence text,
IntRange range)
Support the range subscript operator for CharSequence or StringBuffer with IntRange |
static CharSequence |
getAt(CharSequence text,
Range range)
Support the range subscript operator for CharSequence |
static List |
getAt(Collection coll,
String property)
Support the subscript operator for List |
static Object |
getAt(double[] array,
Collection indices)
|
static Object |
getAt(double[] array,
int idx)
|
static Object |
getAt(double[] array,
IntRange range)
|
static Object |
getAt(double[] array,
ObjectRange range)
|
static Object |
getAt(double[] array,
Range range)
|
static Object |
getAt(float[] array,
Collection indices)
|
static Object |
getAt(float[] array,
int idx)
|
static Object |
getAt(float[] array,
IntRange range)
|
static Object |
getAt(float[] array,
ObjectRange range)
|
static Object |
getAt(float[] array,
Range range)
|
static Object |
getAt(int[] array,
Collection indices)
|
static Object |
getAt(int[] array,
int idx)
|
static Object |
getAt(int[] array,
IntRange range)
|
static Object |
getAt(int[] array,
ObjectRange range)
|
static Object |
getAt(int[] array,
Range range)
|
static List |
getAt(List self,
Collection indices)
Allows a List to be used as the indices to be used on a List |
static Object |
getAt(List self,
int idx)
Support the subscript operator for a List |
static List |
getAt(List self,
IntRange range)
Support the range subscript operator for a List |
static Object |
getAt(long[] array,
Collection indices)
|
static Object |
getAt(long[] array,
int idx)
|
static Object |
getAt(long[] array,
IntRange range)
|
static Object |
getAt(long[] array,
ObjectRange range)
|
static Object |
getAt(long[] array,
Range range)
|
static Object |
getAt(Map self,
Object key)
Support the subscript operator for a List |
static String |
getAt(Matcher self,
Collection indices)
Allows a List to be used as the indices to be used on a Matcher |
static Object |
getAt(Matcher matcher,
int idx)
Support the subscript operator, e.g. |
static List |
getAt(Object[] self,
Collection indices)
Allows a List to be used as the indices to be used on a List |
static Object |
getAt(Object[] array,
int idx)
Support the subscript operator for an Array |
static List |
getAt(Object[] array,
IntRange range)
|
static List |
getAt(Object[] array,
ObjectRange range)
|
static List |
getAt(Object[] array,
Range range)
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 Object |
getAt(short[] array,
Collection indices)
|
static Object |
getAt(short[] array,
int idx)
|
static Object |
getAt(short[] array,
IntRange range)
|
static Object |
getAt(short[] array,
ObjectRange range)
|
static Object |
getAt(short[] array,
Range range)
|
static String |
getAt(String self,
Collection indices)
Allows a List to be used as the indices to be used on a String |
static String |
getAt(String text,
int index)
Support the subscript operator for String |
static String |
getAt(String text,
IntRange range)
Support the range subscript operator for String with IntRange |
static String |
getAt(String text,
Range range)
Support the range subscript operator for String |
static int |
getCount(Matcher matcher)
Find the number of Strings matched to the given Matcher. |
static InputStream |
getErr(Process self)
An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar way |
static InputStream |
getIn(Process self)
An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar way |
static OutputStream |
getOut(Process self)
An alias method so that a process appears similar to System.out, System.in, System.err; you can use process.in, process.out, process.err in a similar way |
protected static List |
getSubList(List self,
List splice)
|
static String |
getText(BufferedReader reader)
Reads the content of the BufferedReader and returns it as a String |
static String |
getText(File file)
Reads the content of the File and returns it as a String |
static String |
getText(File file,
String charset)
Reads the content of the File opened with the specified encoding and returns it as a String |
static String |
getText(InputStream is)
Reads the content of this InputStream and returns it as a String |
static String |
getText(InputStream is,
String charset)
Reads the content of this InputStream with a specified charset and returns it as a String |
static String |
getText(Process self)
Read the text of the output stream of the Process. |
static String |
getText(Reader reader)
Reads the content of the Reader and returns it as a String |
static String |
getText(URL url)
Reads the content of this URL and returns it as a String |
static String |
getText(URL url,
String charset)
Reads the content of this URL and returns it as a String |
static List |
grep(Object self,
Object filter)
Iterates over every element of the collection and return each object that matches the given filter - calling the isCase() method used by switch statements. |
static boolean |
hasGroup(Matcher matcher)
Check whether a Matcher contains a group or not. |
static Object |
identity(Object self,
Closure closure)
Allows the closure to be called for the object reference self |
static Object |
inject(Collection self,
Object value,
Closure closure)
Iterates through the given collection, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure. |
static Object |
inject(Object[] self,
Object value,
Closure closure)
Iterates through the given array of objects, passing in the initial value to the closure along with the current iterated item then passing into the next iteration the value of the previous closure. |
static String |
inspect(Object self)
|
static Number |
intdiv(Character left,
Character right)
Integer Divide two Characters |
static Number |
intdiv(Character left,
Number right)
Integer Divide a Character by a Number |
static Number |
intdiv(Number left,
Character right)
Integer Divide a Number by a Character |
static Number |
intdiv(Number left,
Number right)
Integer Divide two Numbers |
static List |
intersect(List left,
Collection right)
Create a List composed of the intersection of both collections |
static Object |
invokeMethod(Object object,
String method,
Object arguments)
Provide a dynamic method invocation method which can be overloaded in classes to implement dynamic proxies easily. |
static boolean |
is(Object self,
Object other)
Identity check. |
static boolean |
isCase(Class caseValue,
Object switchValue)
|
static boolean |
isCase(Collection caseValue,
Object switchValue)
|
static boolean |
isCase(Object caseValue,
Object switchValue)
|
static boolean |
isCase(Pattern caseValue,
Object switchValue)
|
static boolean |
isCase(String caseValue,
Object switchValue)
|
static String |
join(Collection self,
String separator)
Concatenates all of the items of the collection together with the given String as a separator |
static String |
join(Object[] self,
String separator)
Concatenates all of the elements of the array together with the given String as a separator |
static Collection |
leftShift(Collection self,
Object value)
Overloads the left shift operator to provide an easy way to append objects to a list |
static Number |
leftShift(Number left,
Number right)
Implementation of the left shift operator for integral types. |
static OutputStream |
leftShift(OutputStream self,
byte[] value)
Overloads the left shift operator to provide an append mechanism to add bytes to a stream |
static Writer |
leftShift(OutputStream self,
Object value)
Overloads the left shift operator to provide an append mechanism to add things to a stream |
static OutputStream |
leftShift(Process self,
byte[] value)
Overloads the left shift operator to provide an append mechanism to pipe into a Process |
static Writer |
leftShift(Process self,
Object value)
Overloads the left shift operator to provide an append mechanism to pipe into a Process |
static OutputStream |
leftShift(Socket self,
byte[] value)
Overloads the left shift operator to provide an append mechanism to add bytes to the output stream of a socket |
static Writer |
leftShift(Socket self,
Object value)
Overloads the left shift operator to provide an append mechanism to add things to the output stream of a socket |
static StringBuffer |
leftShift(StringBuffer self,
Object value)
Overloads the left shift operator to provide an easy way to append multiple objects as string representations to a StringBuffer |
static StringBuffer |
leftShift(String self,
Object value)
Overloads the left shift operator to provide an easy way to append multiple objects as string representations to a String |
static Writer |
leftShift(Writer self,
Object value)
Overloads the left shift operator to provide an append mechanism to add things to a writer |
static Object |
max(Collection self)
Selects the maximum value found in the collection |
static Object |
max(Collection self,
Closure closure)
Selects the maximum value found in the collection using the given closure as a comparator |
static Object |
max(Collection self,
Comparator comparator)
Selects the maximum value found in the collection using the given comparator |
static Object |
min(Collection self)
Selects the minimum value found in the collection |
static Object |
min(Collection self,
Closure closure)
Selects the minimum value found in the collection using the given closure as a comparator |
static Object |
min(Collection self,
Comparator comparator)
Selects the minimum value found in the collection using the given comparator |
static Number |
minus(Character left,
Character right)
Subtraction two Characters |
static Number |
minus(Character left,
Number right)
Subtract a Number from a Character |
static Date |
minus(Date self,
int days)
Subtracts a number of days from this date and returns the new date |
static List |
minus(List self,
Collection removeMe)
Create a List composed of the elements of the first list minus the elements of the collection |
static Number |
minus(Number left,
Character right)
Subtract a Character from a Number |
static Number |
minus(Number left,
Number right)
Substraction of two Numbers |
static String |
minus(String left,
Object value)
Remove a part of a String |
static Number |
mod(Number left,
Number right)
Performs a division modulus operation |
static Number |
multiply(Character left,
Character right)
Multiply two Characters |
static Number |
multiply(Character left,
Number right)
Multiply a Character by a Number |
static List |
multiply(Collection self,
Number factor)
Create a List composed of the same elements repeated a certain number of times. |
static Number |
multiply(Number left,
Character right)
Multiply a Number by a Character |
static Number |
multiply(Number left,
Number right)
Multiply two Numbers |
static String |
multiply(String self,
Number factor)
Repeat a String a certain number of times |
static Pattern |
negate(GString self)
Turns a String into a regular expression pattern |
static Number |
negate(Number left)
Negates the number |
static Pattern |
negate(String self)
Turns a String into a regular expression pattern. |
static BufferedInputStream |
newInputStream(File file)
Helper method to create a buffered input stream for a file |
static ObjectInputStream |
newObjectInputStream(File file)
Helper method to create an object input stream from the given file. |
static BufferedOutputStream |
newOutputStream(File file)
Helper method to create a buffered output stream for a file |
static PrintWriter |
newPrintWriter(File file)
Helper method to create a new PrintWriter for a file |
static PrintWriter |
newPrintWriter(File file,
String charset)
Helper method to create a new PrintWriter for a file with a specified charset |
static BufferedReader |
newReader(File file)
Helper method to create a buffered reader for a file |
static BufferedReader |
newReader(File file,
String charset)
Helper method to create a buffered reader for a file, with a specified charset |
static BufferedReader |
newReader(InputStream self)
Provides a reader for an arbitrary input stream |
static BufferedWriter |
newWriter(File file)
Helper method to create a buffered writer for a file |
static BufferedWriter |
newWriter(File file,
boolean append)
Helper method to create a buffered writer for a file in append mode |
static BufferedWriter |
newWriter(File file,
String charset)
Helper method to create a buffered writer for a file |
static BufferedWriter |
newWriter(File file,
String charset,
boolean append)
Helper method to create a buffered writer for a file |
static Number |
next(Character self)
Increment a Character by one |
static Date |
next(Date self)
Increments a Date by a day |
static Number |
next(Number self)
Increment a Number by one |
static String |
next(String self)
This method is called by the ++ operator for the class String. |
protected static int |
normaliseIndex(int i,
int size)
This converts a possibly negative index to a real index into the array. |
static Number |
or(Number left,
Number right)
Bitwise OR together two numbers |
static String |
padLeft(String self,
Number numberOfChars)
Pad a String with the spaces appended to the left |
static String |
padLeft(String self,
Number numberOfChars,
String padding)
Pad a String with the characters appended to the left |
static String |
padRight(String self,
Number numberOfChars)
Pad a String with the spaces appended to the right |
static String |
padRight(String self,
Number numberOfChars,
String padding)
Pad a String with the characters appended to the right |
static Number |
plus(Character left,
Character right)
Add two Characters |
static Number |
plus(Character left,
Number right)
Add a Character and a Number |
static List |
plus(Collection left,
Collection right)
Create a List as a union of both Collections |
static List |
plus(Collection left,
Object right)
Create a List as a union of a Collection and an Object |
static Date |
plus(Date self,
int days)
Adds a number of days to this date and returns the new date |
static Number |
plus(Number left,
Character right)
Add a Number and a Character |
static Number |
plus(Number left,
Number right)
Add two Numbers |
static String |
plus(Number value,
String right)
Appends a String |
static String |
plus(StringBuffer left,
String value)
Appends a String |
static String |
plus(String left,
Object value)
Appends a String |
static Object |
pop(List self)
Removes the last item from the List. |
static Number |
power(Number self,
Number exponent)
Power of a Number to a certain exponent |
static Number |
previous(Character self)
Decrement a Character by one |
static Date |
previous(Date self)
Decrement a Date by a day |
static Number |
previous(Number self)
Decrement a Number by one |
static String |
previous(String self)
This method is called by the -- operator for the class String. |
protected static List |
primitiveArrayGet(Object self,
Collection indices)
Implements the getAt(Collection) method for primitve type arrays |
protected static Object |
primitiveArrayGet(Object array,
int idx)
Implements the getAt(int) method for primitve type arrays |
protected static List |
primitiveArrayGet(Object array,
Range range)
Implements the getAt(Range) method for primitve type arrays |
protected static void |
primitiveArrayPut(Object array,
int idx,
Object newValue)
Implements the set(int idx) method for primitve type arrays |
static void |
print(Object self,
Object value)
Print to a console in interactive format |
static void |
print(Object self,
PrintWriter out)
Print to a console in interactive format |
static void |
printf(Object self,
String format,
Object arg)
Returns a formatted string using the specified format string and arguments. |
static void |
printf(Object self,
String format,
Object[] values)
Printf to a console. |
static void |
println(Object self)
Print a linebreak to the standard out. |
static void |
println(Object self,
Object value)
Print to a console in interactive format along with a newline |
static void |
println(Object self,
PrintWriter out)
Print to a console in interactive format |
static void |
putAt(boolean[] array,
int idx,
Boolean newValue)
|
static void |
putAt(byte[] array,
int idx,
Object newValue)
|
static void |
putAt(char[] array,
int idx,
Object newValue)
|
static void |
putAt(double[] array,
int idx,
Object newValue)
|
static void |
putAt(float[] array,
int idx,
Object newValue)
|
static void |
putAt(int[] array,
int idx,
Object newValue)
|
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,
int idx,
Object value)
A helper method to allow lists to work with subscript operators |
static void |
putAt(List self,
IntRange range,
Object value)
A helper method to allow lists to work with subscript operators |
static void |
putAt(List self,
List splice,
List values)
Deprecated. replace with putAt(List self, Range range, List value) |
static void |
putAt(List self,
List splice,
Object value)
Deprecated. replace with putAt(List self, Range range, Object value) |
static void |
putAt(long[] array,
int idx,
Object newValue)
|
static Object |
putAt(Map self,
Object key,
Object value)
A helper method to allow lists to work with subscript operators |
static void |
putAt(Object[] array,
int idx,
Object value)
Support the subscript operator for an Array |
static void |
putAt(Object self,
String property,
Object newValue)
Allows the subscript operator to be used to set dynamically named property values. |
static void |
putAt(short[] array,
int idx,
Object newValue)
|
static void |
putAt(StringBuffer self,
EmptyRange range,
Object value)
Support the range subscript operator for StringBuffer |
static void |
putAt(StringBuffer self,
IntRange range,
Object value)
Support the range subscript operator for StringBuffer |
static byte[] |
readBytes(File file)
Reads the content of the file into an array of byte |
static String |
readLine(InputStream stream)
Read a single, whole line from the given InputStream |
static String |
readLine(Reader self)
Read a single, whole line from the given Reader |
static List |
readLines(File file)
Reads the file into a list of Strings for each line |
static List |
readLines(InputStream stream)
Reads the stream into a list of Strings for each line |
static List |
readLines(Reader reader)
Reads the reader into a list of Strings for each line |
static String |
replaceAll(String self,
String regex,
Closure closure)
Replaces all occurrencies of a captured group by the result of a closure on that text. |
static List |
reverse(List self)
Reverses the list |
static String |
reverse(String self)
Creates a new string which is the reverse (backwards) of this string |
static void |
reverseEach(List self,
Closure closure)
Iterate over each element of the list in the reverse order. |
static Number |
rightShift(Number left,
Number right)
Implementation of the right shift operator for integral types. |
static Number |
rightShiftUnsigned(Number left,
Number right)
Implementation of the right shift (unsigned) operator for integral types. |
static long |
round(Double number)
Round the value |
static int |
round(Float number)
Get the absolute value |
static void |
runAfter(Timer timer,
int delay,
Closure closure)
Allow simple syntax for using timers. |
static void |
setIndex(Matcher matcher,
int idx)
Set the position of the given Matcher to the given index. |
static int |
size(byte[] array)
|
static int |
size(char[] array)
|
static int |
size(double[] array)
|
static int |
size(float[] array)
|
static int |
size(int[] array)
|
static int |
size(long[] array)
|
static int |
size(Object[] self)
Makes an Array look like a Collection by adding support for the size() method |
static int |
size(short[] array)
|
static int |
size(String text)
Makes a String look like a Collection by adding support for the size() method |
static int |
size(StringBuffer buffer)
Provide standard Groovy size() method for StringBuffers |
static List |
sort(Collection self)
Sorts the given collection into a sorted list |
static List |
sort(Collection self,
Closure closure)
A convenience method for sorting a Collection using a closure as a comparator |
static List |
sort(Collection self,
Comparator comparator)
A convenience method for sorting a Collection with a specific comparator |
static List |
sort(List self)
A convenience method for sorting a List |
static List |
sort(List self,
Closure closure)
A convenience method for sorting a List using a closure as a comparator |
static List |
sort(List self,
Comparator comparator)
A convenience method for sorting a List with a specific comparator |
static SortedSet |
sort(SortedSet self)
Avoids doing unnecessary work when sorting an already sorted set |
static void |
splitEachLine(File self,
String sep,
Closure closure)
Iterates through the given file line by line, splitting on the seperator |
static void |
splitEachLine(Reader self,
String sep,
Closure closure)
Iterates through the given reader line by line, splitting on the seperator |
static SpreadList |
spread(List self)
Returns the converted SpreadList of the given self . |
static SpreadMap |
spread(Map self)
|
static SpreadList |
spread(Object[] self)
Returns the converted SpreadList of the given self . |
static void |
step(Number self,
Number to,
Number stepNumber,
Closure closure)
Iterates from this number up to the given number using a step increment |
protected static DefaultGroovyMethods.RangeInfo |
subListBorders(int size,
EmptyRange range)
|
protected static DefaultGroovyMethods.RangeInfo |
subListBorders(int size,
IntRange range)
|
static Map |
subMap(Map map,
Collection keys)
Creates a sub-Map containing the given keys. |
static void |
times(Number self,
Closure closure)
Iterates a number of times |
static String |
toArrayString(Object[] self)
Returns the string representation of the given array with the brace boundaries. |
static Character |
toCharacter(String self)
Converts the given string into a Character object using the first character in the string |
static Double |
toDouble(String self)
Parse a String into a Double |
static Float |
toFloat(String self)
Parse a String into a Float |
static Integer |
toInteger(Number self)
Transform a Number into an Integer |
static Integer |
toInteger(String self)
Parse a String into an Integer |
static List |
tokenize(String self)
Tokenize a String (with a whitespace as delimiter) |
static List |
tokenize(String self,
String token)
Tokenize a String |
static List |
toList(byte[] array)
|
static List |
toList(char[] array)
|
static List |
toList(Collection self)
Convert a collection to a List. |
static List |
toList(double[] array)
|
static List |
toList(float[] array)
|
static List |
toList(int[] array)
|
static List |
toList(long[] array)
|
static List |
toList(Object[] array)
Allows conversion of arrays into a mutable List |
static List |
toList(short[] array)
|
static List |
toList(String self)
Converts the given String into a List of strings of one character |
static String |
toListString(Collection self)
Returns the string representation of the given collection with the bracket boundaries. |
static Long |
toLong(String self)
Parse a String into a Long |
static String |
toMapString(Map self)
Returns the string representation of the given map with bracket boundaries. |
static SpreadList |
toSpreadList(List self)
Returns the converted SpreadList of the given self . |
static SpreadList |
toSpreadList(Object[] self)
Returns the converted SpreadList of the given self . |
static SpreadMap |
toSpreadMap(Map self)
Returns the converted SpreadList of the given self . |
static SpreadMap |
toSpreadMap(Object[] self)
|
static String |
toString(Collection self)
Returns the string representation of the given collection with the bracket boundaries. |
static String |
toString(Map self)
Returns the string representation of the given map with bracket boundaries. |
protected static String |
toString(Object value)
|
static String |
toString(Object[] self)
Returns the string representation of the given array with the brace boundaries. |
static URL |
toURL(String self)
Transforms a String representing a URL into a URL object. |
static void |
transformChar(Reader reader,
Writer writer,
Closure closure)
Transforms the characters from a reader with a Closure and write them to a writer |
static void |
transformLine(Reader reader,
Writer writer,
Closure closure)
Transforms the lines from a reader with a Closure and write them to a writer |
static Collection |
unique(Collection self)
Remove all duplicates from the Collection. |
static void |
upto(BigDecimal self,
Number to,
Closure closure)
|
static void |
upto(BigInteger self,
Number to,
Closure closure)
|
static void |
upto(Double self,
Number to,
Closure closure)
|
static void |
upto(float self,
Number to,
Closure closure)
|
static void |
upto(Float 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(Number self,
Number to,
Closure closure)
Iterates from this number up to the given number |
static void |
use(Object self,
Class categoryClass,
Closure closure)
Scoped use method |
static void |
use(Object self,
List categoryClassList,
Closure closure)
Scoped use method with list of categories |
static void |
waitForOrKill(Process self,
long numberOfMillis)
Wait for the process to finish during a certain amount of time, otherwise stops the process. |
static void |
withInputStream(File file,
Closure closure)
Helper method to create a new InputStream for a file and then passes it into the closure and ensures its closed again afterwords |
static void |
withOutputStream(File file,
Closure closure)
Helper method to create a new OutputStream for a file and then passes it into the closure and ensures its closed again afterwords |
static void |
withPrintWriter(File file,
Closure closure)
Helper method to create a new PrintWriter for a file and then passes it into the closure and ensures its closed again afterwords |
static void |
withReader(File file,
Closure closure)
Helper method to create a new BufferedReader for a file and then passes it into the closure and ensures its closed again afterwords |
static void |
withReader(InputStream in,
Closure closure)
Helper method to create a new BufferedReader for a stream and then passes it into the closure and ensures its closed again afterwords |
static void |
withReader(Reader writer,
Closure closure)
Allows a Reader to be used, calling the closure with the writer and then ensuring that the writer is closed down again irrespective of whether exceptions occur or the |
static void |
withReader(URL url,
Closure closure)
Helper method to create a new BufferedReader for a URL and then passes it into the closure and ensures its closed again afterwords |
static void |
withStream(InputStream stream,
Closure closure)
Allows a InputStream to be used, calling the closure with the stream and then ensuring that the stream is closed down again irrespective of whether exceptions occur or the |
static void |
withStream(OutputStream stream,
Closure closure)
Allows a OutputStream to be used, calling the closure with the stream and then ensuring that the stream is closed down again irrespective of whether exceptions occur. |
static void |
withStreams(Socket socket,
Closure closure)
Allows an InputStream and an OutputStream from a Socket to be used, calling the closure with the streams and then ensuring that the streams are closed down again irrespective of whether exceptions occur. |
static void |
withWriter(File file,
Closure closure)
Helper method to create a new BufferedWriter for a file and then passes it into the closure and ensures it is closed again afterwords |
static void |
withWriter(File file,
String charset,
Closure closure)
Helper method to create a new BufferedWriter for a file in a specified encoding and then passes it into the closure and ensures it is closed again afterwords |
static void |
withWriter(OutputStream stream,
Closure closure)
Allows an output stream to be used, calling the closure with the output stream and then ensuring that the output stream is closed down again irrespective of whether exceptions occur |
static void |
withWriter(OutputStream stream,
String charset,
Closure closure)
Allows an output stream to be used, calling the closure with the output stream and then ensuring that the output stream is closed down again irrespective of whether exceptions occur. |
static void |
withWriter(Writer writer,
Closure closure)
Allows a writer to be used, calling the closure with the writer and then ensuring that the writer is closed down again irrespective of whether exceptions occur or the |
static void |
withWriterAppend(File file,
String charset,
Closure closure)
Helper method to create a new BufferedWriter for a file in a specified encoding in append mode and then passes it into the closure and ensures it is closed again afterwords |
static void |
write(File file,
String text)
Write the text to the File. |
static void |
write(File file,
String text,
String charset)
Write the text to the File with a specified encoding. |
static void |
write(Writer self,
Writable writable)
A helper method so that dynamic dispatch of the writer.write(object) method will always use the more efficient Writable.writeTo(writer) mechanism if the object implements the Writable interface. |
static void |
writeLine(BufferedWriter writer,
String line)
Write the text and append a new line (depending on the platform line-ending) |
static Number |
xor(Number left,
Number right)
Bitwise XOR together two Numbers |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultGroovyMethods()
Method Detail |
public static boolean is(Object self, Object other)
self
- other
-
public static Object identity(Object self, Closure closure)
self
- the object to have a closure act uponclosure
- the closure to call on the object
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
-
public static void putAt(Object self, String property, Object newValue)
bean[somePropertyNameExpression] = foo
. The normal property notation
of groovy is neater and more concise but only works with compile time known
property names.
self
- public static String dump(Object self)
public static void eachPropertyName(Object self, Closure closure)
public static void eachProperty(Object self, Closure closure)
public static List allProperties(Object self)
public static void use(Object self, Class categoryClass, Closure closure)
public static void use(Object self, List categoryClassList, Closure closure)
public static void print(Object self, Object value)
public static void println(Object self)
public static void println(Object self, Object value)
public static void printf(Object self, String format, Object[] values)
public static void printf(Object self, String format, Object arg)
For examples,
printf ( "Hello, %s!\n" , [ "world" ] as String[] ) printf ( "Hello, %s!\n" , [ "Groovy" ]) printf ( "%d + %d = %d\n" , [ 1 , 2 , 1+2 ] as Integer[] ) printf ( "%d + %d = %d\n" , [ 3 , 3 , 3+3 ]) ( 1..5 ).each { printf ( "-- %d\n" , [ it ] as Integer[] ) } ( 1..5 ).each { printf ( "-- %d\n" , [ it ] as int[] ) } ( 0x41..0x45 ).each { printf ( "-- %c\n" , [ it ] as char[] ) } ( 07..011 ).each { printf ( "-- %d\n" , [ it ] as byte[] ) } ( 7..11 ).each { printf ( "-- %d\n" , [ it ] as short[] ) } ( 7..11 ).each { printf ( "-- %d\n" , [ it ] as long[] ) } ( 7..11 ).each { printf ( "-- %5.2f\n" , [ it ] as float[] ) } ( 7..11 ).each { printf ( "-- %5.2g\n" , [ it ] as double[] ) }
format
- A format stringarg
- Argument which is referenced by the format specifiers in the format
string. The type of arg
should be one of Object[], List,
int[], short[], byte[], char[], boolean[], long[], float[], or double[].
public static String inspect(Object self)
public static void print(Object self, PrintWriter out)
public static void println(Object self, PrintWriter out)
out
- the PrintWriter used for printingpublic static Object invokeMethod(Object object, String method, Object arguments)
public static boolean isCase(Object caseValue, Object switchValue)
public static boolean isCase(String caseValue, Object switchValue)
public static boolean isCase(Class caseValue, Object switchValue)
public static boolean isCase(Collection caseValue, Object switchValue)
public static boolean isCase(Pattern caseValue, Object switchValue)
public static Collection unique(Collection self)
self
-
public static void each(Object self, Closure closure)
self
- the object over which we iterateclosure
- the closure applied on each element foundpublic static void eachWithIndex(Object self, Closure closure)
self
- an Objectclosure
- a Closurepublic static void each(Collection self, Closure closure)
self
- the collection over which we iterateclosure
- the closure applied on each element of the collectionpublic static void each(Map self, Closure closure)
self
- the map over which we iterateclosure
- the closure applied on each entry of the mappublic static boolean every(Object self, Closure closure)
self
- the object over which we iterateclosure
- the closure predicate used for matching
public static boolean any(Object self, Closure closure)
self
- the object over which we iterateclosure
- the closure predicate used for matching
public static List grep(Object self, Object filter)
self
- the object over which we iteratefilter
- the filter to perform on the collection (using the isCase(object) method)
public static int count(Collection self, Object value)
self
- the collection within which we count the number of occurenciesvalue
- the value
public static List toList(Collection self)
self
- a collection
public static List collect(Object self, Closure closure)
self
- the values of the object to mapclosure
- the closure used to map each element of the collection
public static Collection collect(Object self, Collection collection, Closure closure)
self
- the values of the object to mapcollection
- the Collection to which the mapped values are addedclosure
- the closure used to map each element of the collection
public static List collect(Collection self, Closure closure)
self
- a collectionclosure
- the closure used for mapping
public static Collection collect(Collection self, Collection collection, Closure closure)
self
- a collectioncollection
- the Collection to which the mapped values are addedclosure
- the closure used to map each element of the collection
public static Collection collect(Map self, Collection collection, Closure closure)
self
- a Mapclosure
- the closure used for mapping
public static List collect(Map self, Closure closure)
self
- a Mapclosure
- the closure used to map each element of the collection
public static Object find(Object self, Closure closure)
self
- an Object with an iterator returning its valuesclosure
- a closure condition
public static Object find(Collection self, Closure closure)
self
- a Collectionclosure
- a closure condition
public static Object find(Map self, Closure closure)
self
- a Mapclosure
- a closure condition
public static List findAll(Object self, Closure closure)
self
- an Object with an Iterator returning its valuesclosure
- a closure condition
public static List findAll(Collection self, Closure closure)
self
- a Collectionclosure
- a closure condition
public static Map findAll(Map self, Closure closure)
self
- a Mapclosure
- a closure condition applying on the entries
protected static Object callClosureForMapEntry(Closure closure, Map.Entry entry)
public static Object inject(Collection self, Object value, Closure closure)
self
- a Collectionvalue
- a valueclosure
- a closure
public static Object inject(Object[] self, Object value, Closure closure)
self
- an Object[]value
- a valueclosure
- a closure
public static String join(Collection self, String separator)
self
- a Collection of objectsseparator
- a String separator
public static String join(Object[] self, String separator)
self
- an array of Objectseparator
- a String separator
public static Object max(Collection self)
self
- a Collection
public static Object max(Collection self, Comparator comparator)
self
- a Collectioncomparator
- a Comparator
public static Object min(Collection self)
self
- a Collection
public static Object min(Collection self, Comparator comparator)
self
- a Collectioncomparator
- a Comparator
public static Object min(Collection self, Closure closure)
self
- a Collectionclosure
- a closure used as a comparator
public static Object max(Collection self, Closure closure)
self
- a Collectionclosure
- a closure used as a comparator
public static int size(String text)
text
- a String
public static int size(StringBuffer buffer)
buffer
- a StringBuffer
public static int size(Object[] self)
self
- an Array of Object
public static CharSequence getAt(CharSequence text, int index)
text
- a Stringindex
- the index of the Character to get
public static String getAt(String text, int index)
text
- a String
public static CharSequence getAt(CharSequence text, Range range)
text
- a CharSequencerange
- a Range
public static CharSequence getAt(CharSequence text, IntRange range)
text
- a CharSequencerange
- an IntRange
public static String getAt(String text, IntRange range)
text
- a Stringrange
- an IntRange
public static String getAt(String text, Range range)
text
- a Stringrange
- a Range
public static String reverse(String self)
self
- a String
public static URL toURL(String self) throws MalformedURLException
self
- the String representing a URL
MalformedURLException
- is thrown if the URL is not well formed.public static Pattern negate(String self)
self
- a String to convert into a regular expression
public static String replaceAll(String self, String regex, Closure closure)
For examples,
assert "FOOBAR-FOOBAR-" == "foobar-FooBar-".replaceAll("(([fF][oO]{2})[bB]ar)", { Object[] it -> it[0].toUpperCase() }) Here, it[0] is the global string of the matched group it[1] is the first string in the matched group it[2] is the second string in the matched group assert "FOO-FOO-" == "foobar-FooBar-".replaceAll("(([fF][oO]{2})[bB]ar)", { x, y, z -> z.toUpperCase() }) Here, x is the global string of the matched group y is the first string in the matched group z is the second string in the matched group
self
- a Stringregex
- the capturing regexclosure
- the closure to apply on each captured group
public static Pattern negate(GString self)
self
- a GString to convert into a regular expression
public static String padLeft(String self, Number numberOfChars, String padding)
numberOfChars
- the total number of characterspadding
- the charaters used for padding
public static String padLeft(String self, Number numberOfChars)
numberOfChars
- the total number of characters
public static String padRight(String self, Number numberOfChars, String padding)
numberOfChars
- the total number of characterspadding
- the charaters used for padding
public static String padRight(String self, Number numberOfChars)
numberOfChars
- the total number of characters
public static String center(String self, Number numberOfChars, String padding)
numberOfChars
- the total number of characterspadding
- the charaters used for padding
public static String center(String self, Number numberOfChars)
numberOfChars
- the total number of characters
public static Object getAt(Matcher matcher, int idx)
def p = /ab[d|f]/
def m = "abcabdabeabf" =~ p
for (i in 0..
For an example using group matches,
def p = /(?:ab([c|d|e|f]))/ `
def m = "abcabdabeabf" =~ p
for (i in 0..
For another example using group matches,
def m = "abcabdabeabfabxyzabx" =~ /(?:ab([d|x-z]+))/
m.count.times {
println( "m.groupCount() = " + m.groupCount())
println( " " + it + ": " + m[it] ) // m[it] is a List
}
matcher
- a Matcheridx
- an index
public static void setIndex(Matcher matcher, int idx)
matcher
- a Matcheridx
- the index numberpublic static int getCount(Matcher matcher)
matcher
- a Matcher
public static boolean hasGroup(Matcher matcher)
matcher
- a Matcher
true
if matcher contains at least one group.public static List getAt(List self, IntRange range)
self
- a Listrange
- a Range
List.subList(int, int)
protected static DefaultGroovyMethods.RangeInfo subListBorders(int size, IntRange range)
protected static DefaultGroovyMethods.RangeInfo subListBorders(int size, EmptyRange range)
public static List getAt(List self, Collection indices)
self
- a Listindices
- a Collection of indices
public static List getAt(Object[] self, Collection indices)
self
- an Array of Objectsindices
- a Collection of indices
public static CharSequence getAt(CharSequence self, Collection indices)
self
- a CharSequenceindices
- a Collection of indices
public static String getAt(String self, Collection indices)
self
- a Stringindices
- a Collection of indices
public static String getAt(Matcher self, Collection indices)
self
- a Matcherindices
- a Collection of indices
public static Map subMap(Map map, Collection keys)
map
- a Mapkeys
- a Collection of keys
public static Object get(Map map, Object key, Object defaultValue)
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 List getAt(Object[] array, Range range)
array
- an Array of Objectsrange
- a Range
public static List getAt(Object[] array, IntRange range)
public static List getAt(Object[] array, ObjectRange range)
public static Object getAt(Object[] array, int idx)
array
- an Array of Objectsidx
- an index
public static void putAt(Object[] array, int idx, Object value)
array
- an Array of Objectsidx
- an indexvalue
- an Object to put at the given indexpublic static List toList(Object[] array)
array
- an Array of Objects
public static Object getAt(List self, int idx)
self
- a Listidx
- an index
public static void putAt(List self, int idx, Object value)
self
- a Listidx
- an indexvalue
- the value to put at the given indexpublic static void putAt(StringBuffer self, IntRange range, Object value)
self
- a StringBufferrange
- a Rangevalue
- the object that's toString() will be insertedpublic static void putAt(StringBuffer self, EmptyRange range, Object value)
self
- a StringBufferrange
- a Rangevalue
- the object that's toString() will be insertedpublic static void putAt(List self, EmptyRange range, Object value)
self
- a Listrange
- the subset of the list to setvalue
- the values to put at the given sublist or a Collection of valuespublic static void putAt(List self, IntRange range, Object value)
self
- a Listrange
- the subset of the list to setvalue
- the value to put at the given sublist or a Collection of valuespublic static void putAt(List self, List splice, List values)
self
- a Listsplice
- the subset of the list to setvalues
- the value to put at the given sublistpublic static void putAt(List self, List splice, Object value)
self
- a Listsplice
- the subset of the list to setvalue
- the value to put at the given sublistprotected static List getSubList(List self, List splice)
public static Object getAt(Map self, Object key)
self
- a Mapkey
- an Object as a key for the map
public static Object putAt(Map self, Object key, Object value)
self
- a Mapkey
- an Object as a key for the map
protected static int normaliseIndex(int i, int size)
i
- size
-
public static List getAt(Collection coll, String property)
coll
- a Collectionproperty
- a String
public static Map asImmutable(Map self)
self
- a Map
public static SortedMap asImmutable(SortedMap self)
self
- a SortedMap
public static List asImmutable(List self)
self
- a List
public static Set asImmutable(Set self)
self
- a Set
public static SortedSet asImmutable(SortedSet self)
self
- a SortedSet
public static Collection asImmutable(Collection self)
self
- a Collection
public static Map asSynchronized(Map self)
self
- a Map
public static SortedMap asSynchronized(SortedMap self)
self
- a SortedMap
public static Collection asSynchronized(Collection self)
self
- a Collection
public static List asSynchronized(List self)
self
- a List
public static Set asSynchronized(Set self)
self
- a Set
public static SortedSet asSynchronized(SortedSet self)
self
- a SortedSet
public static SpreadList spread(List self)
SpreadList
of the given self
.
This is the same method to toSpreadList(List self)
.
For examples, if there is defined a function like as
, then all of the following three have the same meaning.def fn(a, b, c, d) { return a + b + c + d }
println fn(1, [2, 3].spread(), 4) println fn(1, *[2, 3], 4) println fn(1, 2, 3, 4)
self
- a list to be converted into a spreadlist
public static SpreadList spread(Object[] self)
SpreadList
of the given self
.
This is the same method to toSpreadList(Object[] self)
.
For examples, if there is defined a function like as
, then all of the following three have the same meaning.def fn(a, b, c, d) { return a + b + c + d }
println fn(([1, 2, 3] as Object[]).spread(), 4) println fn(*[1, 2, 3], 4) println fn(1, 2, 3, 4)
self
- an array of objects to be converted into a spreadlist
public static SpreadList toSpreadList(List self)
SpreadList
of the given self
.
For examples, if there is defined a function like as
, then all of the following three have the same meaning.def fn(a, b, c, d) { return a + b + c + d }
println fn(1, [2, 3].toSpreadList(), 4) println fn(1, *[2, 3], 4) println fn(1, 2, 3, 4)
self
- a list to be converted into a spreadlist
public static SpreadList toSpreadList(Object[] self)
SpreadList
of the given self
.
For examples, if there is defined a function like as
, then all of the following three have the same meaning.def fn(a, b, c, d) { return a + b + c + d }
println fn(([1, 2, 3] as Object[]).toSpreadList(), 4) println fn(*[1, 2, 3], 4) println fn(1, 2, 3, 4)
self
- an array of objects to be converted into a spreadlist
public static SpreadMap spread(Map self)
public static SpreadMap toSpreadMap(Map self)
SpreadList
of the given self
.
For examples, if there is defined a function like as
, then all of the following three have the same meaning.def fn(a, b, c, d) { return a + b + c + d }
println fn(a:1, [b:2, c:3].toSpreadMap(), d:4) println fn(a:1, *:[b:2, c:3], d:4) println fn(a:1, b:2, c:3, d:4)
self
- a list to be converted into a spreadlist
public static SpreadMap toSpreadMap(Object[] self)
public static List sort(Collection self)
self
- the collection to be sorted
public static SortedSet sort(SortedSet self)
self
-
public static List sort(List self)
self
- a List to be sorted
public static Object pop(List self)
self
- a List
UnsupportedOperationException
- if the list is empty and you try to pop() it.public static List sort(List self, Comparator comparator)
self
- a Listcomparator
- a Comparator used for the comparison
public static List sort(Collection self, Comparator comparator)
self
- a collection to be sortedcomparator
- a Comparator used for the comparison
public static List sort(List self, Closure closure)
self
- a Listclosure
- a Closure used as a comparator
public static List sort(Collection self, Closure closure)
self
- a Collection to be sortedclosure
- a Closure used as a comparator
public static List asList(Collection self)
self
- a collection to be converted into a List
public static List reverse(List self)
self
- a List
public static List plus(Collection left, Collection right)
left
- the left Collectionright
- the right Collection
public static List plus(Collection left, Object right)
left
- a Collectionright
- an object to append
public static List multiply(Collection self, Number factor)
self
- a Collectionfactor
- the number of times to append
public static List intersect(List left, Collection right)
left
- a Listright
- a Collection
public static List minus(List self, Collection removeMe)
self
- a ListremoveMe
- a Collection of elements to remove
public static List flatten(List self)
self
- a List
public static void reverseEach(List self, Closure closure)
self
- a Listclosure
- a closurepublic static Collection leftShift(Collection self, Object value)
self
- a Collectionvalue
- an Object to be added to the collection.
public static StringBuffer leftShift(String self, Object value)
self
- a Stringvalue
- an Obect
protected static StringWriter createStringWriter(String self)
protected static StringBufferWriter createStringBufferWriter(StringBuffer self)
public static StringBuffer leftShift(StringBuffer self, Object value)
self
- a StringBuffervalue
- a value to append
public static Writer leftShift(Writer self, Object value) throws IOException
self
- a Writervalue
- a value to append
IOException
public static Number leftShift(Number left, Number right)
public static Number rightShift(Number left, Number right)
public static Number rightShiftUnsigned(Number left, Number right)
public static void write(Writer self, Writable writable) throws IOException
self
- a Writerwritable
- an object implementing the Writable interface
IOException
public static Writer leftShift(OutputStream self, Object value) throws IOException
self
- an OutputStreamvalue
- a value to append
IOException
public static OutputStream leftShift(OutputStream self, byte[] value) throws IOException
self
- an OutputStreamvalue
- a value to append
IOException
public static Object getAt(byte[] array, int idx)
public static Object getAt(char[] array, int idx)
public static Object getAt(short[] array, int idx)
public static Object getAt(int[] array, int idx)
public static Object getAt(long[] array, int idx)
public static Object getAt(float[] array, int idx)
public static Object getAt(double[] array, int idx)
public static Object getAt(boolean[] array, int idx)
public static Object getAt(byte[] array, Range range)
public static Object getAt(char[] array, Range range)
public static Object getAt(short[] array, Range range)
public static Object getAt(int[] array, Range range)
public static Object getAt(long[] array, Range range)
public static Object getAt(float[] array, Range range)
public static Object getAt(double[] array, Range range)
public static Object getAt(boolean[] array, Range range)
public static Object getAt(byte[] array, IntRange range)
public static Object getAt(char[] array, IntRange range)
public static Object getAt(short[] array, IntRange range)
public static Object getAt(int[] array, IntRange range)
public static Object getAt(long[] array, IntRange range)
public static Object getAt(float[] array, IntRange range)
public static Object getAt(double[] array, IntRange range)
public static Object getAt(boolean[] array, IntRange range)
public static Object getAt(byte[] array, ObjectRange range)
public static Object getAt(char[] array, ObjectRange range)
public static Object getAt(short[] array, ObjectRange range)
public static Object getAt(int[] array, ObjectRange range)
public static Object getAt(long[] array, ObjectRange range)
public static Object getAt(float[] array, ObjectRange range)
public static Object getAt(double[] array, ObjectRange range)
public static Object getAt(boolean[] array, ObjectRange range)
public static Object getAt(byte[] array, Collection indices)
public static Object getAt(char[] array, Collection indices)
public static Object getAt(short[] array, Collection indices)
public static Object getAt(int[] array, Collection indices)
public static Object getAt(long[] array, Collection indices)
public static Object getAt(float[] array, Collection indices)
public static Object getAt(double[] array, Collection indices)
public static Object getAt(boolean[] array, Collection indices)
public static void putAt(boolean[] array, int idx, Boolean newValue)
public static void putAt(byte[] array, int idx, Object newValue)
public static void putAt(char[] array, int idx, Object newValue)
public static void putAt(short[] array, int idx, Object newValue)
public static void putAt(int[] array, int idx, Object newValue)
public static void putAt(long[] array, int idx, Object newValue)
public static void putAt(float[] array, int idx, Object newValue)
public static void putAt(double[] array, int idx, Object newValue)
public static int size(byte[] array)
public static int size(char[] array)
public static int size(short[] 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)
public static List toList(byte[] array)
public static List toList(char[] array)
public static List toList(short[] array)
public static List toList(int[] array)
public static List toList(long[] array)
public static List toList(float[] array)
public static List toList(double[] array)
public static Writable encodeBase64(Byte[] data)
public static Writable encodeBase64(byte[] data)
data
- byte array to be encoded
public static byte[] decodeBase64(String value)
value
- the string to be decoded
protected static Object primitiveArrayGet(Object array, int idx)
protected static List primitiveArrayGet(Object array, Range range)
protected static List primitiveArrayGet(Object self, Collection indices)
protected static void primitiveArrayPut(Object array, int idx, Object newValue)
public static Character toCharacter(String self)
self
- a String
public static List tokenize(String self, String token)
self
- a Stringtoken
- the delimiter
public static List tokenize(String self)
self
- a String
public static String plus(String left, Object value)
left
- a Stringvalue
- a String
public static String plus(Number value, String right)
value
- a Numberright
- a String
public static String plus(StringBuffer left, String value)
left
- a StringBuffervalue
- a String
public static String minus(String left, Object value)
left
- a Stringvalue
- a String part to remove
public static boolean contains(String self, String text)
self
- a Stringtext
- a String to look for
public static int count(String self, String text)
self
- a Stringtext
- a substring
public static String next(String self)
self
- a String
public static String previous(String self)
self
- a String
public static Process execute(String self) throws IOException
self
- a command line String
IOException
public static Process execute(String[] commandArray) throws IOException
String
array that is the parameter.
The first item in the array is the command the others are the parameters. For more
control over the process mechanism in JDK 1.5 you can use
java.lang.ProcessBuilder
.
commandArray
- an array of String containing the command name and
parameters as separate items in the array.
- Returns:
- the Process which has just started for this command line string.
- Throws:
IOException
public static Process execute(List commandList) throws IOException
String
list that is the parameter.
The first item in the array is the command the others are the parameters. All entries
must be String
s. For more control over the process mechanism in JDK 1.5 you
can use java.lang.ProcessBuilder
.
commandList
- a list of String containing the command name and
parameters as separate items in the list.
- Returns:
- the Process which has just started for this command line string.
- Throws:
IOException
public static String multiply(String self, Number factor)
self
- a String to be repeatedfactor
- the number of times the String should be repeated
IllegalArgumentException
- if the number of repeatition is < 0public static String toString(Map self)
self
- a Map
public static String toMapString(Map self)
self
- a Map
public static String toString(Collection self)
self
- a Collection
public static String toListString(Collection self)
self
- a Collection
public static String toString(Object[] self)
self
- an Object[]
public static String toArrayString(Object[] self)
self
- an Object[]
protected static String toString(Object value)
public static Number next(Character self)
self
- a Character
public static Number next(Number self)
self
- a Number
public static Number previous(Character self)
self
- a Character
public static Number previous(Number self)
self
- a Number
public static Number plus(Character left, Number right)
left
- a Characterright
- a Number
public static Number plus(Number left, Character right)
left
- a Numberright
- a Character
public static Number plus(Character left, Character right)
left
- a Characterright
- a Character
public static Number plus(Number left, Number right)
left
- a Numberright
- another Number to add
public static int compareTo(Character left, Number right)
left
- a Characterright
- a Number
public static int compareTo(Number left, Character right)
left
- a Numberright
- a Character
public static int compareTo(Character left, Character right)
left
- a Characterright
- a Character
public static int compareTo(Number left, Number right)
left
- a Numberright
- another Number to compare to
public static Number minus(Character left, Number right)
left
- a Characterright
- a Number
public static Number minus(Number left, Character right)
left
- a Numberright
- a Character
public static Number minus(Character left, Character right)
left
- a Characterright
- a Character
public static Number minus(Number left, Number right)
left
- a Numberright
- another Number to substract to the first one
public static Number multiply(Character left, Number right)
left
- a Characterright
- a Number
public static Number multiply(Number left, Character right)
left
- a Numberright
- a Character
public static Number multiply(Character left, Character right)
left
- a Characterright
- another Character
public static Number multiply(Number left, Number right)
left
- a Numberright
- another Number
public static Number power(Number self, Number exponent)
self
- a Numberexponent
- a Number exponent
public static Number div(Character left, Number right)
left
- a Characterright
- a Number
public static Number div(Number left, Character right)
left
- a Numberright
- a Character
public static Number div(Character left, Character right)
left
- a Characterright
- another Character
public static Number div(Number left, Number right)
left
- a Numberright
- another Number
public static Number intdiv(Character left, Number right)
left
- a Characterright
- a Number
public static Number intdiv(Number left, Character right)
left
- a Numberright
- a Character
public static Number intdiv(Character left, Character right)
left
- a Characterright
- another Character
public static Number intdiv(Number left, Number right)
left
- a Numberright
- another Number
public static Number or(Number left, Number right)
left
- a Numberright
- another Number to bitwise OR
public static Number and(Number left, Number right)
left
- a Numberright
- another Number to bitwse AND
public static Number xor(Number left, Number right)
left
- a Numberright
- another Number to bitwse XOR
public static Number mod(Number left, Number right)
left
- a Numberright
- another Number to mod
public static Number negate(Number left)
left
- a Number
public static void times(Number self, Closure closure)
self
- a Numberclosure
- the closure to call a number of timespublic static void upto(Number self, Number to, Closure closure)
self
- a Numberto
- another Number to go up toclosure
- the closure to callpublic 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)
public static void upto(Double self, Number to, Closure closure)
public static void upto(BigInteger self, Number to, Closure closure)
public static void upto(BigDecimal self, Number to, Closure closure)
public static void downto(Number self, Number to, Closure closure)
self
- a Numberto
- another Number to go down toclosure
- the closure to callpublic 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)
public static void downto(BigInteger self, Number to, Closure closure)
public static void downto(BigDecimal self, Number to, Closure closure)
public static void step(Number self, Number to, Number stepNumber, Closure closure)
self
- a Number to start withto
- a Number to go up tostepNumber
- a Number representing the step incrementclosure
- the closure to callpublic static int abs(Number number)
number
- a Number
public static long abs(Long number)
number
- a Long
public static float abs(Float number)
number
- a Float
public static double abs(Double number)
number
- a Double
public static int round(Float number)
number
- a Float
public static long round(Double number)
number
- a Double
public static Integer toInteger(String self)
self
- a String
public static Long toLong(String self)
self
- a String
public static Float toFloat(String self)
self
- a String
public static Double toDouble(String self)
self
- a String
public static Integer toInteger(Number self)
self
- a Number
public static Date next(Date self)
self
- a Date
public static Date previous(Date self)
self
- a Date
public static Date plus(Date self, int days)
self
- a Datedays
- the number of days to increase
public static Date minus(Date self, int days)
self
- a Date
public static ObjectInputStream newObjectInputStream(File file) throws FileNotFoundException, IOException
file
- a file
FileNotFoundException
IOException
public static void eachObject(File self, Closure closure) throws IOException, ClassNotFoundException
self
- a Fileclosure
- a closure
IOException
ClassNotFoundException
public static void eachObject(ObjectInputStream ois, Closure closure) throws IOException, ClassNotFoundException
closure
- a closure
IOException
ClassNotFoundException
public static void eachLine(File self, Closure closure) throws IOException
self
- a Fileclosure
- a closure
IOException
public static void eachLine(Reader self, Closure closure) throws IOException
self
- a Readerclosure
- a closure
IOException
public static void splitEachLine(File self, String sep, Closure closure) throws IOException
self
- a Filesep
- a String separatorclosure
- a closure
IOException
public static void splitEachLine(Reader self, String sep, Closure closure) throws IOException
self
- a Readersep
- a String separatorclosure
- a closure
IOException
public static String readLine(Reader self) throws IOException
self
- a Reader
IOException
public static String readLine(InputStream stream) throws IOException
stream
- an InputStream
IOException
public static List readLines(File file) throws IOException
file
- a File
IOException
public static String getText(File file, String charset) throws IOException
file
- the file whose content we want to readcharset
- the charset used to read the content of the file
IOException
public static String getText(File file) throws IOException
file
- the file whose content we want to read
IOException
public static String getText(URL url) throws IOException
url
- URL to read content from
IOException
public static String getText(URL url, String charset) throws IOException
url
- URL to read content fromcharset
- opens the stream with a specified charset
IOException
public static String getText(InputStream is) throws IOException
is
- an input stream
IOException
public static String getText(InputStream is, String charset) throws IOException
is
- an input streamcharset
- opens the stream with a specified charset
IOException
public static String getText(Reader reader) throws IOException
reader
- a Reader whose content we want to read
IOException
public static String getText(BufferedReader reader) throws IOException
reader
- a BufferedReader whose content we want to read
IOException
public static void writeLine(BufferedWriter writer, String line) throws IOException
writer
- a BufferedWriterline
- the line to write
IOException
public static void write(File file, String text) throws IOException
file
- a Filetext
- the text to write to the File
IOException
public static void write(File file, String text, String charset) throws IOException
file
- a Filetext
- the text to write to the Filecharset
- the charset used
IOException
public static void append(File file, String text) throws IOException
file
- a Filetext
- the text to append at the end of the File
IOException
public static void append(File file, String text, String charset) throws IOException
file
- a Filetext
- the text to append at the end of the Filecharset
- the charset used
IOException
public static List readLines(Reader reader) throws IOException
reader
- a Reader
IOException
public static void eachFile(File self, Closure closure) throws FileNotFoundException, IllegalArgumentException
self
- a Fileclosure
- a closure
FileNotFoundException
- Thrown if the given directory does not exist
IllegalArgumentException
- Thrown if the provided File object does not represent a directorypublic static void eachFileRecurse(File self, Closure closure) throws FileNotFoundException, IllegalArgumentException
self
- a Fileclosure
- a closure
FileNotFoundException
- Thrown if the given directory does not exist
IllegalArgumentException
- Thrown if the provided File object does not represent a directorypublic static void eachDir(File self, Closure closure) throws FileNotFoundException, IllegalArgumentException
self
- a directoryclosure
- a closure
FileNotFoundException
- Thrown if the given directory does not exist
IllegalArgumentException
- Thrown if the provided File object does not represent a directorypublic static void eachFileMatch(File self, Object filter, Closure closure) throws FileNotFoundException, IllegalArgumentException
self
- a filefilter
- the filter to perform on the directory (using the isCase(object) method)closure
-
FileNotFoundException
- Thrown if the given directory does not exist
IllegalArgumentException
- Thrown if the provided File object does not represent a directorypublic static void runAfter(Timer timer, int delay, Closure closure)
timer
- a timer objectdelay
- the delay in milliseconds before running the closure codeclosure
- public static BufferedReader newReader(File file) throws IOException
file
- a File
IOException
public static BufferedReader newReader(File file, String charset) throws FileNotFoundException, UnsupportedEncodingException
file
- a Filecharset
- the charset with which we want to write in the File
FileNotFoundException
- if the File was not found
UnsupportedEncodingException
- if the encoding specified is not supportedpublic static BufferedReader newReader(InputStream self)
self
- an input stream
public static void withReader(File file, Closure closure) throws IOException
file
-
FileNotFoundException
IOException
public static BufferedOutputStream newOutputStream(File file) throws IOException
file
-
FileNotFoundException
IOException
public static void withOutputStream(File file, Closure closure) throws IOException
file
- a File
FileNotFoundException
IOException
public static void withInputStream(File file, Closure closure) throws IOException
file
- a File
FileNotFoundException
IOException
public static BufferedWriter newWriter(File file) throws IOException
file
- a File
FileNotFoundException
IOException
public static BufferedWriter newWriter(File file, boolean append) throws IOException
file
- a Fileappend
- true if in append mode
FileNotFoundException
IOException
public static BufferedWriter newWriter(File file, String charset, boolean append) throws IOException
file
- a Filecharset
- the name of the encoding used to write in this fileappend
- true if in append mode
FileNotFoundException
IOException
public static BufferedWriter newWriter(File file, String charset) throws IOException
file
- a Filecharset
- the name of the encoding used to write in this file
FileNotFoundException
IOException
public static void withWriter(File file, Closure closure) throws IOException
file
- a Fileclosure
- a closure
FileNotFoundException
IOException
public static void withWriter(File file, String charset, Closure closure) throws IOException
file
- a Filecharset
- the charset usedclosure
- a closure
FileNotFoundException
IOException
public static void withWriterAppend(File file, String charset, Closure closure) throws IOException
file
- a Filecharset
- the charset usedclosure
- a closure
FileNotFoundException
IOException
public static PrintWriter newPrintWriter(File file) throws IOException
file
- a File
FileNotFoundException
IOException
public static PrintWriter newPrintWriter(File file, String charset) throws IOException
file
- a Filecharset
- the charset
FileNotFoundException
IOException
public static void withPrintWriter(File file, Closure closure) throws IOException
file
- a File
FileNotFoundException
IOException
public static void withWriter(Writer writer, Closure closure) throws IOException
writer
- the writer which is used and then closedclosure
- the closure that the writer is passed into
IOException
public static void withReader(Reader writer, Closure closure) throws IOException
writer
- the writer which is used and then closedclosure
- the closure that the writer is passed into
IOException
public static void withStream(InputStream stream, Closure closure) throws IOException
stream
- the stream which is used and then closedclosure
- the closure that the stream is passed into
IOException
public static List readLines(InputStream stream) throws IOException
stream
- a stream
IOException
public static void eachLine(InputStream stream, Closure closure) throws IOException
stream
- a streamclosure
- a closure
IOException
public static void eachLine(URL url, Closure closure) throws IOException
url
- a URL to open and readclosure
- a closure to apply on each line
IOException
public static void withReader(URL url, Closure closure) throws IOException
url
- a URL
FileNotFoundException
IOException
public static void withReader(InputStream in, Closure closure) throws IOException
in
- a stream
FileNotFoundException
IOException
public static void withWriter(OutputStream stream, Closure closure) throws IOException
stream
- the stream which is used and then closedclosure
- the closure that the writer is passed into
IOException
public static void withWriter(OutputStream stream, String charset, Closure closure) throws IOException
stream
- the stream which is used and then closedcharset
- the charset usedclosure
- the closure that the writer is passed into
IOException
public static void withStream(OutputStream stream, Closure closure) throws IOException
stream
- the stream which is used and then closedclosure
- the closure that the stream is passed into
IOException
public static BufferedInputStream newInputStream(File file) throws FileNotFoundException
file
- a File
FileNotFoundException
public static void eachByte(File self, Closure closure) throws IOException
self
- a Fileclosure
- a closure
IOException
public static void eachByte(InputStream is, Closure closure) throws IOException
is
- stream to iterate overclosure
- closure to apply to each byte
IOException
public static void eachByte(URL url, Closure closure) throws IOException
url
- url to iterate overclosure
- closure to apply to each byte
IOException
public static void transformChar(Reader reader, Writer writer, Closure closure)
reader
- writer
- closure
- public static void transformLine(Reader reader, Writer writer, Closure closure) throws IOException
reader
- writer
- closure
-
IOException
public static void filterLine(Reader reader, Writer writer, Closure closure) throws IOException
reader
- a readerwriter
- a writerclosure
- the closure which returns booleans
IOException
public static Writable filterLine(File self, Closure closure) throws IOException
self
- a Fileclosure
- a closure which returns a boolean indicating to filter the line or not
IOException
- if self
is not readablepublic static void filterLine(File self, Writer writer, Closure closure) throws IOException
self
- a Filewriter
- a writerclosure
- a closure which returns a boolean value and takes a line as input
IOException
- if self
is not readablepublic static Writable filterLine(Reader reader, Closure closure)
reader
- a readerclosure
- a closure returning a boolean indicating to filter or not a line
public static Writable filterLine(InputStream self, Closure predicate)
self
- an input streampredicate
- a closure which returns boolean and takes a line
public static void filterLine(InputStream self, Writer writer, Closure predicate) throws IOException
self
- an InputStreamwriter
- a writer to write output topredicate
- a closure which returns a boolean and takes a line as input
IOException
public static byte[] readBytes(File file) throws IOException
file
- a File
IOException
public static void withStreams(Socket socket, Closure closure) throws IOException
socket
- a Socketclosure
- a Closure
IOException
public static Writer leftShift(Socket self, Object value) throws IOException
self
- a Socketvalue
- a value to append
IOException
public static OutputStream leftShift(Socket self, byte[] value) throws IOException
self
- a Socketvalue
- a value to append
IOException
public static Socket accept(ServerSocket serverSocket, Closure closure) throws IOException
serverSocket
- a ServerSocketclosure
- a Closure
IOException
public static File asWritable(File file)
file
- a File
public static File asWritable(File file, String encoding)
file
- a Fileencoding
- the encoding to be used when reading the file's contents
public static List toList(String self)
self
- a String
public static InputStream getIn(Process self)
public static String getText(Process self) throws IOException
self
- a Process
IOException
public static InputStream getErr(Process self)
public static OutputStream getOut(Process self)
public static Writer leftShift(Process self, Object value) throws IOException
self
- a Processvalue
- a value to append
IOException
public static OutputStream leftShift(Process self, byte[] value) throws IOException
self
- a Processvalue
- a value to append
IOException
public static void waitForOrKill(Process self, long numberOfMillis)
self
- a ProcessnumberOfMillis
- the number of milliseconds to wait before stopping the processpublic static void eachMatch(String self, String regex, Closure closure)
self
- the source stringregex
- a Regex stringclosure
- a closurepublic static void each(Matcher self, Closure closure)
self
- the source matcherclosure
- a closurepublic static int findIndexOf(Object self, Closure closure)
self
- the iteration object over which we iterateclosure
- the filter to perform a match on the collection
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |