|
|||||||||||
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. |
Field Summary | |
private static java.util.logging.Logger |
log
|
private static java.lang.Integer |
ONE
|
private static byte[] |
translateTable
|
private static char[] |
tTable
|
private static char |
ZERO_CHAR
|
Constructor Summary | |
DefaultGroovyMethods()
|
Method Summary | |
static double |
abs(java.lang.Double number)
Get the absolute value |
static float |
abs(java.lang.Float number)
Get the absolute value |
static long |
abs(java.lang.Long number)
Get the absolute value |
static int |
abs(java.lang.Number number)
Get the absolute value |
static java.net.Socket |
accept(java.net.ServerSocket serverSocket,
Closure closure)
Allow to pass a Closure to the accept methods of ServerSocket |
static java.util.List |
allProperties(java.lang.Object self)
|
static java.lang.Number |
and(java.lang.Number left,
java.lang.Number right)
Bitwise AND together two Numbers |
static boolean |
any(java.lang.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(java.io.File file,
java.lang.String text)
Append the text at the end of the File |
static void |
append(java.io.File file,
java.lang.String text,
java.lang.String charset)
Append the text at the end of the File with a specified encoding |
static java.util.Collection |
asImmutable(java.util.Collection self)
A convenience method for creating an immutable Collection |
static java.util.List |
asImmutable(java.util.List self)
A convenience method for creating an immutable list |
static java.util.Map |
asImmutable(java.util.Map self)
A convenience method for creating an immutable map |
static java.util.Set |
asImmutable(java.util.Set self)
A convenience method for creating an immutable list |
static java.util.SortedMap |
asImmutable(java.util.SortedMap self)
A convenience method for creating an immutable sorted map |
static java.util.SortedSet |
asImmutable(java.util.SortedSet self)
A convenience method for creating an immutable sorted set |
static java.util.List |
asList(java.util.Collection self)
Converts the given collection into a List |
static java.util.Collection |
asSynchronized(java.util.Collection self)
A convenience method for creating a synchronized Collection |
static java.util.List |
asSynchronized(java.util.List self)
A convenience method for creating a synchronized List |
static java.util.Map |
asSynchronized(java.util.Map self)
A convenience method for creating a synchronized Map |
static java.util.Set |
asSynchronized(java.util.Set self)
A convenience method for creating a synchronized Set |
static java.util.SortedMap |
asSynchronized(java.util.SortedMap self)
A convenience method for creating a synchronized SortedMap |
static java.util.SortedSet |
asSynchronized(java.util.SortedSet self)
A convenience method for creating a synchronized SortedSet |
static java.io.File |
asWritable(java.io.File file)
|
static java.io.File |
asWritable(java.io.File file,
java.lang.String encoding)
|
static java.lang.String |
center(java.lang.String self,
java.lang.Number numberOfChars)
Center a String and padd it with spaces appended around it |
static java.lang.String |
center(java.lang.String self,
java.lang.Number numberOfChars,
java.lang.String padding)
Center a String and padd it with the characters appended around it |
static java.util.List |
collect(java.util.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 java.util.Collection |
collect(java.util.Collection self,
java.util.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 java.util.List |
collect(java.util.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 java.util.Collection |
collect(java.util.Map self,
java.util.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 java.util.List |
collect(java.lang.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 java.util.Collection |
collect(java.lang.Object self,
java.util.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(java.lang.Character left,
java.lang.Character right)
Compare two Characters |
static int |
compareTo(java.lang.Character left,
java.lang.Number right)
Compare a Character and a Number |
static int |
compareTo(java.lang.Number left,
java.lang.Character right)
Compare a Number and a Character |
static int |
compareTo(java.lang.Number left,
java.lang.Number right)
Compare two Numbers |
static boolean |
contains(java.lang.String self,
java.lang.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(java.util.Collection self,
java.lang.Object value)
Counts the number of occurencies of the given value inside this collection |
static int |
count(java.lang.String self,
java.lang.String text)
Count the number of occurencies of a substring |
protected static StringBufferWriter |
createStringBufferWriter(java.lang.StringBuffer self)
|
protected static java.io.StringWriter |
createStringWriter(java.lang.String self)
|
static byte[] |
decodeBase64(java.lang.String value)
Decode the Sting from base64 into a byte array |
static java.lang.Number |
div(java.lang.Character left,
java.lang.Character right)
Divide two Characters |
static java.lang.Number |
div(java.lang.Character left,
java.lang.Number right)
Divide a Character by a Number |
static java.lang.Number |
div(java.lang.Number left,
java.lang.Character right)
Divide a Number by a Character |
static java.lang.Number |
div(java.lang.Number left,
java.lang.Number right)
Divide two Numbers |
static java.lang.String |
dump(java.lang.Object self)
Generates a detailed dump string of an object showing its class, hashCode and fields |
static void |
each(java.util.Collection self,
Closure closure)
Allows objects to be iterated through using a closure |
static void |
each(java.util.Map self,
Closure closure)
Allows a Map to be iterated through using a closure. |
static void |
each(java.util.regex.Matcher matcher,
Closure closure)
|
static void |
each(java.lang.Object self,
Closure closure)
Allows objects to be iterated through using a closure |
static void |
eachByte(java.io.File self,
Closure closure)
Traverse through each byte of the specified File |
static void |
eachByte(java.io.InputStream is,
Closure closure)
Traverse through each byte of the specified stream |
static void |
eachByte(java.net.URL url,
Closure closure)
Traverse through each byte of the specified URL |
static void |
eachFile(java.io.File self,
Closure closure)
Invokes the closure for each file in the given directory |
static void |
eachFileRecurse(java.io.File self,
Closure closure)
Invokes the closure for each file in the given directory and recursively. |
static void |
eachLine(java.io.File self,
Closure closure)
Iterates through the given file line by line |
static void |
eachLine(java.io.InputStream stream,
Closure closure)
Iterates through the given stream line by line |
static void |
eachLine(java.io.Reader self,
Closure closure)
Iterates through the given reader line by line |
static void |
eachLine(java.net.URL url,
Closure closure)
Iterates through the lines read from the URL's associated input stream |
static void |
eachMatch(java.lang.String str,
java.lang.String regex,
Closure closure)
process each regex matched substring of a string object. |
static void |
eachProperty(java.lang.Object self,
Closure closure)
|
static void |
eachPropertyName(java.lang.Object self,
Closure closure)
|
static void |
eachWithIndex(java.lang.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(java.lang.Byte[] data)
|
static boolean |
every(java.lang.Object self,
Closure closure)
Iterates over every element of a collection, and check whether a predicate is valid for all elements. |
static java.lang.Process |
execute(java.lang.String self)
Executes the given string as a command line process. |
static Writable |
filterLine(java.io.File self,
Closure closure)
Filters the lines of a File and creates a Writeable in return to stream the filtered lines |
static void |
filterLine(java.io.File self,
java.io.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(java.io.InputStream self,
Closure predicate)
Filter lines from an input stream using a closure predicate |
static void |
filterLine(java.io.InputStream self,
java.io.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(java.io.Reader reader,
Closure closure)
Filter the lines of a Reader and create a Writable in return to stream the filtered lines |
static void |
filterLine(java.io.Reader reader,
java.io.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 java.lang.Object |
find(java.util.Collection self,
Closure closure)
Finds the first value matching the closure condition |
static java.lang.Object |
find(java.util.Map self,
Closure closure)
Finds the first value matching the closure condition |
static java.lang.Object |
find(java.lang.Object self,
Closure closure)
Finds the first value matching the closure condition |
static java.util.List |
findAll(java.util.Collection self,
Closure closure)
Finds all values matching the closure condition |
static java.util.List |
findAll(java.util.Map self,
Closure closure)
Finds all values matching the closure condition |
static java.util.List |
findAll(java.lang.Object self,
Closure closure)
Finds all values matching the closure condition |
static int |
findIndexOf(java.lang.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 |
private static java.util.List |
flatten(java.util.Collection elements,
java.util.List addTo)
|
static java.util.List |
flatten(java.util.List self)
Flatten a list |
static java.lang.Object |
get(java.util.Map map,
java.lang.Object key,
java.lang.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 java.lang.Object |
getAt(boolean[] array,
java.util.Collection indices)
|
static java.lang.Object |
getAt(boolean[] array,
int idx)
|
static java.lang.Object |
getAt(boolean[] array,
Range range)
|
static java.lang.Object |
getAt(byte[] array,
java.util.Collection indices)
|
static java.lang.Object |
getAt(byte[] array,
int idx)
|
static java.lang.Object |
getAt(byte[] array,
Range range)
|
static java.lang.Object |
getAt(char[] array,
java.util.Collection indices)
|
static java.lang.Object |
getAt(char[] array,
int idx)
|
static java.lang.Object |
getAt(char[] array,
Range range)
|
static java.lang.CharSequence |
getAt(java.lang.CharSequence self,
java.util.Collection indices)
Allows a List to be used as the indices to be used on a CharSequence |
static java.lang.CharSequence |
getAt(java.lang.CharSequence text,
int index)
Support the subscript operator for String. |
static java.lang.CharSequence |
getAt(java.lang.CharSequence text,
Range range)
Support the range subscript operator for CharSequence |
static java.util.List |
getAt(java.util.Collection coll,
java.lang.String property)
Support the subscript operator for List |
static java.lang.Object |
getAt(double[] array,
java.util.Collection indices)
|
static java.lang.Object |
getAt(double[] array,
int idx)
|
static java.lang.Object |
getAt(double[] array,
Range range)
|
static java.lang.Object |
getAt(float[] array,
java.util.Collection indices)
|
static java.lang.Object |
getAt(float[] array,
int idx)
|
static java.lang.Object |
getAt(float[] array,
Range range)
|
static java.lang.Object |
getAt(int[] array,
java.util.Collection indices)
|
static java.lang.Object |
getAt(int[] array,
int idx)
|
static java.lang.Object |
getAt(int[] array,
Range range)
|
static java.util.List |
getAt(java.util.List self,
java.util.Collection indices)
Allows a List to be used as the indices to be used on a List |
static java.lang.Object |
getAt(java.util.List self,
int idx)
Support the subscript operator for a List |
static java.util.List |
getAt(java.util.List self,
Range range)
Support the range subscript operator for a List |
static java.lang.Object |
getAt(long[] array,
java.util.Collection indices)
|
static java.lang.Object |
getAt(long[] array,
int idx)
|
static java.lang.Object |
getAt(long[] array,
Range range)
|
static java.lang.Object |
getAt(java.util.Map self,
java.lang.Object key)
Support the subscript operator for a List |
static java.lang.String |
getAt(java.util.regex.Matcher self,
java.util.Collection indices)
Allows a List to be used as the indices to be used on a Matcher |
static java.lang.String |
getAt(java.util.regex.Matcher matcher,
int idx)
Support the subscript operator for a regex Matcher |
static java.util.List |
getAt(java.lang.Object[] self,
java.util.Collection indices)
Allows a List to be used as the indices to be used on a List |
static java.lang.Object |
getAt(java.lang.Object[] array,
int idx)
Support the subscript operator for an Array |
static java.util.List |
getAt(java.lang.Object[] array,
Range range)
Support the range subscript operator for an Array |
static java.lang.Object |
getAt(java.lang.Object self,
java.lang.String property)
Allows the subscript operator to be used to lookup dynamic property values. |
static java.lang.Object |
getAt(short[] array,
java.util.Collection indices)
|
static java.lang.Object |
getAt(short[] array,
int idx)
|
static java.lang.Object |
getAt(short[] array,
Range range)
|
static java.lang.String |
getAt(java.lang.String self,
java.util.Collection indices)
Allows a List to be used as the indices to be used on a String |
static java.lang.String |
getAt(java.lang.String text,
int index)
Support the subscript operator for String |
static java.lang.String |
getAt(java.lang.String text,
Range range)
Support the range subscript operator for String |
static java.io.InputStream |
getErr(java.lang.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 java.io.InputStream |
getIn(java.lang.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 java.io.OutputStream |
getOut(java.lang.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 |
private static java.lang.String |
getPadding(java.lang.String padding,
int length)
|
protected static java.util.List |
getSubList(java.util.List self,
java.util.List splice)
|
static java.lang.String |
getText(java.io.BufferedReader reader)
Reads the content of the BufferedReader and returns it as a String |
static java.lang.String |
getText(java.io.File file)
Reads the content of the File and returns it as a String |
static java.lang.String |
getText(java.io.File file,
java.lang.String charset)
Reads the content of the File opened with the specified encoding and returns it as a String |
static java.lang.String |
getText(java.io.InputStream is)
Reads the content of this InputStream and returns it as a String |
static java.lang.String |
getText(java.io.InputStream is,
java.lang.String charset)
Reads the content of this InputStream with a specified charset and returns it as a String |
static java.lang.String |
getText(java.lang.Process self)
Read the text of the output stream of the Process. |
static java.lang.String |
getText(java.io.Reader reader)
Reads the content of the Reader and returns it as a String |
static java.lang.String |
getText(java.net.URL url)
Reads the content of this URL and returns it as a String |
static java.lang.String |
getText(java.net.URL url,
java.lang.String charset)
Reads the content of this URL and returns it as a String |
static java.util.List |
grep(java.lang.Object self,
java.lang.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 java.lang.Object |
inject(java.util.Collection self,
java.lang.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 java.lang.String |
inspect(java.lang.Object self)
|
static java.lang.Number |
intdiv(java.lang.Character left,
java.lang.Character right)
Integer Divide two Characters |
static java.lang.Number |
intdiv(java.lang.Character left,
java.lang.Number right)
Integer Divide a Character by a Number |
static java.lang.Number |
intdiv(java.lang.Number left,
java.lang.Character right)
Integer Divide a Number by a Character |
static java.lang.Number |
intdiv(java.lang.Number left,
java.lang.Number right)
Integer Divide two Numbers |
static java.util.List |
intersect(java.util.List left,
java.util.Collection right)
Create a List composed of the intersection of both collections |
static java.lang.Object |
invokeMethod(java.lang.Object object,
java.lang.String method,
java.lang.Object arguments)
Provide a dynamic method invocation method which can be overloaded in classes to implement dynamic proxies easily. |
static boolean |
isCase(java.lang.Class caseValue,
java.lang.Object switchValue)
|
static boolean |
isCase(java.util.Collection caseValue,
java.lang.Object switchValue)
|
static boolean |
isCase(java.lang.Object caseValue,
java.lang.Object switchValue)
|
static boolean |
isCase(java.util.regex.Pattern caseValue,
java.lang.Object switchValue)
|
static boolean |
isCase(java.lang.String caseValue,
java.lang.Object switchValue)
|
static java.lang.String |
join(java.util.Collection self,
java.lang.String separator)
Concatenates all of the items of the collection together with the given String as a separator |
static java.lang.String |
join(java.lang.Object[] self,
java.lang.String separator)
Concatenates all of the elements of the array together with the given String as a separator |
static java.util.Collection |
leftShift(java.util.Collection self,
java.lang.Object value)
Overloads the left shift operator to provide an easy way to append objects to a list |
static java.lang.Number |
leftShift(java.lang.Number left,
java.lang.Number right)
Implementation of the left shift operator for integral types. |
static java.io.OutputStream |
leftShift(java.io.OutputStream self,
byte[] value)
Overloads the left shift operator to provide an append mechanism to add bytes to a stream |
static java.io.Writer |
leftShift(java.io.OutputStream self,
java.lang.Object value)
Overloads the left shift operator to provide an append mechanism to add things to a stream |
static java.io.OutputStream |
leftShift(java.lang.Process self,
byte[] value)
Overloads the left shift operator to provide an append mechanism to pipe into a Process |
static java.io.Writer |
leftShift(java.lang.Process self,
java.lang.Object value)
Overloads the left shift operator to provide an append mechanism to pipe into a Process |
static java.io.OutputStream |
leftShift(java.net.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 java.io.Writer |
leftShift(java.net.Socket self,
java.lang.Object value)
Overloads the left shift operator to provide an append mechanism to add things to the output stream of a socket |
static java.io.Writer |
leftShift(java.lang.StringBuffer self,
java.lang.Object value)
Overloads the left shift operator to provide an easy way to append multiple objects as string representations to a StringBuffer |
static java.io.StringWriter |
leftShift(java.lang.String self,
java.lang.Object value)
Overloads the left shift operator to provide an easy way to append multiple objects as string representations to a String |
static java.io.Writer |
leftShift(java.io.Writer self,
java.lang.Object value)
Overloads the left shift operator to provide an append mechanism to add things to a writer |
static java.lang.Object |
max(java.util.Collection self)
Selects the maximum value found in the collection |
static java.lang.Object |
max(java.util.Collection self,
Closure closure)
Selects the maximum value found in the collection using the given closure as a comparator |
static java.lang.Object |
max(java.util.Collection self,
java.util.Comparator comparator)
Selects the maximum value found in the collection using the given comparator |
static java.lang.Object |
min(java.util.Collection self)
Selects the minimum value found in the collection |
static java.lang.Object |
min(java.util.Collection self,
Closure closure)
Selects the minimum value found in the collection using the given closure as a comparator |
static java.lang.Object |
min(java.util.Collection self,
java.util.Comparator comparator)
Selects the minimum value found in the collection using the given comparator |
static java.lang.Number |
minus(java.lang.Character left,
java.lang.Character right)
Subtraction two Characters |
static java.lang.Number |
minus(java.lang.Character left,
java.lang.Number right)
Subtract a Number from a Character |
static java.util.Date |
minus(java.util.Date self,
int days)
Subtracts a number of days from this date and returns the new date |
static java.util.List |
minus(java.util.List self,
java.util.Collection removeMe)
Create a List composed of the elements of the first list minus the elements of the collection |
static java.lang.Number |
minus(java.lang.Number left,
java.lang.Character right)
Subtract a Character from a Number |
static java.lang.Number |
minus(java.lang.Number left,
java.lang.Number right)
Substraction of two Numbers |
static java.lang.String |
minus(java.lang.String left,
java.lang.Object value)
Remove a part of a String |
static java.lang.Number |
mod(java.lang.Number left,
java.lang.Number right)
Performs a division modulus operation |
static java.lang.Number |
multiply(java.lang.Character left,
java.lang.Character right)
Multiply two Characters |
static java.lang.Number |
multiply(java.lang.Character left,
java.lang.Number right)
Multiply a Character by a Number |
static java.util.List |
multiply(java.util.Collection self,
java.lang.Number factor)
Create a List composed of the same elements repeated a certain number of times. |
static java.lang.Number |
multiply(java.lang.Number left,
java.lang.Character right)
Multiply a Number by a Character |
static java.lang.Number |
multiply(java.lang.Number left,
java.lang.Number right)
Multiply two Numbers |
static java.lang.String |
multiply(java.lang.String self,
java.lang.Number factor)
Repeat a String a certain number of times |
static java.util.regex.Pattern |
negate(GString self)
Turns a String into a regular expression pattern |
static java.lang.Number |
negate(java.lang.Number left)
Negates the number |
static java.util.regex.Pattern |
negate(java.lang.String self)
Turns a String into a regular expression pattern |
static java.io.BufferedInputStream |
newInputStream(java.io.File file)
Helper method to create a buffered input stream for a file |
static java.io.BufferedOutputStream |
newOutputStream(java.io.File file)
Helper method to create a buffered output stream for a file |
static java.io.PrintWriter |
newPrintWriter(java.io.File file)
Helper method to create a new PrintWriter for a file |
static java.io.PrintWriter |
newPrintWriter(java.io.File file,
java.lang.String charset)
Helper method to create a new PrintWriter for a file with a specified charset |
static java.io.BufferedReader |
newReader(java.io.File file)
Helper method to create a buffered reader for a file |
static java.io.BufferedReader |
newReader(java.io.File file,
java.lang.String charset)
Helper method to create a buffered reader for a file, with a specified charset |
static java.io.BufferedReader |
newReader(java.io.InputStream self)
Provides a reader for an arbitrary input stream |
static java.io.BufferedWriter |
newWriter(java.io.File file)
Helper method to create a buffered writer for a file |
static java.io.BufferedWriter |
newWriter(java.io.File file,
boolean append)
Helper method to create a buffered writer for a file in append mode |
static java.io.BufferedWriter |
newWriter(java.io.File file,
java.lang.String charset)
Helper method to create a buffered writer for a file |
static java.io.BufferedWriter |
newWriter(java.io.File file,
java.lang.String charset,
boolean append)
Helper method to create a buffered writer for a file |
static java.lang.Number |
next(java.lang.Character self)
Increment a Character by one |
static java.util.Date |
next(java.util.Date self)
Increments a Date by a day |
static java.lang.Number |
next(java.lang.Number self)
Increment a Number by one |
static java.lang.String |
next(java.lang.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 java.lang.Number |
or(java.lang.Number left,
java.lang.Number right)
Bitwise OR together two numbers |
static java.lang.String |
padLeft(java.lang.String self,
java.lang.Number numberOfChars)
Pad a String with the spaces appended to the left |
static java.lang.String |
padLeft(java.lang.String self,
java.lang.Number numberOfChars,
java.lang.String padding)
Pad a String with the characters appended to the left |
static java.lang.String |
padRight(java.lang.String self,
java.lang.Number numberOfChars)
Pad a String with the spaces appended to the right |
static java.lang.String |
padRight(java.lang.String self,
java.lang.Number numberOfChars,
java.lang.String padding)
Pad a String with the characters appended to the right |
static java.lang.Number |
plus(java.lang.Character left,
java.lang.Character right)
Add two Characters |
static java.lang.Number |
plus(java.lang.Character left,
java.lang.Number right)
Add a Character and a Number |
static java.util.List |
plus(java.util.Collection left,
java.util.Collection right)
Create a List as a union of both Collections |
static java.util.List |
plus(java.util.Collection left,
java.lang.Object right)
Create a List as a union of a Collection and an Object |
static java.util.Date |
plus(java.util.Date self,
int days)
Adds a number of days to this date and returns the new date |
static java.lang.Number |
plus(java.lang.Number left,
java.lang.Character right)
Add a Number and a Character |
static java.lang.Number |
plus(java.lang.Number left,
java.lang.Number right)
Add two Numbers |
static java.lang.String |
plus(java.lang.Number value,
java.lang.String right)
Appends a String |
static java.lang.String |
plus(java.lang.StringBuffer left,
java.lang.String value)
Appends a String |
static java.lang.String |
plus(java.lang.String left,
java.lang.Object value)
Appends a String |
static java.lang.Object |
pop(java.util.List self)
Removes the last item from the List. |
static java.lang.Number |
power(java.lang.Number self,
java.lang.Number exponent)
Power of a Number to a certain exponent |
static java.lang.Number |
previous(java.lang.Character self)
Decrement a Character by one |
static java.util.Date |
previous(java.util.Date self)
Decrement a Date by a day |
static java.lang.Number |
previous(java.lang.Number self)
Decrement a Number by one |
static java.lang.String |
previous(java.lang.String self)
This method is called by the -- operator for the class String. |
protected static java.util.List |
primitiveArrayGet(java.lang.Object self,
java.util.Collection indices)
Implements the getAt(Collection) method for primitve type arrays |
protected static java.lang.Object |
primitiveArrayGet(java.lang.Object array,
int idx)
Implements the getAt(int) method for primitve type arrays |
protected static java.util.List |
primitiveArrayGet(java.lang.Object array,
Range range)
Implements the getAt(Range) method for primitve type arrays |
protected static void |
primitiveArrayPut(java.lang.Object array,
int idx,
java.lang.Object newValue)
Implements the set(int idx) method for primitve type arrays |
static void |
print(java.lang.Object self,
java.lang.Object value)
Print to a console in interactive format |
static void |
print(java.lang.Object self,
java.io.PrintWriter out)
Print to a console in interactive format |
static void |
printf(java.lang.Object self,
java.lang.String format,
java.lang.Object[] values)
Printf to a console. |
static void |
println(java.lang.Object self)
Print a linebreak to the standard out. |
static void |
println(java.lang.Object self,
java.lang.Object value)
Print to a console in interactive format along with a newline |
static void |
println(java.lang.Object self,
java.io.PrintWriter out)
Print to a console in interactive format |
static void |
putAt(boolean[] array,
int idx,
java.lang.Boolean newValue)
|
static void |
putAt(byte[] array,
int idx,
java.lang.Object newValue)
|
static void |
putAt(char[] array,
int idx,
java.lang.Object newValue)
|
static void |
putAt(double[] array,
int idx,
java.lang.Object newValue)
|
static void |
putAt(float[] array,
int idx,
java.lang.Object newValue)
|
static void |
putAt(int[] array,
int idx,
java.lang.Object newValue)
|
static void |
putAt(java.util.List self,
int idx,
java.lang.Object value)
A helper method to allow lists to work with subscript operators |
static void |
putAt(java.util.List self,
java.util.List splice,
java.util.List values)
A helper method to allow lists to work with subscript operators |
static void |
putAt(java.util.List self,
java.util.List splice,
java.lang.Object value)
A helper method to allow lists to work with subscript operators |
static void |
putAt(long[] array,
int idx,
java.lang.Object newValue)
|
static java.lang.Object |
putAt(java.util.Map self,
java.lang.Object key,
java.lang.Object value)
A helper method to allow lists to work with subscript operators |
static void |
putAt(java.lang.Object[] array,
int idx,
java.lang.Object value)
Support the subscript operator for an Array |
static void |
putAt(java.lang.Object self,
java.lang.String property,
java.lang.Object newValue)
Allows the subscript operator to be used to set dynamically named property values. |
static void |
putAt(short[] array,
int idx,
java.lang.Object newValue)
|
static byte[] |
readBytes(java.io.File file)
Reads the content of the file into an array of byte |
static java.lang.String |
readLine(java.io.InputStream stream)
Read a single, whole line from the given InputStream |
static java.lang.String |
readLine(java.io.Reader self)
Read a single, whole line from the given Reader |
static java.util.List |
readLines(java.io.File file)
Reads the file into a list of Strings for each line |
static java.util.List |
readLines(java.io.InputStream stream)
Reads the stream into a list of Strings for each line |
static java.util.List |
readLines(java.io.Reader reader)
Reads the reader into a list of Strings for each line |
static java.util.List |
reverse(java.util.List self)
Reverses the list |
static java.lang.String |
reverse(java.lang.String self)
Creates a new string which is the reverse (backwards) of this string |
static void |
reverseEach(java.util.List self,
Closure closure)
Iterate over each element of the list in the reverse order. |
static java.lang.Number |
rightShift(java.lang.Number left,
java.lang.Number right)
Implementation of the right shift operator for integral types. |
static java.lang.Number |
rightShiftUnsigned(java.lang.Number left,
java.lang.Number right)
Implementation of the right shift (unsigned) operator for integral types. |
static long |
round(java.lang.Double number)
Round the value |
static int |
round(java.lang.Float number)
Get the absolute value |
private static boolean |
sameType(java.util.Collection[] cols)
|
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(java.lang.Object[] self)
Makes an Array look like a Collection by adding support for the size() method |
static int |
size(short[] array)
|
static int |
size(java.lang.String text)
Makes a String look like a Collection by adding support for the size() method |
static java.util.List |
sort(java.util.Collection self)
Sorts the given collection into a sorted list |
static java.util.List |
sort(java.util.Collection self,
Closure closure)
A convenience method for sorting a Collection using a closure as a comparator |
static java.util.List |
sort(java.util.Collection self,
java.util.Comparator comparator)
A convenience method for sorting a Collection with a specific comparator |
static java.util.List |
sort(java.util.List self)
A convenience method for sorting a List |
static java.util.List |
sort(java.util.List self,
Closure closure)
A convenience method for sorting a List using a closure as a comparator |
static java.util.List |
sort(java.util.List self,
java.util.Comparator comparator)
A convenience method for sorting a List with a specific comparator |
static java.util.SortedSet |
sort(java.util.SortedSet self)
Avoids doing unnecessary work when sorting an already sorted set |
static void |
splitEachLine(java.io.File self,
java.lang.String sep,
Closure closure)
Iterates through the given file line by line, splitting on the seperator |
static void |
splitEachLine(java.io.Reader self,
java.lang.String sep,
Closure closure)
Iterates through the given reader line by line, splitting on the seperator |
static void |
step(java.lang.Number self,
java.lang.Number to,
java.lang.Number stepNumber,
Closure closure)
Iterates from this number up to the given number using a step increment |
static java.util.Map |
subMap(java.util.Map map,
java.util.Collection keys)
Creates a sub-Map containing the given keys. |
static void |
times(java.lang.Number self,
Closure closure)
Iterates a number of times |
static java.lang.Character |
toCharacter(java.lang.String self)
Converts the given string into a Character object using the first character in the string |
static java.lang.Double |
toDouble(java.lang.String self)
Parse a String into a Double |
static java.lang.Float |
toFloat(java.lang.String self)
Parse a String into a Float |
static java.lang.Integer |
toInteger(java.lang.Number self)
Transform a Number into an Integer |
static java.lang.Integer |
toInteger(java.lang.String self)
Parse a String into an Integer |
static java.util.List |
tokenize(java.lang.String self)
Tokenize a String (with a whitespace as delimiter) |
static java.util.List |
tokenize(java.lang.String self,
java.lang.String token)
Tokenize a String |
static java.util.List |
toList(byte[] array)
|
static java.util.List |
toList(char[] array)
|
static java.util.List |
toList(java.util.Collection self)
Convert a collection to a List. |
static java.util.List |
toList(double[] array)
|
static java.util.List |
toList(float[] array)
|
static java.util.List |
toList(int[] array)
|
static java.util.List |
toList(long[] array)
|
static java.util.List |
toList(java.lang.Object[] array)
Allows conversion of arrays into a mutable List |
static java.util.List |
toList(short[] array)
|
static java.util.List |
toList(java.lang.String self)
Converts the given String into a List of strings of one character |
static java.lang.Long |
toLong(java.lang.String self)
Parse a String into a Long |
protected static java.lang.String |
toString(java.lang.Object value)
|
static java.net.URL |
toURL(java.lang.String self)
Transforms a String representing a URL into a URL object. |
static void |
transformChar(java.io.Reader reader,
java.io.Writer writer,
Closure closure)
Transforms the characters from a reader with a Closure and write them to a writer |
static void |
transformLine(java.io.Reader reader,
java.io.Writer writer,
Closure closure)
Transforms the lines from a reader with a Closure and write them to a writer |
static void |
upto(java.lang.Number self,
java.lang.Number to,
Closure closure)
Iterates from this number up to the given number |
static void |
use(java.lang.Object self,
java.lang.Class categoryClass,
Closure closure)
Scoped use method |
static void |
use(java.lang.Object self,
java.util.List categoryClassList,
Closure closure)
Scoped use method with list of categories |
static void |
waitForOrKill(java.lang.Process self,
long numberOfMillis)
Wait for the process to finish during a certain amount of time, otherwise stops the process. |
static void |
withInputStream(java.io.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(java.io.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(java.io.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(java.io.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(java.io.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(java.io.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(java.net.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(java.io.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(java.io.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(java.net.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(java.io.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(java.io.File file,
java.lang.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(java.io.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(java.io.OutputStream stream,
java.lang.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(java.io.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(java.io.File file,
java.lang.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(java.io.File file,
java.lang.String text)
Write the text to the File. |
static void |
write(java.io.File file,
java.lang.String text,
java.lang.String charset)
Write the text to the File with a specified encoding. |
static void |
write(java.io.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(java.io.BufferedWriter writer,
java.lang.String line)
Write the text and append a new line (depending on the platform line-ending) |
private static void |
writeUtf16Bom(java.io.FileOutputStream stream,
boolean bigEndian)
Write a Byte Order Mark at the begining of the file |
static java.lang.Number |
xor(java.lang.Number left,
java.lang.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 |
Field Detail |
private static java.util.logging.Logger log
private static final java.lang.Integer ONE
private static final char ZERO_CHAR
private static final char[] tTable
private static final byte[] translateTable
Constructor Detail |
public DefaultGroovyMethods()
Method Detail |
public static java.lang.Object getAt(java.lang.Object self, java.lang.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(java.lang.Object self, java.lang.String property, java.lang.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 java.lang.String dump(java.lang.Object self)
public static void eachPropertyName(java.lang.Object self, Closure closure)
public static void eachProperty(java.lang.Object self, Closure closure)
public static java.util.List allProperties(java.lang.Object self)
public static void use(java.lang.Object self, java.lang.Class categoryClass, Closure closure)
public static void use(java.lang.Object self, java.util.List categoryClassList, Closure closure)
public static void print(java.lang.Object self, java.lang.Object value)
public static void println(java.lang.Object self)
public static void println(java.lang.Object self, java.lang.Object value)
public static void printf(java.lang.Object self, java.lang.String format, java.lang.Object[] values)
public static java.lang.String inspect(java.lang.Object self)
public static void print(java.lang.Object self, java.io.PrintWriter out)
public static void println(java.lang.Object self, java.io.PrintWriter out)
out
- the PrintWriter used for printingpublic static java.lang.Object invokeMethod(java.lang.Object object, java.lang.String method, java.lang.Object arguments)
public static boolean isCase(java.lang.Object caseValue, java.lang.Object switchValue)
public static boolean isCase(java.lang.String caseValue, java.lang.Object switchValue)
public static boolean isCase(java.lang.Class caseValue, java.lang.Object switchValue)
public static boolean isCase(java.util.Collection caseValue, java.lang.Object switchValue)
public static boolean isCase(java.util.regex.Pattern caseValue, java.lang.Object switchValue)
public static void each(java.lang.Object self, Closure closure)
self
- the object over which we iterateclosure
- the closure applied on each element foundpublic static void eachWithIndex(java.lang.Object self, Closure closure)
self
- an Objectclosure
- a Closurepublic static void each(java.util.Collection self, Closure closure)
self
- the collection over which we iterateclosure
- the closure applied on each element of the collectionpublic static void each(java.util.Map self, Closure closure)
self
- the map over which we iterateclosure
- the closure applied on each entry of the mappublic static boolean every(java.lang.Object self, Closure closure)
self
- the object over which we iterateclosure
- the closure predicate used for matching
public static boolean any(java.lang.Object self, Closure closure)
self
- the object over which we iterateclosure
- the closure predicate used for matching
public static java.util.List grep(java.lang.Object self, java.lang.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(java.util.Collection self, java.lang.Object value)
self
- the collection within which we count the number of occurenciesvalue
- the value
public static java.util.List toList(java.util.Collection self)
self
- a collection
public static java.util.List collect(java.lang.Object self, Closure closure)
self
- the values of the object to mapclosure
- the closure used to map each element of the collection
public static java.util.Collection collect(java.lang.Object self, java.util.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 java.util.List collect(java.util.Collection self, Closure closure)
self
- a collectionclosure
- the closure used for mapping
public static java.util.Collection collect(java.util.Collection self, java.util.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 java.util.Collection collect(java.util.Map self, java.util.Collection collection, Closure closure)
self
- a Mapclosure
- the closure used for mapping
public static java.util.List collect(java.util.Map self, Closure closure)
self
- a Mapclosure
- the closure used to map each element of the collection
public static java.lang.Object find(java.lang.Object self, Closure closure)
self
- an Object with an iterator returning its valuesclosure
- a closure condition
public static java.lang.Object find(java.util.Collection self, Closure closure)
self
- a Collectionclosure
- a closure condition
public static java.lang.Object find(java.util.Map self, Closure closure)
self
- a Mapclosure
- a closure condition
public static java.util.List findAll(java.lang.Object self, Closure closure)
self
- an Object with an Iterator returning its valuesclosure
- a closure condition
public static java.util.List findAll(java.util.Collection self, Closure closure)
self
- a Collectionclosure
- a closure condition
public static java.util.List findAll(java.util.Map self, Closure closure)
self
- a Mapclosure
- a closure condition applying on the keys
public static java.lang.Object inject(java.util.Collection self, java.lang.Object value, Closure closure)
self
- a Collectionvalue
- a valueclosure
- a closure
public static java.lang.String join(java.util.Collection self, java.lang.String separator)
self
- a Collection of objectsseparator
- a String separator
public static java.lang.String join(java.lang.Object[] self, java.lang.String separator)
self
- an array of Objectseparator
- a String separator
public static java.lang.Object max(java.util.Collection self)
self
- a Collection
public static java.lang.Object max(java.util.Collection self, java.util.Comparator comparator)
self
- a Collectioncomparator
- a Comparator
public static java.lang.Object min(java.util.Collection self)
self
- a Collection
public static java.lang.Object min(java.util.Collection self, java.util.Comparator comparator)
self
- a Collectioncomparator
- a Comparator
public static java.lang.Object min(java.util.Collection self, Closure closure)
self
- a Collectionclosure
- a closure used as a comparator
public static java.lang.Object max(java.util.Collection self, Closure closure)
self
- a Collectionclosure
- a closure used as a comparator
public static int size(java.lang.String text)
text
- a String
public static int size(java.lang.Object[] self)
self
- an Array of Object
public static java.lang.CharSequence getAt(java.lang.CharSequence text, int index)
text
- a Stringindex
- the index of the Character to get
public static java.lang.String getAt(java.lang.String text, int index)
text
- a String
public static java.lang.CharSequence getAt(java.lang.CharSequence text, Range range)
text
- a CharSequencerange
- a Range
public static java.lang.String getAt(java.lang.String text, Range range)
text
- a Stringrange
- a Range
public static java.lang.String reverse(java.lang.String self)
self
- a String
public static java.net.URL toURL(java.lang.String self) throws java.net.MalformedURLException
self
- the String representing a URL
java.net.MalformedURLException
- is thrown if the URL is not well formed.public static java.util.regex.Pattern negate(java.lang.String self)
self
- a String to convert into a regular expression
public static java.util.regex.Pattern negate(GString self)
self
- a GString to convert into a regular expression
private static java.lang.String getPadding(java.lang.String padding, int length)
public static java.lang.String padLeft(java.lang.String self, java.lang.Number numberOfChars, java.lang.String padding)
numberOfChars
- the total number of characterspadding
- the charaters used for padding
public static java.lang.String padLeft(java.lang.String self, java.lang.Number numberOfChars)
numberOfChars
- the total number of characters
public static java.lang.String padRight(java.lang.String self, java.lang.Number numberOfChars, java.lang.String padding)
numberOfChars
- the total number of characterspadding
- the charaters used for padding
public static java.lang.String padRight(java.lang.String self, java.lang.Number numberOfChars)
numberOfChars
- the total number of characters
public static java.lang.String center(java.lang.String self, java.lang.Number numberOfChars, java.lang.String padding)
numberOfChars
- the total number of characterspadding
- the charaters used for padding
public static java.lang.String center(java.lang.String self, java.lang.Number numberOfChars)
numberOfChars
- the total number of characters
public static java.lang.String getAt(java.util.regex.Matcher matcher, int idx)
matcher
- a Matcheridx
- an index
public static java.util.List getAt(java.util.List self, Range range)
self
- a Listrange
- a Range
public static java.util.List getAt(java.util.List self, java.util.Collection indices)
self
- a Listindices
- a Collection of indices
public static java.util.List getAt(java.lang.Object[] self, java.util.Collection indices)
self
- an Array of Objectsindices
- a Collection of indices
public static java.lang.CharSequence getAt(java.lang.CharSequence self, java.util.Collection indices)
self
- a CharSequenceindices
- a Collection of indices
public static java.lang.String getAt(java.lang.String self, java.util.Collection indices)
self
- a Stringindices
- a Collection of indices
public static java.lang.String getAt(java.util.regex.Matcher self, java.util.Collection indices)
self
- a Matcherindices
- a Collection of indices
public static java.util.Map subMap(java.util.Map map, java.util.Collection keys)
map
- a Mapkeys
- a Collection of keys
public static java.lang.Object get(java.util.Map map, java.lang.Object key, java.lang.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 java.util.List getAt(java.lang.Object[] array, Range range)
array
- an Array of Objectsrange
- a Range
public static java.lang.Object getAt(java.lang.Object[] array, int idx)
array
- an Array of Objectsidx
- an index
public static void putAt(java.lang.Object[] array, int idx, java.lang.Object value)
array
- an Array of Objectsidx
- an indexvalue
- an Object to put at the given indexpublic static java.util.List toList(java.lang.Object[] array)
array
- an Array of Objects
public static java.lang.Object getAt(java.util.List self, int idx)
self
- a Listidx
- an index
public static void putAt(java.util.List self, int idx, java.lang.Object value)
self
- a Listidx
- an indexvalue
- the value to put at the given indexpublic static void putAt(java.util.List self, java.util.List splice, java.util.List values)
self
- a Listsplice
- the subset of the list to setvalues
- the value to put at the given sublistpublic static void putAt(java.util.List self, java.util.List splice, java.lang.Object value)
self
- a Listsplice
- the subset of the list to setvalue
- the value to put at the given sublistprotected static java.util.List getSubList(java.util.List self, java.util.List splice)
public static java.lang.Object getAt(java.util.Map self, java.lang.Object key)
self
- a Mapkey
- an Object as a key for the map
public static java.lang.Object putAt(java.util.Map self, java.lang.Object key, java.lang.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 java.util.List getAt(java.util.Collection coll, java.lang.String property)
coll
- a Collectionproperty
- a String
public static java.util.Map asImmutable(java.util.Map self)
self
- a Map
public static java.util.SortedMap asImmutable(java.util.SortedMap self)
self
- a SortedMap
public static java.util.List asImmutable(java.util.List self)
self
- a List
public static java.util.Set asImmutable(java.util.Set self)
self
- a Set
public static java.util.SortedSet asImmutable(java.util.SortedSet self)
self
- a SortedSet
public static java.util.Collection asImmutable(java.util.Collection self)
self
- a Collection
public static java.util.Map asSynchronized(java.util.Map self)
self
- a Map
public static java.util.SortedMap asSynchronized(java.util.SortedMap self)
self
- a SortedMap
public static java.util.Collection asSynchronized(java.util.Collection self)
self
- a Collection
public static java.util.List asSynchronized(java.util.List self)
self
- a List
public static java.util.Set asSynchronized(java.util.Set self)
self
- a Set
public static java.util.SortedSet asSynchronized(java.util.SortedSet self)
self
- a SortedSet
public static java.util.List sort(java.util.Collection self)
self
- the collection to be sorted
public static java.util.SortedSet sort(java.util.SortedSet self)
self
-
public static java.util.List sort(java.util.List self)
self
- a List to be sorted
public static java.lang.Object pop(java.util.List self)
self
- a List
java.lang.UnsupportedOperationException
- if the list is empty and you try to pop() it.public static java.util.List sort(java.util.List self, java.util.Comparator comparator)
self
- a Listcomparator
- a Comparator used for the comparison
public static java.util.List sort(java.util.Collection self, java.util.Comparator comparator)
self
- a collection to be sortedcomparator
- a Comparator used for the comparison
public static java.util.List sort(java.util.List self, Closure closure)
self
- a Listclosure
- a Closure used as a comparator
public static java.util.List sort(java.util.Collection self, Closure closure)
self
- a Collection to be sortedclosure
- a Closure used as a comparator
public static java.util.List asList(java.util.Collection self)
self
- a collection to be converted into a List
public static java.util.List reverse(java.util.List self)
self
- a List
public static java.util.List plus(java.util.Collection left, java.util.Collection right)
left
- the left Collectionright
- the right Collection
public static java.util.List plus(java.util.Collection left, java.lang.Object right)
left
- a Collectionright
- an object to append
public static java.util.List multiply(java.util.Collection self, java.lang.Number factor)
self
- a Collectionfactor
- the number of times to append
public static java.util.List intersect(java.util.List left, java.util.Collection right)
left
- a Listright
- a Collection
public static java.util.List minus(java.util.List self, java.util.Collection removeMe)
self
- a ListremoveMe
- a Collection of elements to remove
public static java.util.List flatten(java.util.List self)
self
- a List
public static void reverseEach(java.util.List self, Closure closure)
self
- a Listclosure
- a closureprivate static java.util.List flatten(java.util.Collection elements, java.util.List addTo)
public static java.util.Collection leftShift(java.util.Collection self, java.lang.Object value)
self
- a Collectionvalue
- an Object to be added to the collection.
public static java.io.StringWriter leftShift(java.lang.String self, java.lang.Object value)
self
- a Stringvalue
- an Obect
protected static java.io.StringWriter createStringWriter(java.lang.String self)
protected static StringBufferWriter createStringBufferWriter(java.lang.StringBuffer self)
public static java.io.Writer leftShift(java.lang.StringBuffer self, java.lang.Object value)
self
- a StringBuffervalue
- a value to append
public static java.io.Writer leftShift(java.io.Writer self, java.lang.Object value) throws java.io.IOException
self
- a Writervalue
- a value to append
java.io.IOException
public static java.lang.Number leftShift(java.lang.Number left, java.lang.Number right)
public static java.lang.Number rightShift(java.lang.Number left, java.lang.Number right)
public static java.lang.Number rightShiftUnsigned(java.lang.Number left, java.lang.Number right)
public static void write(java.io.Writer self, Writable writable) throws java.io.IOException
self
- a Writerwritable
- an object implementing the Writable interface
java.io.IOException
public static java.io.Writer leftShift(java.io.OutputStream self, java.lang.Object value) throws java.io.IOException
self
- an OutputStreamvalue
- a value to append
java.io.IOException
public static java.io.OutputStream leftShift(java.io.OutputStream self, byte[] value) throws java.io.IOException
self
- an OutputStreamvalue
- a value to append
java.io.IOException
private static boolean sameType(java.util.Collection[] cols)
public static java.lang.Object getAt(byte[] array, int idx)
public static java.lang.Object getAt(char[] array, int idx)
public static java.lang.Object getAt(short[] array, int idx)
public static java.lang.Object getAt(int[] array, int idx)
public static java.lang.Object getAt(long[] array, int idx)
public static java.lang.Object getAt(float[] array, int idx)
public static java.lang.Object getAt(double[] array, int idx)
public static java.lang.Object getAt(boolean[] array, int idx)
public static java.lang.Object getAt(byte[] array, Range range)
public static java.lang.Object getAt(char[] array, Range range)
public static java.lang.Object getAt(short[] array, Range range)
public static java.lang.Object getAt(int[] array, Range range)
public static java.lang.Object getAt(long[] array, Range range)
public static java.lang.Object getAt(float[] array, Range range)
public static java.lang.Object getAt(double[] array, Range range)
public static java.lang.Object getAt(boolean[] array, Range range)
public static java.lang.Object getAt(byte[] array, java.util.Collection indices)
public static java.lang.Object getAt(char[] array, java.util.Collection indices)
public static java.lang.Object getAt(short[] array, java.util.Collection indices)
public static java.lang.Object getAt(int[] array, java.util.Collection indices)
public static java.lang.Object getAt(long[] array, java.util.Collection indices)
public static java.lang.Object getAt(float[] array, java.util.Collection indices)
public static java.lang.Object getAt(double[] array, java.util.Collection indices)
public static java.lang.Object getAt(boolean[] array, java.util.Collection indices)
public static void putAt(boolean[] array, int idx, java.lang.Boolean newValue)
public static void putAt(byte[] array, int idx, java.lang.Object newValue)
public static void putAt(char[] array, int idx, java.lang.Object newValue)
public static void putAt(short[] array, int idx, java.lang.Object newValue)
public static void putAt(int[] array, int idx, java.lang.Object newValue)
public static void putAt(long[] array, int idx, java.lang.Object newValue)
public static void putAt(float[] array, int idx, java.lang.Object newValue)
public static void putAt(double[] array, int idx, java.lang.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 java.util.List toList(byte[] array)
public static java.util.List toList(char[] array)
public static java.util.List toList(short[] array)
public static java.util.List toList(int[] array)
public static java.util.List toList(long[] array)
public static java.util.List toList(float[] array)
public static java.util.List toList(double[] array)
public static Writable encodeBase64(java.lang.Byte[] data)
public static Writable encodeBase64(byte[] data)
data
- byte array to be encoded
public static byte[] decodeBase64(java.lang.String value)
value
- the string to be decoded
protected static java.lang.Object primitiveArrayGet(java.lang.Object array, int idx)
protected static java.util.List primitiveArrayGet(java.lang.Object array, Range range)
protected static java.util.List primitiveArrayGet(java.lang.Object self, java.util.Collection indices)
protected static void primitiveArrayPut(java.lang.Object array, int idx, java.lang.Object newValue)
public static java.lang.Character toCharacter(java.lang.String self)
self
- a String
public static java.util.List tokenize(java.lang.String self, java.lang.String token)
self
- a Stringtoken
- the delimiter
public static java.util.List tokenize(java.lang.String self)
self
- a String
public static java.lang.String plus(java.lang.String left, java.lang.Object value)
left
- a Stringvalue
- a String
public static java.lang.String plus(java.lang.Number value, java.lang.String right)
value
- a Numberright
- a String
public static java.lang.String plus(java.lang.StringBuffer left, java.lang.String value)
left
- a StringBuffervalue
- a String
public static java.lang.String minus(java.lang.String left, java.lang.Object value)
left
- a Stringvalue
- a String part to remove
public static boolean contains(java.lang.String self, java.lang.String text)
self
- a Stringtext
- a String to look for
public static int count(java.lang.String self, java.lang.String text)
self
- a Stringtext
- a substring
public static java.lang.String next(java.lang.String self)
self
- a String
public static java.lang.String previous(java.lang.String self)
self
- a String
public static java.lang.Process execute(java.lang.String self) throws java.io.IOException
self
- a command line String
java.io.IOException
public static java.lang.String multiply(java.lang.String self, java.lang.Number factor)
self
- a String to be repeatedfactor
- the number of times the String should be repeated
java.lang.IllegalArgumentException
- if the number of repeatition is < 0protected static java.lang.String toString(java.lang.Object value)
public static java.lang.Number next(java.lang.Character self)
self
- a Character
public static java.lang.Number next(java.lang.Number self)
self
- a Number
public static java.lang.Number previous(java.lang.Character self)
self
- a Character
public static java.lang.Number previous(java.lang.Number self)
self
- a Number
public static java.lang.Number plus(java.lang.Character left, java.lang.Number right)
left
- a Characterright
- a Number
public static java.lang.Number plus(java.lang.Number left, java.lang.Character right)
left
- a Numberright
- a Character
public static java.lang.Number plus(java.lang.Character left, java.lang.Character right)
left
- a Characterright
- a Character
public static java.lang.Number plus(java.lang.Number left, java.lang.Number right)
left
- a Numberright
- another Number to add
public static int compareTo(java.lang.Character left, java.lang.Number right)
left
- a Characterright
- a Number
public static int compareTo(java.lang.Number left, java.lang.Character right)
left
- a Numberright
- a Character
public static int compareTo(java.lang.Character left, java.lang.Character right)
left
- a Characterright
- a Character
public static int compareTo(java.lang.Number left, java.lang.Number right)
left
- a Numberright
- another Number to compare to
public static java.lang.Number minus(java.lang.Character left, java.lang.Number right)
left
- a Characterright
- a Number
public static java.lang.Number minus(java.lang.Number left, java.lang.Character right)
left
- a Numberright
- a Character
public static java.lang.Number minus(java.lang.Character left, java.lang.Character right)
left
- a Characterright
- a Character
public static java.lang.Number minus(java.lang.Number left, java.lang.Number right)
left
- a Numberright
- another Number to substract to the first one
public static java.lang.Number multiply(java.lang.Character left, java.lang.Number right)
left
- a Characterright
- a Number
public static java.lang.Number multiply(java.lang.Number left, java.lang.Character right)
left
- a Numberright
- a Character
public static java.lang.Number multiply(java.lang.Character left, java.lang.Character right)
left
- a Characterright
- another Character
public static java.lang.Number multiply(java.lang.Number left, java.lang.Number right)
left
- a Numberright
- another Number
public static java.lang.Number power(java.lang.Number self, java.lang.Number exponent)
self
- a Numberexponent
- a Number exponent
public static java.lang.Number div(java.lang.Character left, java.lang.Number right)
left
- a Characterright
- a Number
public static java.lang.Number div(java.lang.Number left, java.lang.Character right)
left
- a Numberright
- a Character
public static java.lang.Number div(java.lang.Character left, java.lang.Character right)
left
- a Characterright
- another Character
public static java.lang.Number div(java.lang.Number left, java.lang.Number right)
left
- a Numberright
- another Number
public static java.lang.Number intdiv(java.lang.Character left, java.lang.Number right)
left
- a Characterright
- a Number
public static java.lang.Number intdiv(java.lang.Number left, java.lang.Character right)
left
- a Numberright
- a Character
public static java.lang.Number intdiv(java.lang.Character left, java.lang.Character right)
left
- a Characterright
- another Character
public static java.lang.Number intdiv(java.lang.Number left, java.lang.Number right)
left
- a Numberright
- another Number
public static java.lang.Number or(java.lang.Number left, java.lang.Number right)
left
- a Numberright
- another Number to bitwise OR
public static java.lang.Number and(java.lang.Number left, java.lang.Number right)
left
- a Numberright
- another Number to bitwse AND
public static java.lang.Number xor(java.lang.Number left, java.lang.Number right)
left
- a Numberright
- another Number to bitwse XOR
public static java.lang.Number mod(java.lang.Number left, java.lang.Number right)
left
- a Numberright
- another Number to mod
public static java.lang.Number negate(java.lang.Number left)
left
- a Number
public static void times(java.lang.Number self, Closure closure)
self
- a Numberclosure
- the closure to call a number of timespublic static void upto(java.lang.Number self, java.lang.Number to, Closure closure)
self
- a Numberto
- another Number to go up toclosure
- the closure to callpublic static void step(java.lang.Number self, java.lang.Number to, java.lang.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(java.lang.Number number)
number
- a Number
public static long abs(java.lang.Long number)
number
- a Long
public static float abs(java.lang.Float number)
number
- a Float
public static double abs(java.lang.Double number)
number
- a Double
public static int round(java.lang.Float number)
number
- a Float
public static long round(java.lang.Double number)
number
- a Double
public static java.lang.Integer toInteger(java.lang.String self)
self
- a String
public static java.lang.Long toLong(java.lang.String self)
self
- a String
public static java.lang.Float toFloat(java.lang.String self)
self
- a String
public static java.lang.Double toDouble(java.lang.String self)
self
- a String
public static java.lang.Integer toInteger(java.lang.Number self)
self
- a Number
public static java.util.Date next(java.util.Date self)
self
- a Date
public static java.util.Date previous(java.util.Date self)
self
- a Date
public static java.util.Date plus(java.util.Date self, int days)
self
- a Datedays
- the number of days to increase
public static java.util.Date minus(java.util.Date self, int days)
self
- a Date
public static void eachLine(java.io.File self, Closure closure) throws java.io.IOException
self
- a Fileclosure
- a closure
java.io.IOException
public static void eachLine(java.io.Reader self, Closure closure) throws java.io.IOException
self
- a Readerclosure
- a closure
java.io.IOException
public static void splitEachLine(java.io.File self, java.lang.String sep, Closure closure) throws java.io.IOException
self
- a Filesep
- a String separatorclosure
- a closure
java.io.IOException
public static void splitEachLine(java.io.Reader self, java.lang.String sep, Closure closure) throws java.io.IOException
self
- a Readersep
- a String separatorclosure
- a closure
java.io.IOException
public static java.lang.String readLine(java.io.Reader self) throws java.io.IOException
self
- a Reader
java.io.IOException
public static java.lang.String readLine(java.io.InputStream stream) throws java.io.IOException
stream
- an InputStream
java.io.IOException
public static java.util.List readLines(java.io.File file) throws java.io.IOException
file
- a File
java.io.IOException
public static java.lang.String getText(java.io.File file, java.lang.String charset) throws java.io.IOException
file
- the file whose content we want to readcharset
- the charset used to read the content of the file
java.io.IOException
public static java.lang.String getText(java.io.File file) throws java.io.IOException
file
- the file whose content we want to read
java.io.IOException
public static java.lang.String getText(java.net.URL url) throws java.io.IOException
url
- URL to read content from
java.io.IOException
public static java.lang.String getText(java.net.URL url, java.lang.String charset) throws java.io.IOException
url
- URL to read content fromcharset
- opens the stream with a specified charset
java.io.IOException
public static java.lang.String getText(java.io.InputStream is) throws java.io.IOException
is
- an input stream
java.io.IOException
public static java.lang.String getText(java.io.InputStream is, java.lang.String charset) throws java.io.IOException
is
- an input streamcharset
- opens the stream with a specified charset
java.io.IOException
public static java.lang.String getText(java.io.Reader reader) throws java.io.IOException
reader
- a Reader whose content we want to read
java.io.IOException
public static java.lang.String getText(java.io.BufferedReader reader) throws java.io.IOException
reader
- a BufferedReader whose content we want to read
java.io.IOException
public static void writeLine(java.io.BufferedWriter writer, java.lang.String line) throws java.io.IOException
writer
- a BufferedWriterline
- the line to write
java.io.IOException
public static void write(java.io.File file, java.lang.String text) throws java.io.IOException
file
- a Filetext
- the text to write to the File
java.io.IOException
public static void write(java.io.File file, java.lang.String text, java.lang.String charset) throws java.io.IOException
file
- a Filetext
- the text to write to the Filecharset
- the charset used
java.io.IOException
public static void append(java.io.File file, java.lang.String text) throws java.io.IOException
file
- a Filetext
- the text to append at the end of the File
java.io.IOException
public static void append(java.io.File file, java.lang.String text, java.lang.String charset) throws java.io.IOException
file
- a Filetext
- the text to append at the end of the Filecharset
- the charset used
java.io.IOException
public static java.util.List readLines(java.io.Reader reader) throws java.io.IOException
reader
- a Reader
java.io.IOException
public static void eachFile(java.io.File self, Closure closure)
self
- a Fileclosure
- a closurepublic static void eachFileRecurse(java.io.File self, Closure closure)
self
- a Fileclosure
- a closurepublic static java.io.BufferedReader newReader(java.io.File file) throws java.io.IOException
file
- a File
java.io.IOException
public static java.io.BufferedReader newReader(java.io.File file, java.lang.String charset) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException
file
- a Filecharset
- the charset with which we want to write in the File
java.io.FileNotFoundException
- if the File was not found
java.io.UnsupportedEncodingException
- if the encoding specified is not supportedpublic static java.io.BufferedReader newReader(java.io.InputStream self)
self
- an input stream
public static void withReader(java.io.File file, Closure closure) throws java.io.IOException
file
-
java.io.FileNotFoundException
java.io.IOException
public static java.io.BufferedOutputStream newOutputStream(java.io.File file) throws java.io.IOException
file
-
java.io.FileNotFoundException
java.io.IOException
public static void withOutputStream(java.io.File file, Closure closure) throws java.io.IOException
file
- a File
java.io.FileNotFoundException
java.io.IOException
public static void withInputStream(java.io.File file, Closure closure) throws java.io.IOException
file
- a File
java.io.FileNotFoundException
java.io.IOException
public static java.io.BufferedWriter newWriter(java.io.File file) throws java.io.IOException
file
- a File
java.io.FileNotFoundException
java.io.IOException
public static java.io.BufferedWriter newWriter(java.io.File file, boolean append) throws java.io.IOException
file
- a Fileappend
- true if in append mode
java.io.FileNotFoundException
java.io.IOException
public static java.io.BufferedWriter newWriter(java.io.File file, java.lang.String charset, boolean append) throws java.io.IOException
file
- a Filecharset
- the name of the encoding used to write in this fileappend
- true if in append mode
java.io.FileNotFoundException
java.io.IOException
public static java.io.BufferedWriter newWriter(java.io.File file, java.lang.String charset) throws java.io.IOException
file
- a Filecharset
- the name of the encoding used to write in this file
java.io.FileNotFoundException
java.io.IOException
private static void writeUtf16Bom(java.io.FileOutputStream stream, boolean bigEndian) throws java.io.IOException
stream
- the FileOuputStream to write the BOM tobigEndian
- true if UTF 16 Big Endian or false if Low Endian
java.io.IOException
public static void withWriter(java.io.File file, Closure closure) throws java.io.IOException
file
- a Fileclosure
- a closure
java.io.FileNotFoundException
java.io.IOException
public static void withWriter(java.io.File file, java.lang.String charset, Closure closure) throws java.io.IOException
file
- a Filecharset
- the charset usedclosure
- a closure
java.io.FileNotFoundException
java.io.IOException
public static void withWriterAppend(java.io.File file, java.lang.String charset, Closure closure) throws java.io.IOException
file
- a Filecharset
- the charset usedclosure
- a closure
java.io.FileNotFoundException
java.io.IOException
public static java.io.PrintWriter newPrintWriter(java.io.File file) throws java.io.IOException
file
- a File
java.io.FileNotFoundException
java.io.IOException
public static java.io.PrintWriter newPrintWriter(java.io.File file, java.lang.String charset) throws java.io.IOException
file
- a Filecharset
- the charset
java.io.FileNotFoundException
java.io.IOException
public static void withPrintWriter(java.io.File file, Closure closure) throws java.io.IOException
file
- a File
java.io.FileNotFoundException
java.io.IOException
public static void withWriter(java.io.Writer writer, Closure closure) throws java.io.IOException
writer
- the writer which is used and then closedclosure
- the closure that the writer is passed into
java.io.IOException
public static void withReader(java.io.Reader writer, Closure closure) throws java.io.IOException
writer
- the writer which is used and then closedclosure
- the closure that the writer is passed into
java.io.IOException
public static void withStream(java.io.InputStream stream, Closure closure) throws java.io.IOException
stream
- the stream which is used and then closedclosure
- the closure that the stream is passed into
java.io.IOException
public static java.util.List readLines(java.io.InputStream stream) throws java.io.IOException
stream
- a stream
java.io.IOException
public static void eachLine(java.io.InputStream stream, Closure closure) throws java.io.IOException
stream
- a streamclosure
- a closure
java.io.IOException
public static void eachLine(java.net.URL url, Closure closure) throws java.io.IOException
url
- a URL to open and readclosure
- a closure to apply on each line
java.io.IOException
public static void withReader(java.net.URL url, Closure closure) throws java.io.IOException
url
- a URL
java.io.FileNotFoundException
java.io.IOException
public static void withReader(java.io.InputStream in, Closure closure) throws java.io.IOException
in
- a stream
java.io.FileNotFoundException
java.io.IOException
public static void withWriter(java.io.OutputStream stream, Closure closure) throws java.io.IOException
stream
- the stream which is used and then closedclosure
- the closure that the writer is passed into
java.io.IOException
public static void withWriter(java.io.OutputStream stream, java.lang.String charset, Closure closure) throws java.io.IOException
stream
- the stream which is used and then closedcharset
- the charset usedclosure
- the closure that the writer is passed into
java.io.IOException
public static void withStream(java.io.OutputStream stream, Closure closure) throws java.io.IOException
stream
- the stream which is used and then closedclosure
- the closure that the stream is passed into
java.io.IOException
public static java.io.BufferedInputStream newInputStream(java.io.File file) throws java.io.FileNotFoundException
file
- a File
java.io.FileNotFoundException
public static void eachByte(java.io.File self, Closure closure) throws java.io.IOException
self
- a Fileclosure
- a closure
java.io.IOException
public static void eachByte(java.io.InputStream is, Closure closure) throws java.io.IOException
is
- stream to iterate overclosure
- closure to apply to each byte
java.io.IOException
public static void eachByte(java.net.URL url, Closure closure) throws java.io.IOException
url
- url to iterate overclosure
- closure to apply to each byte
java.io.IOException
public static void transformChar(java.io.Reader reader, java.io.Writer writer, Closure closure)
reader
- writer
- closure
- public static void transformLine(java.io.Reader reader, java.io.Writer writer, Closure closure) throws java.io.IOException
reader
- writer
- closure
-
java.io.IOException
public static void filterLine(java.io.Reader reader, java.io.Writer writer, Closure closure) throws java.io.IOException
reader
- a readerwriter
- a writerclosure
- the closure which returns booleans
java.io.IOException
public static Writable filterLine(java.io.File self, Closure closure) throws java.io.IOException
self
- a Fileclosure
- a closure which returns a boolean indicating to filter the line or not
java.io.IOException
- if self
is not readablepublic static void filterLine(java.io.File self, java.io.Writer writer, Closure closure) throws java.io.IOException
self
- a Filewriter
- a writerclosure
- a closure which returns a boolean value and takes a line as input
java.io.IOException
- if self
is not readablepublic static Writable filterLine(java.io.Reader reader, Closure closure)
reader
- a readerclosure
- a closure returning a boolean indicating to filter or not a line
public static Writable filterLine(java.io.InputStream self, Closure predicate)
self
- an input streampredicate
- a closure which returns boolean and takes a line
public static void filterLine(java.io.InputStream self, java.io.Writer writer, Closure predicate) throws java.io.IOException
self
- an InputStreamwriter
- a writer to write output topredicate
- a closure which returns a boolean and takes a line as input
java.io.IOException
public static byte[] readBytes(java.io.File file) throws java.io.IOException
file
- a File
java.io.IOException
public static void withStreams(java.net.Socket socket, Closure closure) throws java.io.IOException
socket
- a Socketclosure
- a Closure
java.io.IOException
public static java.io.Writer leftShift(java.net.Socket self, java.lang.Object value) throws java.io.IOException
self
- a Socketvalue
- a value to append
java.io.IOException
public static java.io.OutputStream leftShift(java.net.Socket self, byte[] value) throws java.io.IOException
self
- a Socketvalue
- a value to append
java.io.IOException
public static java.net.Socket accept(java.net.ServerSocket serverSocket, Closure closure) throws java.io.IOException
serverSocket
- a ServerSocketclosure
- a Closure
java.io.IOException
public static java.io.File asWritable(java.io.File file)
file
- a File
public static java.io.File asWritable(java.io.File file, java.lang.String encoding)
file
- a Fileencoding
- the encoding to be used when reading the file's contents
public static java.util.List toList(java.lang.String self)
self
- a String
public static java.io.InputStream getIn(java.lang.Process self)
public static java.lang.String getText(java.lang.Process self) throws java.io.IOException
self
- a Process
java.io.IOException
public static java.io.InputStream getErr(java.lang.Process self)
public static java.io.OutputStream getOut(java.lang.Process self)
public static java.io.Writer leftShift(java.lang.Process self, java.lang.Object value) throws java.io.IOException
self
- a Processvalue
- a value to append
java.io.IOException
public static java.io.OutputStream leftShift(java.lang.Process self, byte[] value) throws java.io.IOException
self
- a Processvalue
- a value to append
java.io.IOException
public static void waitForOrKill(java.lang.Process self, long numberOfMillis)
self
- a ProcessnumberOfMillis
- the number of milliseconds to wait before stopping the processpublic static void eachMatch(java.lang.String str, java.lang.String regex, Closure closure)
str
- the target stringregex
- a Regex stringclosure
- a closurepublic static void each(java.util.regex.Matcher matcher, Closure closure)
public static int findIndexOf(java.lang.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 |