|
||||||||||
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. |
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 void |
addObjectsFromArrayWithoutDuplicates(NSMutableArray self,
NSArray other)
|
static void |
addObjectToObjectOnBothSidesOfRelationshipWithKey(EOEnterpriseObject self,
EOEnterpriseObject reference,
String key)
|
static List |
allProperties(Object self)
|
static NSArray |
allSubEntities(EOEntity self,
boolean includeAbstracts)
|
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 void |
appendSeparatorIfLastNot(StringBuffer self,
char separator,
char not)
|
static boolean |
areIdenticalSets(NSArray self,
NSArray other)
|
static NSArray |
array(EODataSource self)
|
static NSArray |
arrayByAddingObjectsFromArrayWithoutDuplicates(NSArray self,
NSArray other)
|
static NSArray |
arrayValue(List self)
|
static NSArray |
arrayValue(Object self)
|
static NSArray |
arrayValueWithDefault(Object self,
NSArray def)
|
static NSArray |
arrayWithoutDuplicateKeyValue(NSArray self,
String key)
|
static NSArray |
arrayWithoutDuplicates(NSArray self)
|
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)
|
static boolean |
booleanValue(Object self)
|
static boolean |
booleanValueForBindingWithDefault(WOComponent self,
String binding,
boolean def)
|
static boolean |
booleanValueWithDefault(Object self,
boolean def)
|
static GregorianCalendar |
calendarForTimestamp(NSTimestamp self)
|
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 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 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 int |
compareTo(NSTimestamp left,
NSTimestamp right)
|
static Object |
computeAvgForKey(NSArray self,
String key)
|
static Object |
computeCountForKey(NSArray self,
String key)
|
static Object |
computeMaxForKey(NSArray self,
String key)
|
static Object |
computeMinForKey(NSArray self,
String key)
|
static Object |
computeSumForKey(NSArray self,
String key)
|
static void |
connectWithModelNamed(EOEditingContext self,
String name,
NSDictionary overrides)
|
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 boolean |
containsAnyObjectFromArray(NSArray self,
NSArray objects)
|
static boolean |
containsArray(NSArray self,
NSArray objects)
|
static void |
copyFiles(File self,
File dstDirectory,
boolean deleteOriginals,
boolean recursiveCopy,
FileFilter filter)
|
static int |
count(NSArray self,
Object object)
|
static int |
count(String self,
String text)
Count the number of occurencies of a substring |
static EOEnterpriseObject |
createAndInsertInstance(EOEditingContext self,
String entityName)
|
static EOEnterpriseObject |
createEO(EOEditingContext self,
String entityName)
|
static EOEnterpriseObject |
createEO(EOEditingContext self,
String entityName,
NSDictionary objectInfo)
|
static EOEnterpriseObject |
createEOLinkedToEO(EOEditingContext self,
String entityName,
String relationshipName,
EOEnterpriseObject eo)
|
static EOEnterpriseObject |
createEOLinkedToEO(EOEditingContext self,
String entityName,
String relationshipName,
EOEnterpriseObject eo,
NSDictionary objectInfo)
|
protected static StringBufferWriter |
createStringBufferWriter(StringBuffer self)
|
protected static StringWriter |
createStringWriter(String self)
|
static EODatabaseContext |
databaseContextForModelNamed(EOEditingContext self,
String name)
|
static EOArrayDataSource |
dataSource(NSArray self)
|
static NSTimestamp |
dateByAddingTime(NSTimestamp self,
NSTimestamp other)
|
static int |
dayOfCommonEra(NSTimestamp self)
|
static int |
dayOfWeek(NSTimestamp self)
|
static int |
dayOfYear(NSTimestamp self)
|
static byte[] |
decodeBase64(String value)
Decode the Sting from base64 into a byte array |
static String |
decodedEntityName(String self)
|
static boolean |
deleteDirectory(File self)
|
static NSArray |
deletedObjectsPKeys(EOEditingContext self)
|
static void |
deleteFiles(File self,
boolean recurseIntoDirectories)
|
static void |
deplicateRelationship(ERXGenericRecord self,
String relationshipName)
|
static NSDictionary |
destinationKeyForSourceObject(EOEditingContext self,
EOEnterpriseObject object,
String name)
|
static NSDictionary |
dictionaryByRemovingFromDictionaryKeysInArray(NSDictionary self,
NSArray array)
|
static NSDictionary |
dictionaryGroupedByKeyPath(NSArray self,
String keyPath)
|
static NSDictionary |
dictionaryGroupedByKeyPath(NSArray self,
String keyPath,
boolean includeNulls,
String extraKeyPathForValues)
|
static NSDictionary |
dictionaryGroupedByToManyKeyPath(NSArray self,
String keyPath,
boolean includeNulls)
|
static NSDictionary |
dictionaryOfFormValues(NSArray self,
String separator,
boolean encrypt)
|
static NSDictionary |
dictionaryValue(Map self)
|
static NSDictionary |
dictionaryValue(Object self)
|
static NSDictionary |
dictionaryValueWithDefault(Object self,
NSDictionary def)
|
static NSDictionary |
dictionaryWithDictionary(NSDictionary self,
NSDictionary other)
|
static String |
displayName(String self)
|
static double |
distance(String self,
String other)
|
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 String |
dump(Object self)
Generates a detailed dump string of an object showing its class, hashCode and fields |
static void |
each(NSArray self,
Closure 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 |
eachFile(File self,
Closure closure)
Invokes the closure for each file in the given directory |
static void |
eachFileRecurse(File self,
Closure closure)
Invokes the closure for each file in the given directory and recursively. |
static void |
eachKey(NSDictionary self,
Closure closure)
|
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 str,
String regex,
Closure closure)
process each regex matched substring of a string object. |
static void |
eachProperty(Object self,
Closure closure)
|
static void |
eachPropertyName(Object self,
Closure closure)
|
static void |
eachValue(NSDictionary self,
Closure closure)
|
static void |
eachWithIndex(NSArray self,
Closure closure)
|
static EOEditingContext |
ec(WOComponent self)
|
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 String |
encodedEntityName(EOEnterpriseObject self)
|
static NSArray |
entities(EOModelGroup self)
|
static EOEntity |
entityForClass(EOEditingContext self,
Class theClass)
|
static EOEntity |
entityForObject(EOEditingContext self,
EOEnterpriseObject obj)
|
static EOEntity |
entityNamed(EOEditingContext self,
String name)
|
static void |
evaluateSQLWithEntityNamed(EOEditingContext self,
String entityName,
String exp)
|
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(String self)
Executes the given string as a command line process. |
static NSDictionary |
executeStoredProcedureNamed(EOEditingContext self,
String name,
NSDictionary args)
|
static boolean |
existsFiles(URL self)
|
static EOEnterpriseObject |
faultWithPrimaryKey(EOEditingContext self,
String entityName,
NSDictionary pkDict)
|
static EOEnterpriseObject |
faultWithPrimaryKeyValue(EOEditingContext self,
String entityName,
Object value)
|
static NSArray |
filesInDirectory(File self,
boolean recursive)
|
static void |
filterArrayWithQualifier(NSMutableArray self,
EOQualifier qualifier)
|
static NSArray |
filteredArrayWithEntityFetchSpecification(NSArray self,
String fetchSpec,
String entity)
|
static NSArray |
filteredArrayWithEntityFetchSpecification(NSArray self,
String entity,
String fetchSpec,
NSDictionary bindings)
|
static NSArray |
filteredArrayWithQualifier(NSArray self,
EOQualifier qualifier)
|
static NSArray |
filteredArrayWithQualifierEvaluation(NSArray self,
EOQualifierEvaluation qualifier)
|
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 List |
findAll(Map self,
Closure closure)
Finds all values 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 String |
firstPropertyKey(String self)
|
static NSArray |
flatten(NSArray self)
|
static String |
friendlyDisplayForKeyPath(NSArray self,
String attribute,
String nullArrayDisplay,
String separator,
String finalSeparator)
|
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 |
get(NSKeyValueCoding self,
String property)
|
static Object |
getAt(byte[] array,
Collection indices)
|
static Object |
getAt(char[] array,
Collection indices)
|
static CharSequence |
getAt(CharSequence self,
Collection indices)
Allows a List to be used as the indices to be used on a CharSequence |
static Object |
getAt(double[] array,
Collection indices)
|
static Object |
getAt(EOEnterpriseObject self,
Object key)
|
static Object |
getAt(float[] array,
Collection indices)
|
static Object |
getAt(int[] array,
Collection indices)
|
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(long[] array,
Collection indices)
|
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(NSArray self,
int index)
|
static Object |
getAt(NSArray self,
String key)
|
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(short[] array,
Collection indices)
|
static String |
getAt(String self,
Collection indices)
Allows a List to be used as the indices to be used on a String |
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 Number |
getNextValFromSequenceNamed(EOEditingContext self,
String modelNamed,
String sequenceName)
|
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 |
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(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 int |
hourOfDay(NSTimestamp self)
|
static int |
indexOfNumeric(String self)
|
static int |
indexOfNumeric(String self,
int fromIndex)
|
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 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 Integer |
integer(String self)
|
static List |
intersect(List left,
Collection right)
Create a List composed of the intersection of both collections |
static NSArray |
intersectingElements(NSArray self,
NSArray other)
|
static int |
intValue(Object self)
|
static int |
intValueForBindingWithDefault(WOComponent self,
String binding,
int def)
|
static int |
intValueWithDefault(Object self,
int def)
|
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 |
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 boolean |
isEarlierThan(NSTimestamp self,
NSTimestamp other)
|
static boolean |
isLaterThan(NSTimestamp self,
NSTimestamp other)
|
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 String |
keyPathWithoutFirstProperty(String self)
|
static String |
keyPathWithoutLastProperty(String self)
|
static NSArray |
lastNMonthsArray(int self)
|
static NSArray |
lastNMonthsAsStringsArray(int self)
|
static String |
lastPathComponent(String self)
|
static String |
lastPropertyKey(String self)
|
static void |
leftShift(NSMutableArray self,
Object object)
|
static Number |
leftShift(Number left,
Number right)
Implementation of the left shift operator for integral types. |
static void |
linkFiles(File self,
File destination,
boolean symbolic,
boolean allowUnlink,
boolean doNotFollowSymbolicLinks)
|
static List |
list(NSArray self)
|
static EOEnterpriseObject |
localInstanceOfObject(EOEditingContext self,
EOEnterpriseObject object)
|
static NSArray |
localInstancesOfObjects(EOEditingContext self,
NSArray objects)
|
static String |
localizedTemplateStringForKey(Object self,
String key,
String framework,
NSArray languages)
|
static Map |
map(NSDictionary self)
|
static Object |
max(Collection self)
Selects the maximum value found in the collection |
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,
Comparator comparator)
Selects the minimum value found in the collection using the given comparator |
static NSArray |
minus(NSArray left,
NSArray right)
|
static int |
minuteOfHour(NSTimestamp self)
|
static Number |
mod(Number left,
Number right)
Performs a division modulus operation |
static EOModelGroup |
modelGroup(EOEditingContext self)
|
static int |
monthOfYear(NSTimestamp self)
|
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 NSMutableArray |
mutableArrayValue(List self)
|
static NSMutableDictionary |
mutableDictionaryValue(Map self)
|
static Number |
negate(Number left)
Negates the number |
static BufferedInputStream |
newInputStream(File file)
Helper method to create a buffered input stream for a 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 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)
Increments the last digit in the given string, resetting it and moving onto the next digit if increasing the digit no longer becomes a letter or digit. |
protected static int |
normaliseIndex(int i,
int size)
This converts a possibly negative index to a real index into the array. |
static Number |
objectCountWithQualifier(EOEditingContext self,
String entityName,
EOQualifier qualifier)
|
static EOEnterpriseObject |
objectFromRawRow(EOEditingContext self,
String name,
NSDictionary row)
|
static EOEnterpriseObject |
objectMatchingKeyAndValue(EOEditingContext self,
String name,
String key,
Object value)
|
static EOEnterpriseObject |
objectMatchingValues(EOEditingContext self,
String name,
NSDictionary values)
|
static NSArray |
objectsByDecodingFromFormValues(EOEditingContext self,
NSDictionary values)
|
static NSArray |
objectsForEntityNamed(EOEditingContext self,
String name)
|
static NSArray |
objectsMatchingKeyAndValue(EOEditingContext self,
String name,
String key,
Object value)
|
static NSArray |
objectsMatchingValues(EOEditingContext self,
String name,
NSDictionary values)
|
static NSArray |
objectsOfClass(EOEditingContext self,
Class aClass)
|
static NSArray |
objectsWithFetchSpecificationAndBindings(EOEditingContext self,
String entityName,
String fetchSpecName,
NSDictionary bindings)
|
static NSArray |
objectsWithQualifierFormat(EOEditingContext self,
String name,
String format,
NSArray args)
|
static EOEnterpriseObject |
objectWithFetchSpecificationAndBindings(EOEditingContext self,
String entityName,
String fetchSpecName,
NSDictionary bindings)
|
static EOEnterpriseObject |
objectWithPrimaryKey(EOEditingContext self,
String entityName,
NSDictionary pkDict)
|
static EOEnterpriseObject |
objectWithPrimaryKeyValue(EOEditingContext self,
String entityName,
Object value)
|
static EOEnterpriseObject |
objectWithQualifierFormat(EOEditingContext self,
String name,
String format,
NSArray args)
|
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 String |
pathExtension(String self)
|
static NSArray |
plus(NSArray left,
NSArray right)
|
static Object |
pop(NSMutableArray self)
|
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)
Decrements the last digit in the given string, resetting it and moving onto the next digit if increasing the digit no longer becomes a letter or digit. |
static NSDictionary |
primaryKeyDictionaryForEntity(EOEditingContext self,
String entityName)
|
static EOFetchSpecification |
primaryKeyFetchSpecificationForEntity(EOEditingContext self,
String entityName,
EOQualifier eoqualifier,
NSArray sortOrderings,
NSArray additionalKeys)
|
static NSDictionary |
primaryKeyForObject(EOEditingContext self,
EOEnterpriseObject object)
|
static NSArray |
primaryKeysMatchingQualifier(EOEditingContext self,
String entityName,
EOQualifier eoqualifier,
NSArray sortOrderings)
|
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 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 |
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 NSMutableArray |
push(NSMutableArray self,
Object object)
|
static void |
putAt(EOEnterpriseObject self,
Object key,
Object object)
|
static void |
putAt(NSMutableArray self,
int index,
Object object)
|
static void |
putAt(Object self,
String property,
Object newValue)
Allows the subscript operator to be used to set dynamically named property values. |
static EOQualifier |
qualifier(String self)
|
static EOQualifier |
qualifierForEnterpriseObject(EOEditingContext self,
EOEnterpriseObject object)
|
static EOQualifier |
qualifierWithArray(String self,
NSArray arguments)
|
static NSArray |
rawRowsForSQL(EOEditingContext self,
String modelName,
String sqlString,
NSArray keys)
|
static NSArray |
rawRowsForStoredProcedureNamed(EOEditingContext self,
String name,
NSDictionary args)
|
static NSArray |
rawRowsMatchingKeyAndValue(EOEditingContext self,
String name,
String key,
Object value)
|
static byte[] |
readBytes(File file)
Reads the content of the file into an array of byte |
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 void |
refault(EOEnterpriseObject self)
|
static EORelationship |
relationshipWithKeyPath(EOEnterpriseObject self,
String keyPath)
|
static void |
replicateDataToEO(ERXGenericRecord self,
ERXGenericRecord other,
NSArray attributeNames)
|
static void |
replicateRelationshipToEO(ERXGenericRecord self,
ERXGenericRecord other,
String relationshipName)
|
static NSArray |
reverse(NSArray self)
|
static void |
reverseEach(NSArray self,
Closure closure)
|
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 EOEntity |
rootParentEntity(EOEntity self)
|
static long |
round(Double number)
Round the value |
static int |
round(Float number)
Get the absolute value |
static NSSet |
set(NSArray self)
|
static void |
set(NSKeyValueCoding self,
String property,
Object newValue)
|
static Object |
shift(NSMutableArray self)
|
static void |
shiftObjectLeft(NSMutableArray self,
Object object)
|
static void |
shiftObjectRight(NSMutableArray self,
Object object)
|
static void |
show(Object self,
Object value)
|
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 List |
sort(Collection self)
Sorts the given collection into a sorted list |
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,
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 |
sortArrayUsingKeyOrderArray(NSMutableArray self,
NSArray sortOrderings)
|
static NSArray |
sortedArraySortedWithKey(NSArray self,
String key,
NSSelector selector)
|
static NSArray |
sortedArrayUsingKeyOrderArray(NSArray self,
NSArray sortOrderings)
|
static NSMutableArray |
sortedMutableArraySortedWithKey(NSArray self,
String key)
|
static void |
sortEOsUsingSingleKey(NSMutableArray self,
String key)
|
static void |
sortEOsUsingSingleKey(NSMutableArray self,
String key,
NSSelector selector)
|
static NSArray |
sortOrderings(Map self)
|
static NSSelector |
sortSelector(String self)
|
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 String |
stackTrace(Throwable 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 |
static String |
string(File self)
|
static String |
string(File self,
String encoding)
|
static String |
string(InputStream self)
|
static String |
string(InputStream self,
String encoding)
|
static String |
stringByAppendingPathComponent(String self,
String component)
|
static String |
stringByAppendingPathExtension(String self,
String extension)
|
static String |
stringByDeletingLastPathComponent(String self)
|
static String |
stringByDeletingPathExtension(String self)
|
static String |
stringByEncodingPrimaryKeys(EOEnterpriseObject self,
String seperator,
boolean encrypt)
|
static String |
stringByEscapingApostrophe(String self)
|
static String |
stringByEscapingNonBasicLatinChars(char self)
|
static String |
stringByEscapingNonBasicLatinChars(String self)
|
static String |
stringByEscapingSpace(String self)
|
static String |
stringByNormalizingExistingPath(String self)
|
static String |
stringByNormalizingPath(String self)
|
static String |
stringByRemovingExtraDots(String self)
|
static String |
stringByReplacingStringByString(String self,
String old,
String newString)
|
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 NSTimestamp |
timestamp(String self)
|
static NSTimestamp |
timestampByAddingTime(NSTimestamp self,
NSTimestamp other)
|
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 String |
toHexString(char self)
|
static String |
toHexString(String self)
|
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 Long |
toLong(String self)
Parse a String into a Long |
static String |
toLowerCase(String self)
|
protected static String |
toString(Object value)
|
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 NSTimestamp |
unixDate(Number self)
|
static Integer |
unixTimestamp(NSTimestamp self)
|
static NSMutableArray |
unshift(NSMutableArray self,
Object object)
|
static File |
unzip(File self,
File destination)
|
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 NSArray |
valuesForKeyPaths(NSArray self,
NSArray paths)
|
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 void |
writeToFile(InputStream self,
File file)
|
static int |
yearOfCommonEra(NSTimestamp self)
|
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 NSArray array(EODataSource self)
public static void connectWithModelNamed(EOEditingContext self, String name, NSDictionary overrides)
public static EOEnterpriseObject createAndInsertInstance(EOEditingContext self, String entityName)
public static NSDictionary primaryKeyForObject(EOEditingContext self, EOEnterpriseObject object)
public static EOQualifier qualifierForEnterpriseObject(EOEditingContext self, EOEnterpriseObject object)
public static Number getNextValFromSequenceNamed(EOEditingContext self, String modelNamed, String sequenceName)
public static EOFetchSpecification primaryKeyFetchSpecificationForEntity(EOEditingContext self, String entityName, EOQualifier eoqualifier, NSArray sortOrderings, NSArray additionalKeys)
public static NSArray primaryKeysMatchingQualifier(EOEditingContext self, String entityName, EOQualifier eoqualifier, NSArray sortOrderings)
public static EOEnterpriseObject createEO(EOEditingContext self, String entityName)
public static EOEnterpriseObject createEO(EOEditingContext self, String entityName, NSDictionary objectInfo)
public static EOEnterpriseObject createEOLinkedToEO(EOEditingContext self, String entityName, String relationshipName, EOEnterpriseObject eo)
public static EOEnterpriseObject createEOLinkedToEO(EOEditingContext self, String entityName, String relationshipName, EOEnterpriseObject eo, NSDictionary objectInfo)
public static EODatabaseContext databaseContextForModelNamed(EOEditingContext self, String name)
public static NSDictionary destinationKeyForSourceObject(EOEditingContext self, EOEnterpriseObject object, String name)
public static EOEntity entityForClass(EOEditingContext self, Class theClass)
public static EOEntity entityForObject(EOEditingContext self, EOEnterpriseObject obj)
public static EOEntity entityNamed(EOEditingContext self, String name)
public static EOEnterpriseObject faultWithPrimaryKey(EOEditingContext self, String entityName, NSDictionary pkDict)
public static EOEnterpriseObject faultWithPrimaryKeyValue(EOEditingContext self, String entityName, Object value)
public static EOEnterpriseObject localInstanceOfObject(EOEditingContext self, EOEnterpriseObject object)
public static NSArray localInstancesOfObjects(EOEditingContext self, NSArray objects)
public static EOModelGroup modelGroup(EOEditingContext self)
public static Number objectCountWithQualifier(EOEditingContext self, String entityName, EOQualifier qualifier)
public static NSArray deletedObjectsPKeys(EOEditingContext self)
public static NSDictionary primaryKeyDictionaryForEntity(EOEditingContext self, String entityName)
public static NSArray rawRowsForSQL(EOEditingContext self, String modelName, String sqlString, NSArray keys)
public static NSArray rawRowsForStoredProcedureNamed(EOEditingContext self, String name, NSDictionary args)
public static NSArray rawRowsMatchingKeyAndValue(EOEditingContext self, String name, String key, Object value)
public static NSDictionary executeStoredProcedureNamed(EOEditingContext self, String name, NSDictionary args)
public static void evaluateSQLWithEntityNamed(EOEditingContext self, String entityName, String exp)
public static EOEnterpriseObject objectFromRawRow(EOEditingContext self, String name, NSDictionary row)
public static EOEnterpriseObject objectMatchingKeyAndValue(EOEditingContext self, String name, String key, Object value)
public static EOEnterpriseObject objectMatchingValues(EOEditingContext self, String name, NSDictionary values)
public static NSArray objectsForEntityNamed(EOEditingContext self, String name)
public static NSArray objectsMatchingKeyAndValue(EOEditingContext self, String name, String key, Object value)
public static NSArray objectsMatchingValues(EOEditingContext self, String name, NSDictionary values)
public static NSArray objectsOfClass(EOEditingContext self, Class aClass)
public static NSArray objectsWithFetchSpecificationAndBindings(EOEditingContext self, String entityName, String fetchSpecName, NSDictionary bindings)
public static NSArray objectsWithQualifierFormat(EOEditingContext self, String name, String format, NSArray args)
public static EOEnterpriseObject objectWithFetchSpecificationAndBindings(EOEditingContext self, String entityName, String fetchSpecName, NSDictionary bindings)
public static EOEnterpriseObject objectWithPrimaryKey(EOEditingContext self, String entityName, NSDictionary pkDict)
public static EOEnterpriseObject objectWithPrimaryKeyValue(EOEditingContext self, String entityName, Object value)
public static EOEnterpriseObject objectWithQualifierFormat(EOEditingContext self, String name, String format, NSArray args)
public static NSArray objectsByDecodingFromFormValues(EOEditingContext self, NSDictionary values)
public static Object getAt(EOEnterpriseObject self, Object key)
public static void putAt(EOEnterpriseObject self, Object key, Object object)
public static void refault(EOEnterpriseObject self)
public static void addObjectToObjectOnBothSidesOfRelationshipWithKey(EOEnterpriseObject self, EOEnterpriseObject reference, String key)
public static EORelationship relationshipWithKeyPath(EOEnterpriseObject self, String keyPath)
public static void deplicateRelationship(ERXGenericRecord self, String relationshipName)
public static void replicateDataToEO(ERXGenericRecord self, ERXGenericRecord other, NSArray attributeNames)
public static void replicateRelationshipToEO(ERXGenericRecord self, ERXGenericRecord other, String relationshipName)
public static String stringByEncodingPrimaryKeys(EOEnterpriseObject self, String seperator, boolean encrypt)
public static String encodedEntityName(EOEnterpriseObject self)
public static NSArray allSubEntities(EOEntity self, boolean includeAbstracts)
public static EOEntity rootParentEntity(EOEntity self)
public static NSArray entities(EOModelGroup self)
public static NSArray filesInDirectory(File self, boolean recursive)
public static String string(File self) throws IOException
IOException
public static String string(File self, String encoding) throws IOException
IOException
public static String string(InputStream self) throws IOException
IOException
public static String string(InputStream self, String encoding) throws IOException
IOException
public static void copyFiles(File self, File dstDirectory, boolean deleteOriginals, boolean recursiveCopy, FileFilter filter) throws IOException, FileNotFoundException
IOException
FileNotFoundException
public static boolean deleteDirectory(File self)
public static void deleteFiles(File self, boolean recurseIntoDirectories)
public static void linkFiles(File self, File destination, boolean symbolic, boolean allowUnlink, boolean doNotFollowSymbolicLinks) throws IOException
IOException
public static File unzip(File self, File destination) throws IOException
IOException
public static void writeToFile(InputStream self, File file) throws IOException
IOException
public static NSArray arrayValue(List self)
public static NSMutableArray mutableArrayValue(List self)
public static NSDictionary dictionaryValue(Map self)
public static NSMutableDictionary mutableDictionaryValue(Map self)
public static NSArray arrayValue(Object self)
public static NSArray arrayValueWithDefault(Object self, NSArray def)
public static boolean booleanValue(Object self)
public static boolean booleanValueWithDefault(Object self, boolean def)
public static NSDictionary dictionaryValue(Object self)
public static NSDictionary dictionaryValueWithDefault(Object self, NSDictionary def)
public static int intValue(Object self)
public static int intValueWithDefault(Object self, int def)
public static NSArray lastNMonthsArray(int self)
public static NSArray lastNMonthsAsStringsArray(int self)
public static NSTimestamp unixDate(Number self)
public static String stackTrace(Throwable self)
public static String localizedTemplateStringForKey(Object self, String key, String framework, NSArray languages)
public static NSArray sortOrderings(Map self)
public static boolean existsFiles(URL self)
public static NSArray arrayByAddingObjectsFromArrayWithoutDuplicates(NSArray self, NSArray other)
public static NSDictionary dictionaryGroupedByKeyPath(NSArray self, String keyPath)
public static NSDictionary dictionaryGroupedByKeyPath(NSArray self, String keyPath, boolean includeNulls, String extraKeyPathForValues)
public static NSDictionary dictionaryGroupedByToManyKeyPath(NSArray self, String keyPath, boolean includeNulls)
public static NSArray arrayWithoutDuplicateKeyValue(NSArray self, String key)
public static NSArray arrayWithoutDuplicates(NSArray self)
public static String friendlyDisplayForKeyPath(NSArray self, String attribute, String nullArrayDisplay, String separator, String finalSeparator)
public static NSArray intersectingElements(NSArray self, NSArray other)
public static List list(NSArray self)
public static EOArrayDataSource dataSource(NSArray self)
public static NSSet set(NSArray self)
public static boolean containsAnyObjectFromArray(NSArray self, NSArray objects)
public static boolean containsArray(NSArray self, NSArray objects)
public static boolean areIdenticalSets(NSArray self, NSArray other)
public static Object computeAvgForKey(NSArray self, String key)
public static Object computeCountForKey(NSArray self, String key)
public static Object computeMaxForKey(NSArray self, String key)
public static Object computeMinForKey(NSArray self, String key)
public static Object computeSumForKey(NSArray self, String key)
public static Object getAt(NSArray self, int index)
public static Object getAt(NSArray self, String key)
public static int count(NSArray self, Object object)
public static NSArray valuesForKeyPaths(NSArray self, NSArray paths)
public static NSArray flatten(NSArray self)
public static NSArray filteredArrayWithQualifier(NSArray self, EOQualifier qualifier)
public static NSArray filteredArrayWithEntityFetchSpecification(NSArray self, String fetchSpec, String entity)
public static NSArray filteredArrayWithEntityFetchSpecification(NSArray self, String entity, String fetchSpec, NSDictionary bindings)
public static NSArray filteredArrayWithQualifierEvaluation(NSArray self, EOQualifierEvaluation qualifier)
public static NSArray sortedArrayUsingKeyOrderArray(NSArray self, NSArray sortOrderings)
public static NSArray sortedArraySortedWithKey(NSArray self, String key, NSSelector selector)
public static NSMutableArray sortedMutableArraySortedWithKey(NSArray self, String key)
public static NSArray plus(NSArray left, NSArray right)
public static NSArray minus(NSArray left, NSArray right)
public static NSArray reverse(NSArray self)
public static void each(NSArray self, Closure closure)
public static void eachWithIndex(NSArray self, Closure closure)
public static void reverseEach(NSArray self, Closure closure)
public static NSDictionary dictionaryOfFormValues(NSArray self, String separator, boolean encrypt)
public static void eachKey(NSDictionary self, Closure closure)
public static void eachValue(NSDictionary self, Closure closure)
public static NSDictionary dictionaryByRemovingFromDictionaryKeysInArray(NSDictionary self, NSArray array)
public static NSDictionary dictionaryWithDictionary(NSDictionary self, NSDictionary other)
public static Map map(NSDictionary self)
public static Object get(NSKeyValueCoding self, String property)
public static void set(NSKeyValueCoding self, String property, Object newValue)
public static void putAt(NSMutableArray self, int index, Object object)
public static void leftShift(NSMutableArray self, Object object)
public static NSMutableArray push(NSMutableArray self, Object object)
public static NSMutableArray unshift(NSMutableArray self, Object object)
public static void addObjectsFromArrayWithoutDuplicates(NSMutableArray self, NSArray other)
public static void shiftObjectLeft(NSMutableArray self, Object object)
public static void shiftObjectRight(NSMutableArray self, Object object)
public static Object pop(NSMutableArray self)
public static Object shift(NSMutableArray self)
public static void filterArrayWithQualifier(NSMutableArray self, EOQualifier qualifier)
public static void sortArrayUsingKeyOrderArray(NSMutableArray self, NSArray sortOrderings)
public static void sortEOsUsingSingleKey(NSMutableArray self, String key)
public static void sortEOsUsingSingleKey(NSMutableArray self, String key, NSSelector selector)
public static GregorianCalendar calendarForTimestamp(NSTimestamp self)
public static NSTimestamp dateByAddingTime(NSTimestamp self, NSTimestamp other)
public static NSTimestamp timestampByAddingTime(NSTimestamp self, NSTimestamp other)
public static Integer unixTimestamp(NSTimestamp self)
public static int dayOfCommonEra(NSTimestamp self)
public static int dayOfWeek(NSTimestamp self)
public static int dayOfYear(NSTimestamp self)
public static int hourOfDay(NSTimestamp self)
public static int minuteOfHour(NSTimestamp self)
public static int monthOfYear(NSTimestamp self)
public static int yearOfCommonEra(NSTimestamp self)
public static boolean isEarlierThan(NSTimestamp self, NSTimestamp other)
public static boolean isLaterThan(NSTimestamp self, NSTimestamp other)
public static int compareTo(NSTimestamp left, NSTimestamp right)
public static NSTimestamp timestamp(String self)
public static NSSelector sortSelector(String self)
public static Integer integer(String self)
public static String keyPathWithoutFirstProperty(String self)
public static String keyPathWithoutLastProperty(String self)
public static String lastPropertyKey(String self)
public static String stringByEscapingApostrophe(String self)
public static String stringByEscapingNonBasicLatinChars(char self)
public static String stringByEscapingNonBasicLatinChars(String self)
public static String stringByEscapingSpace(String self)
public static String stringByRemovingExtraDots(String self)
public static String stringByReplacingStringByString(String self, String old, String newString)
public static String stringByAppendingPathComponent(String self, String component)
public static String stringByAppendingPathExtension(String self, String extension)
public static String stringByDeletingLastPathComponent(String self)
public static String stringByDeletingPathExtension(String self)
public static String stringByNormalizingExistingPath(String self)
public static String stringByNormalizingPath(String self)
public static void appendSeparatorIfLastNot(StringBuffer self, char separator, char not)
public static EOQualifier qualifier(String self)
public static EOQualifier qualifierWithArray(String self, NSArray arguments)
public static String displayName(String self)
public static double distance(String self, String other)
public static String firstPropertyKey(String self)
public static int indexOfNumeric(String self)
public static int indexOfNumeric(String self, int fromIndex)
public static String lastPathComponent(String self)
public static String pathExtension(String self)
public static String toHexString(char self)
public static String toHexString(String self)
public static String toLowerCase(String self)
public static String decodedEntityName(String self)
public static int intValueForBindingWithDefault(WOComponent self, String binding, int def)
public static boolean booleanValueForBindingWithDefault(WOComponent self, String binding, boolean def)
public static EOEditingContext ec(WOComponent self)
public static void show(Object self, Object value)
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, Object value)
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 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 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 List collect(Collection self, Closure closure)
self
- a collectionclosure
- the closure used for mapping
public static List collect(Map self, Closure closure)
self
- a Mapclosure
- the closure used for mapping
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 List findAll(Map self, Closure closure)
self
- a Mapclosure
- a closure condition applying on the keys
public static Object inject(Collection self, Object value, Closure closure)
self
- a Collectionvalue
- 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 int size(String text)
text
- a String
public static int size(Object[] self)
self
- an Array of Object
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 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 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 toList(Object[] array)
array
- an Array of Objects
protected static int normaliseIndex(int i, int size)
i
- size
-
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 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 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 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 asList(Collection self)
self
- a collection to be converted into a List
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
protected static StringWriter createStringWriter(String self)
protected static StringBufferWriter createStringBufferWriter(StringBuffer self)
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 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 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 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 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 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 < 0protected 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 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 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 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 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 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(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)
self
- a Fileclosure
- a closurepublic static void eachFileRecurse(File self, Closure closure)
self
- a Fileclosure
- a closurepublic 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 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(Reader reader, Closure closure)
reader
- a readerclosure
- a closure returning a boolean indicating to filter or not a line
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 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 void waitForOrKill(Process self, long numberOfMillis)
self
- a ProcessnumberOfMillis
- the number of milliseconds to wait before stopping the processpublic static void eachMatch(String str, String regex, Closure closure)
str
- the target stringregex
- a Regex stringclosure
- 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 |