Class DefaultGroovyMethods

java.lang.Object
org.codehaus.groovy.runtime.DefaultGroovyMethodsSupport
org.codehaus.groovy.runtime.DefaultGroovyMethods

public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport
Defines new groovy methods which appear on classes inside the Groovy environment. Static methods are used with the first parameter being the destination class, i.e. public static String reverse(String self) provides a reverse() method for String.

NOTE: While this class contains many 'public' static methods, it is primarily regarded as an internal class (its internal package name suggests this also). We value backwards compatibility of these methods when used within Groovy but value less backwards compatibility at the Java method call level. I.e. future versions of Groovy may remove or move a method call in this file but would normally aim to keep the method available from within Groovy.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Class[]
     
    static final Class[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    abs(Double number)
    Gets the absolute value.
    static float
    abs(Float number)
    Gets the absolute value.
    static long
    abs(Long number)
    Gets the absolute value.
    static int
    abs(Number number)
    Gets the absolute value.
    static <T> boolean
    addAll(Collection<T> self, Iterable<? extends T> items)
    Adds all items from the iterable to the Collection.
    static <T> boolean
    addAll(Collection<T> self, Iterator<? extends T> items)
    Adds all items from the iterator to the Collection.
    static <T> boolean
    addAll(Collection<T> self, T[] items)
    Modifies the collection by adding all the elements in the specified array to the collection.
    static <T> boolean
    addAll(List<T> self, int index, T[] items)
    Modifies this list by inserting all the elements in the specified array into the list at the specified position.
    static void
    addShutdownHook(Object self, Closure closure)
    Allows the usage of addShutdownHook without getting the runtime first.
    static Boolean
    and(Boolean left, Boolean right)
    Logical conjunction of two boolean operators.
    static Number
    and(Number left, Number right)
    Bitwise AND together two Numbers.
    static BitSet
    and(BitSet left, BitSet right)
    Bitwise AND together two BitSets.
    static <T> Set<T>
    and(Set<T> left, Iterable<T> right)
    Creates a Set composed of the intersection of a Set and an Iterable.
    static <T> Set<T>
    and(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Creates a Set composed of the intersection of a Set and an Iterable.
    static <T> SortedSet<T>
    and(SortedSet<T> left, Iterable<T> right)
    Creates a SortedSet composed of the intersection of a SortedSet and an Iterable.
    static <T> SortedSet<T>
    and(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Creates a SortedSet composed of the intersection of a SortedSet and an Iterable.
    static <T> boolean
    any(Iterable<T> self, Closure predicate)
    Iterates over the contents of an iterable, and checks whether a predicate is valid for at least one element.
    static boolean
    any(Object self)
    Iterates over the elements of a collection, and checks whether at least one element is true according to the Groovy Truth.
    static boolean
    any(Object self, Closure predicate)
    Iterates over the contents of an object or collection, and checks whether a predicate is valid for at least one element.
    static <T> boolean
    any(Iterator<T> self, Closure predicate)
    Iterates over the contents of an iterator, and checks whether a predicate is valid for at least one element.
    static <K, V> boolean
    any(Map<K,V> self, Closure<?> predicate)
    Iterates over the entries of a map, and checks whether a predicate is valid for at least one entry.
    static <T> boolean
    any(T[] self, Closure predicate)
    Deprecated.
    static boolean
    asBoolean(boolean[] self)
    Deprecated.
    static boolean
    asBoolean(byte[] self)
    Deprecated.
    static boolean
    asBoolean(char[] self)
    Deprecated.
    static boolean
    asBoolean(double[] self)
    Deprecated.
    static boolean
    asBoolean(float[] self)
    Deprecated.
    static boolean
    asBoolean(int[] self)
    Deprecated.
    static boolean
    asBoolean(long[] self)
    Deprecated.
    static boolean
    asBoolean(short[] self)
    Deprecated.
    static boolean
    Coerce a Boolean instance to a boolean value.
    static boolean
    asBoolean(Character character)
    Coerce a character to a boolean value.
    static boolean
    asBoolean(Double object)
    Coerce a Double instance to a boolean value.
    static boolean
    asBoolean(Float object)
    Coerce a Float instance to a boolean value.
    static boolean
    asBoolean(Number number)
    Coerce a number to a boolean value.
    static boolean
    asBoolean(Object object)
    Coerce an object instance to a boolean value.
    static boolean
    asBoolean(Object[] self)
    Deprecated.
    static boolean
    asBoolean(Collection collection)
    Coerce a collection instance to a boolean value.
    static boolean
    Coerce an AtomicBoolean instance to a boolean value.
    static boolean
    asBoolean(Enumeration enumeration)
    Coerce an enumeration instance to a boolean value.
    static boolean
    asBoolean(Iterator iterator)
    Coerce an iterator instance to a boolean value.
    static boolean
    Coerce a map instance to a boolean value.
    static <T> Collection<T>
    asChecked(Collection<T> self, Class<T> type)
    Creates a checked view of a Collection.
    static <T> List<T>
    asChecked(List<T> self, Class<T> type)
    Creates a checked view of a List.
    static <K, V> Map<K,V>
    asChecked(Map<K,V> self, Class<K> keyType, Class<V> valueType)
    Creates a checked view of a Map.
    static <K, V> NavigableMap<K,V>
    asChecked(NavigableMap<K,V> self, Class<K> keyType, Class<V> valueType)
    Creates a checked view of a NavigableMap.
    static <T> NavigableSet<T>
    asChecked(NavigableSet<T> self, Class<T> type)
    Creates a checked view of a NavigableSet.
    static <T> Queue<T>
    asChecked(Queue<T> self, Class<T> type)
    Creates a checked view of a Queue.
    static <T> Set<T>
    asChecked(Set<T> self, Class<T> type)
    Creates a checked view of a Set.
    static <K, V> SortedMap<K,V>
    asChecked(SortedMap<K,V> self, Class<K> keyType, Class<V> valueType)
    Creates a checked view of a SortedMap.
    static <T> SortedSet<T>
    asChecked(SortedSet<T> self, Class<T> type)
    Creates a checked view of a SortedSet.
    static <T> Collection<T>
    Converts this Iterable to a Collection.
    static <T> Collection<T>
    A convenience method for creating an immutable Collection.
    static <T> List<T>
    asImmutable(List<T> self)
    A convenience method for creating an immutable List.
    static <K, V> Map<K,V>
    asImmutable(Map<K,V> self)
    A convenience method for creating an immutable Map.
    static <T> Set<T>
    asImmutable(Set<T> self)
    A convenience method for creating an immutable Set.
    static <K, V> SortedMap<K,V>
    A convenience method for creating an immutable SortedMap.
    static <T> SortedSet<T>
    A convenience method for creating an immutable SortedSet.
    static <T> List<T>
    asList(Iterable<T> self)
    Converts this Iterable to a List.
    static <T> List<T>
    asReversed(List<T> self)
    Creates a view list with reversed order, and the order of original list will not change.
    static <T> NavigableSet<T>
    Creates a reverse order view of the set.
    static String
    Get the detail information of Throwable instance's stack trace
    static <T> Collection<T>
    Creates a synchronized view of a Collection.
    static <T> List<T>
    Creates a synchronized view of a List.
    static <K, V> Map<K,V>
    asSynchronized(Map<K,V> self)
    Creates a synchronized view of a Map.
    static <K, V> NavigableMap<K,V>
    Creates a synchronized view of a NavigableMap.
    static <T> NavigableSet<T>
    Creates a synchronized view of a NavigableSet.
    static <T> Set<T>
    Creates a synchronized view of a Set.
    static <K, V> SortedMap<K,V>
    Creates a synchronized view of a SortedMap.
    static <T> SortedSet<T>
    Creates a synchronized view of a SortedSet.
    static <T> T
    asType(Closure impl, Class<T> type)
    Coerces the closure to an implementation of the given class.
    static <T> T
    asType(Iterable iterable, Class<T> clazz)
    Converts the given iterable to another type.
    static <T> T
    asType(Number self, Class<T> type)
    Transform this number to the given type, using the 'as' operator.
    static <T> T
    asType(Object[] self, Class<T> type)
    Deprecated.
    static <T> T
    asType(Object obj, Class<T> type)
    Converts a given object to a type.
    static <T> T
    asType(Collection col, Class<T> clazz)
    Converts the given collection to another type.
    static <T> T
    asType(Map map, Class<T> clazz)
    Coerces this map to the given type, using the map's keys as the public method names, and values as the implementation.
    static <T> Collection<T>
    Creates an unmodifiable view of a Collection.
    static <T> List<T>
    Creates an unmodifiable view of a List.
    static <K, V> Map<K,V>
    asUnmodifiable(Map<K,V> self)
    Creates an unmodifiable view of a Map.
    static <K, V> SortedMap<K,V>
    Creates an unmodifiable view of a NavigableMap.
    static <T> NavigableSet<T>
    Creates an unmodifiable view of a NavigableSet.
    static <T> Set<T>
    Creates an unmodifiable view of a Set.
    static <K, V> SortedMap<K,V>
    Creates an unmodifiable view of a SortedMap.
    static <T> SortedSet<T>
    Creates an unmodifiable view of a SortedSet.
    static BigDecimal
    average(byte[] self)
    Deprecated.
    static double
    average(double[] self)
    Deprecated.
    static double
    average(float[] self)
    Deprecated.
    static BigDecimal
    average(int[] self)
    Deprecated.
    static BigDecimal
    average(long[] self)
    Deprecated.
    static BigDecimal
    average(short[] self)
    Deprecated.
    static Object
    average(Iterable<?> self)
    Averages the items in an Iterable.
    static <T> Object
    average(Iterable<T> self, Closure closure)
    Averages the result of applying a closure to each item of an Iterable.
    static Object
    average(Object[] self)
    Deprecated.
    static Object
    average(Iterator<?> self)
    Averages the items from an Iterator.
    static <T> Object
    average(Iterator<T> self, Closure closure)
    Averages the result of applying a closure to each item returned from an iterator.
    static <T> Object
    average(T[] self, Closure closure)
    Deprecated.
    static Number
    Bitwise NEGATE a Number.
    static BitSet
    Bitwise NEGATE a BitSet.
    static <T> BufferedIterator<T>
    buffered(Iterator<T> self)
    Returns a BufferedIterator that allows examining the next element without consuming it.
    static <T> BufferedIterator<T>
    Returns a BufferedIterator that allows examining the next element without consuming it.
    static <T> BufferedIterator<T>
    Returns a BufferedIterator that allows examining the next element without consuming it.
    protected static <T> T
    callClosureForLine(Closure<T> closure, String line, int counter)
     
    protected static <T, K, V> T
    callClosureForMapEntry(Closure<T> closure, Map.Entry<K,V> entry)
     
    protected static <T, K, V> T
    callClosureForMapEntryAndCounter(Closure<T> closure, Map.Entry<K,V> entry, int counter)
     
    static <T> List<List<T>>
    chop(Iterable<T> self, int... chopSizes)
    Chops the Iterable into pieces, returning lists with sizes corresponding to the supplied chop sizes.
    static <T> List<List<T>>
    chop(Iterator<T> self, int... chopSizes)
    Chops the iterator items into pieces, returning lists with sizes corresponding to the supplied chop sizes.
    static <T> List<List<T>>
    chop(T[] self, int... chopSizes)
    Deprecated.
    static <T> List<List<T>>
    collate(Iterable<T> self, int size)
    Collates this iterable into sub-lists of length size.
    static <T> List<List<T>>
    collate(Iterable<T> self, int size, boolean keepRemainder)
    Collates this iterable into sub-lists of length size.
    static <T> List<List<T>>
    collate(Iterable<T> self, int size, int step)
    Collates this iterable into sub-lists of length size stepping through the code step elements for each subList.
    static <T> List<List<T>>
    collate(Iterable<T> self, int size, int step, boolean keepRemainder)
    Collates this iterable into sub-lists of length size stepping through the code step elements for each sub-list.
    static <T> List<List<T>>
    collate(T[] self, int size)
    Deprecated.
    static <T> List<List<T>>
    collate(T[] self, int size, boolean keepRemainder)
    Deprecated.
    static <T> List<List<T>>
    collate(T[] self, int size, int step)
    Deprecated.
    static <T> List<List<T>>
    collate(T[] self, int size, int step, boolean keepRemainder)
    Deprecated.
    static <E, T, C extends Collection<T>>
    C
    collect(E[] self, C collector, Closure<? extends T> transform)
    Deprecated.
    static <E, T> List<T>
    collect(E[] self, Closure<T> transform)
    Deprecated.
    static <E, T, C extends Collection<T>>
    C
    collect(Iterable<E> self, C collector, Closure<? extends T> transform)
    Iterates through this collection transforming each value into a new value using the transform closure and adding it to the supplied collector.
    static <E, T> List<T>
    collect(Iterable<E> self, Closure<T> transform)
    Iterates through this Iterable transforming each entry into a new value using the transform closure returning a list of transformed values.
    static <T> List<T>
    collect(Iterable<T> self)
    Iterates through this collection transforming each entry into a new value using Closure.IDENTITY as a transformer, basically returning a list of items copied from the original collection.
    static Collection
    Iterates through this aggregate Object transforming each item into a new value using Closure.IDENTITY as a transformer, basically returning a list of items copied from the original object.
    static <T, C extends Collection<T>>
    C
    collect(Object self, C collector, Closure<? extends T> transform)
    Iterates through this aggregate Object transforming each item into a new value using the transform closure and adding it to the supplied collector.
    static <T> List<T>
    collect(Object self, Closure<T> transform)
    Iterates through this aggregate Object transforming each item into a new value using the transform closure, returning a list of transformed values.
    static <E, T, C extends Collection<T>>
    C
    collect(Iterator<E> self, C collector, Closure<? extends T> transform)
    Iterates through this Iterator transforming each item into a new value using the transform closure and adding it to the supplied collector.
    static <E, T> List<T>
    collect(Iterator<E> self, Closure<T> transform)
    Iterates through this Iterator transforming each item into a new value using the transform closure, returning a list of transformed values.
    static <T, K, V, C extends Collection<T>>
    C
    collect(Map<K,V> self, C collector, Closure<? extends T> transform)
    Iterates through this Map transforming each map entry into a new value using the transform closure returning the collector with all transformed values added to it.
    static <T, K, V> List<T>
    collect(Map<K,V> self, Closure<T> transform)
    Iterates through this Map transforming each map entry into a new value using the transform closure returning a list of transformed values.
    static <K, V, E> Map<K,V>
    collectEntries(E[] self)
    Deprecated.
    static <K, V, E> Map<K,V>
    collectEntries(E[] self, Closure<?> transform)
    Deprecated.
    static <K, V, E> Map<K,V>
    collectEntries(E[] self, Map<K,V> collector)
    Deprecated.
    static <K, V, E> Map<K,V>
    collectEntries(E[] self, Map<K,V> collector, Closure<?> transform)
    Deprecated.
    static <K, V> Map<K,V>
    A variant of collectEntries for Iterable objects using the identity closure as the transform.
    static <K, V> Map<K,V>
    collectEntries(Iterable<?> self, Map<K,V> collector)
    A variant of collectEntries for Iterables using the identity closure as the transform and a supplied map as the destination of transformed entries.
    static <K, V, E> Map<K,V>
    collectEntries(Iterable<E> self, Closure<?> transform)
    Iterates through this Iterable transforming each item using the transform closure and returning a map of the resulting transformed entries.
    static <K, V, E> Map<K,V>
    collectEntries(Iterable<E> self, Function<? super E,K> keyTransform, Function<? super E,V> valueTransform)
    A variant of collectEntries for Iterables with separate functions for transforming the keys and values.
    static <K, V, E> Map<K,V>
    collectEntries(Iterable<E> self, Map<K,V> collector, Closure<?> transform)
    Iterates through this Iterable transforming each item using the closure as a transformer into a map entry, returning the supplied map with all the transformed entries added to it.
    static <K, V, E> Map<K,V>
    collectEntries(Iterable<E> self, Map<K,V> collector, Function<? super E,K> keyTransform, Function<? super E,V> valueTransform)
    A variant of collectEntries for Iterables with separate functions for transforming the keys and values.
    static <K, V> Map<K,V>
    A variant of collectEntries for Iterators using the identity closure as the transform.
    static <K, V> Map<K,V>
    collectEntries(Iterator<?> self, Map<K,V> collector)
    A variant of collectEntries for Iterators using the identity closure as the transform and a supplied map as the destination of transformed entries.
    static <K, V, E> Map<K,V>
    collectEntries(Iterator<E> self, Closure<?> transform)
    A variant of collectEntries for Iterators.
    static <K, V, E> Map<K,V>
    collectEntries(Iterator<E> self, Function<? super E,K> keyTransform, Function<? super E,V> valueTransform)
    A variant of collectEntries for Iterators with separate functions for transforming the keys and values.
    static <K, V, E> Map<K,V>
    collectEntries(Iterator<E> self, Map<K,V> collector, Closure<?> transform)
    A variant of collectEntries for Iterators using a supplied map as the destination of transformed entries.
    static <K, V, E> Map<K,V>
    collectEntries(Iterator<E> self, Map<K,V> collector, Function<? super E,K> keyTransform, Function<? super E,V> valueTransform)
    A variant of collectEntries for Iterators with separate functions for transforming the keys and values.
    static <K, V, X, Y> Map<K,V>
    collectEntries(Map<X,Y> self, Closure<?> transform)
    Iterates through this Map transforming each entry using the transform closure and returning a map of the transformed entries.
    static <K, V, X, Y> Map<K,V>
    collectEntries(Map<X,Y> self, Function<? super X,K> keyTransform, Function<? super Y,V> valueTransform)
    A variant of collectEntries for Maps with separate functions for transforming the keys and values.
    static <K, V, X, Y> Map<K,V>
    collectEntries(Map<X,Y> self, Map<K,V> collector, Closure<?> transform)
    Iterates through this Map transforming each map entry using the transform closure returning a map of the transformed entries.
    static <K, V, X, Y> Map<K,V>
    collectEntries(Map<X,Y> self, Map<K,V> collector, Function<? super X,K> keyTransform, Function<? super Y,V> valueTransform)
    A variant of collectEntries for Maps with separate functions for transforming the keys and values.
    static <K, V> Map<K,V>
    collectKeys(Map<K,V> keys, Function<? super K,K> keyTransform)
    Transform a Maps' keys leaving the values unchanged.
    static <K, V> Map<K,V>
    collectKeys(Map<K,V> keys, Map<K,V> collector, Function<? super K,K> keyTransform)
    Transform a Maps' keys leaving the values unchanged.
    static <T, E, C extends Collection<T>>
    C
    collectMany(E[] self, C collector, Closure<? extends Collection<? extends T>> projection)
    Deprecated.
    static <T, E> List<T>
    collectMany(E[] self, Closure<? extends Collection<? extends T>> projection)
    Deprecated.
    static <T, E, C extends Collection<T>>
    C
    collectMany(Iterable<E> self, C collector, Closure<? extends Collection<? extends T>> projection)
    Projects each item from a source collection to a result collection and concatenates (flattens) the resulting collections adding them into the collector.
    static <T, E> List<T>
    collectMany(Iterable<E> self, Closure<? extends Collection<? extends T>> projection)
    Projects each item from a source Iterable to a collection and concatenates (flattens) the resulting collections into a single list.
    static <T, E, C extends Collection<T>>
    C
    collectMany(Iterator<E> self, C collector, Closure<? extends Collection<? extends T>> projection)
    Projects each item from a source iterator to a collection and concatenates (flattens) the resulting collections into a single list.
    static <T, E> List<T>
    collectMany(Iterator<E> self, Closure<? extends Collection<? extends T>> projection)
    Projects each item from a source iterator to a collection and concatenates (flattens) the resulting collections into a single list.
    static <T, K, V, C extends Collection<T>>
    C
    collectMany(Map<K,V> self, C collector, Closure<? extends Collection<? extends T>> projection)
    Projects each item from a source map to a result collection and concatenates (flattens) the resulting collections adding them into the collector.
    static <T, K, V> List<T>
    collectMany(Map<K,V> self, Closure<? extends Collection<? extends T>> projection)
    Projects each item from a source map to a result collection and concatenates (flattens) the resulting collections adding them into a collection.
    static <T, K, V> Collection<T>
    collectMany$$bridge(Map<K,V> self, Closure<? extends Collection<? extends T>> projection)
    Deprecated.
    static <C extends Collection>
    C
    collectNested(Iterable self, C collector, Closure transform)
    Recursively iterates through this Iterable transforming each non-Collection value into a new value using the transform closure.
    static List
    collectNested(Iterable self, Closure transform)
    Recursively iterates through this Iterable transforming each non-Collection value into a new value using the closure as a transformer.
    static List
    collectNested(Collection self, Closure transform)
    Recursively iterates through this collection transforming each non-Collection value into a new value using the closure as a transformer.
    static <K, V> Map<K,V>
    collectValues(Map<K,V> keys, Function<? super V,V> valueTransform)
    Transform a Maps' values leaving the keys unchanged.
    static <K, V> Map<K,V>
    collectValues(Map<K,V> keys, Map<K,V> collector, Function<? super V,V> valueTransform)
    Transform a Maps' values leaving the keys unchanged.
    static List<List>
    Finds all combinations of items from the given aggregate of collections.
    static <T> List<T>
    combinations(Iterable self, Closure<T> function)
    Finds all combinations of items from the given aggregate of collections, then returns the results of the supplied transform.
    static int
    Compares two Characters.
    static int
    compareTo(Character left, Number right)
    Compares a Character and a Number.
    static int
    compareTo(Number left, Character right)
    Compares a Number and a Character.
    static int
    compareTo(Number left, Number right)
    Compares two Numbers.
    static boolean
    contains(boolean[] self, Object value)
    Deprecated.
    static boolean
    contains(byte[] self, Object value)
    Deprecated.
    static boolean
    contains(char[] self, Object value)
    Deprecated.
    static boolean
    contains(double[] self, Object value)
    Deprecated.
    static boolean
    contains(float[] self, Object value)
    Deprecated.
    static boolean
    contains(int[] self, Object value)
    Deprecated.
    static boolean
    contains(long[] self, Object value)
    Deprecated.
    static boolean
    contains(short[] self, Object value)
    Deprecated.
    static boolean
    contains(Iterable self, Object item)
    Returns true if this iterable contains the item.
    static boolean
    contains(Object[] self, Object value)
    Deprecated.
    static boolean
    containsAll(Iterable<?> self, Object[] items)
    Returns true if this iterable contains all the elements in the specified array.
    static Number
    count(boolean[] self, Object value)
    Deprecated.
    static Number
    count(byte[] self, Object value)
    Deprecated.
    static Number
    count(char[] self, Object value)
    Deprecated.
    static Number
    count(double[] self, Object value)
    Deprecated.
    static Number
    count(float[] self, Object value)
    Deprecated.
    static Number
    count(int[] self, Object value)
    Deprecated.
    static Number
    count(long[] self, Object value)
    Deprecated.
    static Number
    count(short[] self, Object value)
    Deprecated.
    static <T, E extends Number>
    E
    count(Iterable<T> self, E initialCount, Closure closure)
    Counts the number of occurrences which satisfy the given closure from inside this Iterable.
    static <T> Number
    count(Iterable<T> self, Closure closure)
    Counts the number of occurrences which satisfy the given closure from inside this Iterable.
    static Number
    count(Iterable self, Object value)
    Counts the number of occurrences of the given value inside this Iterable.
    static Number
    count(Object[] self, Object value)
    Deprecated.
    static <T, E extends Number>
    E
    count(Iterator<T> self, E initialCount, Closure closure)
    Counts the number of occurrences which satisfy the given closure from the items within this Iterator, adding the count to the initial count.
    static <T> Number
    count(Iterator<T> self, Closure closure)
    Counts the number of occurrences which satisfy the given closure from the items within this Iterator.
    static Number
    count(Iterator self, Object value)
    Counts the number of occurrences of the given value from the items within this Iterator.
    static <K, V, E extends Number>
    E
    count(Map<K,V> self, E initialCount, Closure<?> closure)
    Counts the number of occurrences which satisfy the given closure from inside this map.
    static <K, V> Number
    count(Map<K,V> self, Closure<?> closure)
    Counts the number of occurrences which satisfy the given closure from inside this map.
    static <T> Number
    count(T[] self, Closure predicate)
    Deprecated.
    static <K, E> Map<K,Integer>
    countBy(E[] self, Closure<K> closure)
    Deprecated.
    static <E> Map<E,Integer>
    countBy(Iterable<E> self)
    Creates a multiset-like map of the collection members.
    static <K, E> Map<K,Integer>
    countBy(Iterable<E> self, Closure<K> closure)
    Sorts all collection members into groups determined by the supplied mapping closure and counts the group size.
    static <E> Map<E,Integer>
    countBy(Iterator<E> self)
    Creates a multiset-like map of the iterator members.
    static <K, E> Map<K,Integer>
    countBy(Iterator<E> self, Closure<K> closure)
    Sorts all iterator items into groups determined by the supplied mapping closure and counts the group size.
    static <K, U, V> Map<K,Integer>
    countBy(Map<U,V> self, Closure<K> closure)
    Groups the members of a map into groups determined by the supplied mapping closure and counts the frequency of the created groups.
    static boolean
    disjoint(Iterable left, Iterable right)
    Returns true if the intersection of two iterables is empty.
    static Number
    div(Character left, Character right)
    Divide one Character by another.
    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 void
    downto(double self, Number to, Closure closure)
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
    static void
    downto(float self, Number to, Closure closure)
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
    static void
    downto(long self, Number to, Closure closure)
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
    static void
    downto(Double self, Number to, Closure closure)
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
    static void
    downto(Float self, Number to, Closure closure)
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
    static void
    downto(Long self, Number to, Closure closure)
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
    static void
    downto(Number self, Number to, Closure closure)
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
    static void
    downto(BigDecimal self, Number to, Closure closure)
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
    static void
    downto(BigInteger self, Number to, Closure closure)
    Iterates from this number down to the given number, inclusive, decrementing by one each time.
    static <T> Collection<T>
    drop(Iterable<T> self, int num)
    Drops the given number of elements from the head of this Iterable.
    static <T> Iterator<T>
    drop(Iterator<T> self, int num)
    Drops the given number of elements from the head of this iterator if they are available.
    static <T> List<T>
    drop(List<T> self, int num)
    Drops the given number of elements from the head of this List.
    static <K, V> Map<K,V>
    drop(Map<K,V> self, int num)
    Drops the given number of key/value pairs from the head of this map if they are available.
    static <T> SortedSet<T>
    drop(SortedSet<T> self, int num)
    Drops the given number of elements from the head of this List.
    static <T> T[]
    drop(T[] self, int num)
    Deprecated.
    static <T> Collection<T>
    dropRight(Iterable<T> self, int num)
    Drops the given number of elements from the tail of this Iterable.
    static <T> Iterator<T>
    dropRight(Iterator<T> self, int num)
    Drops the given number of elements from the tail of this Iterator.
    static <T> List<T>
    dropRight(List<T> self, int num)
    Drops the given number of elements from the tail of this List.
    static <T> SortedSet<T>
    dropRight(SortedSet<T> self, int num)
    Drops the given number of elements from the tail of this SortedSet.
    static <T> T[]
    dropRight(T[] self, int num)
    Deprecated.
    static <T> Collection<T>
    dropWhile(Iterable<T> self, Closure condition)
    Returns a suffix of this Iterable where elements are dropped from the front while the given closure evaluates to true.
    static <T> Iterator<T>
    dropWhile(Iterator<T> self, Closure<?> condition)
    Creates an Iterator that returns a suffix of the elements from an original Iterator.
    static <T> List<T>
    dropWhile(List<T> self, Closure condition)
    Returns a suffix of this List where elements are dropped from the front while the given Closure evaluates to true.
    static <K, V> Map<K,V>
    dropWhile(Map<K,V> self, Closure condition)
    Create a suffix of the given Map by dropping as many entries as possible from the front of the original Map such that calling the given closure condition evaluates to true when passed each of the dropped entries (or key/value pairs).
    static <T> SortedSet<T>
    dropWhile(SortedSet<T> self, Closure condition)
    Returns a suffix of this SortedSet where elements are dropped from the front while the given Closure evaluates to true.
    static <T> T[]
    dropWhile(T[] self, Closure<?> condition)
    Deprecated.
    static String
    dump(Object self)
    Generates a detailed dump string of an object showing its class, hashCode and all accessible fields.
    static <T> Iterable<T>
    each(Iterable<T> self, Closure closure)
    Iterates through an Iterable, passing each item to the given closure.
    static <T> Collection<T>
    each(Collection<T> self, Closure closure)
    Iterates through a Collection, passing each item to the given closure.
    static <T> Iterator<T>
    each(Iterator<T> self, Closure closure)
    Iterates through an Iterator, passing each item to the given closure.
    static <T> List<T>
    each(List<T> self, Closure closure)
    Iterates through a List, passing each item to the given closure.
    static <K, V> Map<K,V>
    each(Map<K,V> self, Closure<?> closure)
    Allows a Map to be iterated through using a closure.
    static <T> Set<T>
    each(Set<T> self, Closure closure)
    Iterates through a Set, passing each item to the given closure.
    static <T> SortedSet<T>
    each(SortedSet<T> self, Closure closure)
    Iterates through a SortedSet, passing each item to the given closure.
    static <T> T[]
    each(T[] self, Closure closure)
    Deprecated.
    static <T> T
    each(T self, Closure closure)
    Iterates through an aggregate type or data structure, passing each item to the given closure.
    static void
    eachByte(byte[] self, Closure closure)
    Deprecated.
    static void
    eachByte(Byte[] self, Closure closure)
    Deprecated.
    static void
    eachCombination(Iterable self, Closure<?> function)
    Applies a function on each combination of the input lists.
    static <T> Iterator<List<T>>
    eachPermutation(Iterable<T> self, Closure closure)
    Iterates over all permutations of a collection, running a closure for each iteration.
    static <T> Iterable<T>
    eachWithIndex(Iterable<T> self, Closure closure)
    Iterates through an iterable type, passing each item and the item's index (a counter starting at zero) to the given closure.
    static <T> Collection<T>
    eachWithIndex(Collection<T> self, Closure closure)
    Iterates through a Collection, passing each item and the item's index (a counter starting at zero) to the given closure.
    static <T> Iterator<T>
    eachWithIndex(Iterator<T> self, Closure closure)
    Iterates through an iterator type, passing each item and the item's index (a counter starting at zero) to the given closure.
    static <T> List<T>
    eachWithIndex(List<T> self, Closure closure)
    Iterates through a List, passing each item and the item's index (a counter starting at zero) to the given closure.
    static <K, V> Map<K,V>
    eachWithIndex(Map<K,V> self, Closure<?> closure)
    Allows a Map to be iterated through using a closure.
    static <T> Set<T>
    eachWithIndex(Set<T> self, Closure closure)
    Iterates through a Set, passing each item and the item's index (a counter starting at zero) to the given closure.
    static <T> SortedSet<T>
    eachWithIndex(SortedSet<T> self, Closure closure)
    Iterates through a SortedSet, passing each item and the item's index (a counter starting at zero) to the given closure.
    static <T> T[]
    eachWithIndex(T[] self, Closure closure)
    Deprecated.
    static <T> T
    eachWithIndex(T self, Closure closure)
    Iterates through an aggregate type or data structure, passing each item and the item's index (a counter starting at zero) to the given closure.
    static boolean
    equals(int[] left, int[] right)
    Deprecated.
    static boolean
    equals(Object[] left, List right)
    Deprecated.
    static boolean
    equals(List left, Object[] right)
    Determines if the contents of this list are equal to the contents of the given array in the same order.
    static boolean
    equals(List left, List right)
    Compare the contents of two Lists.
    static boolean
    equals(Map self, Map other)
    Compares two Maps treating coerced numerical values as identical.
    static <T> boolean
    equals(Set<T> self, Set<T> other)
    Compare the contents of two Sets for equality using Groovy's coercion rules.
    static boolean
    Compares this object against the specified object returning the same result as Double.equals(Object) but returning true if this object and the specified object are both zero and negative zero respectively or vice versa.
    static boolean
    Compares this object against the specified object returning the same result as Float.equals(Object) but returning true if this object and the specified object are both zero and negative zero respectively or vice versa.
    static <T> boolean
    every(Iterable<T> self, Closure predicate)
    Used to determine if the given predicate closure is valid (i.e.
    static boolean
    every(Object self)
    Iterates over every element of a collection, and checks whether all elements are true according to the Groovy Truth.
    static boolean
    every(Object self, Closure predicate)
    Used to determine if the given predicate closure is valid (i.e.
    static <T> boolean
    every(Iterator<T> self, Closure predicate)
    Used to determine if the given predicate closure is valid (i.e.
    static <K, V> boolean
    every(Map<K,V> self, Closure predicate)
    Iterates over the entries of a map, and checks whether a predicate is valid for all entries.
    static <T> boolean
    every(T[] self, Closure predicate)
    Deprecated.
    static Object
    find(Object self)
    Finds the first item matching the IDENTITY Closure (i.e. matching Groovy truth).
    static Object
    find(Object self, Closure closure)
    Finds the first value matching the closure condition.
    static <T> T
    find(Collection<T> self)
    Finds the first item matching the IDENTITY Closure (i.e. matching Groovy truth).
    static <T> T
    find(Collection<T> self, Closure closure)
    Finds the first value matching the closure condition.
    static <K, V> Map.Entry<K,V>
    find(Map<K,V> self, Closure<?> closure)
    Finds the first entry matching the closure condition.
    static <T> T
    find(T[] self, Closure condition)
    Deprecated.
    static List
    Finds all items matching the IDENTITY Closure (i.e. matching Groovy truth).
    static List
    findAll(Object self, Closure closure)
    Finds all items matching the closure condition.
    static <T> Collection<T>
    Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).
    static <T> Collection<T>
    findAll(Collection<T> self, Closure closure)
    Finds all values matching the closure condition.
    static <T> List<T>
    findAll(List<T> self)
    Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).
    static <T> List<T>
    findAll(List<T> self, Closure closure)
    Finds all values matching the closure condition.
    static <K, V> Map<K,V>
    findAll(Map<K,V> self, Closure closure)
    Finds all entries matching the closure condition.
    static <T> Set<T>
    findAll(Set<T> self)
    Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).
    static <T> Set<T>
    findAll(Set<T> self, Closure closure)
    Finds all values matching the closure condition.
    static <T> List<T>
    findAll(T[] self)
    Deprecated.
    static <T> List<T>
    findAll(T[] self, Closure condition)
    Deprecated.
    static Collection
    Deprecated.
    static Collection
    findAll$$bridge(Object self, Closure closure)
    Deprecated.
    static <T> Collection<T>
    findAll$$bridge(T[] self)
    Deprecated.
    static <T> Collection<T>
    findAll$$bridge(T[] self, Closure condition)
    Deprecated.
    static <T> int
    findIndexOf(Iterable<T> self, int startIndex, Closure condition)
    Iterates over the elements of an Iterable, starting from a specified startIndex, and returns the index of the first item that satisfies the condition specified by the closure.
    static <T> int
    findIndexOf(Iterable<T> self, Closure condition)
    Iterates over the elements of an Iterable and returns the index of the first item that satisfies the condition specified by the closure.
    static int
    findIndexOf(Object self, int startIndex, Closure condition)
    Iterates over the elements of an aggregate of items, starting from a specified startIndex, and returns the index of the first item that matches the condition specified in the closure.
    static int
    findIndexOf(Object self, Closure condition)
    Iterates over the elements of an aggregate of items and returns the index of the first item that matches the condition specified in the closure.
    static <T> int
    findIndexOf(Iterator<T> self, int startIndex, Closure condition)
    Iterates over the elements of an Iterator, starting from a specified startIndex, and returns the index of the first item that satisfies the condition specified by the closure.
    static <T> int
    findIndexOf(Iterator<T> self, Closure condition)
    Iterates over the elements of an Iterator and returns the index of the first item that satisfies the condition specified by the closure.
    static <T> int
    findIndexOf(T[] self, int startIndex, Closure condition)
    Deprecated.
    static <T> int
    findIndexOf(T[] self, Closure condition)
    Deprecated.
    static <T> List<Number>
    findIndexValues(Iterable<T> self, Closure condition)
    Iterates over the elements of an Iterable and returns the index values of the items that match the condition specified in the closure.
    static <T> List<Number>
    findIndexValues(Iterable<T> self, Number startIndex, Closure condition)
    Iterates over the elements of an Iterable, starting from a specified startIndex, and returns the index values of the items that match the condition specified in the closure.
    static List<Number>
    findIndexValues(Object self, Closure condition)
    Iterates over the elements of an aggregate of items and returns the index values of the items that match the condition specified in the closure.
    static List<Number>
    findIndexValues(Object self, Number startIndex, Closure condition)
    Iterates over the elements of an aggregate of items, starting from a specified startIndex, and returns the index values of the items that match the condition specified in the closure.
    static <T> List<Number>
    findIndexValues(Iterator<T> self, Closure condition)
    Iterates over the elements of an Iterator and returns the index values of the items that match the condition specified in the closure.
    static <T> List<Number>
    findIndexValues(Iterator<T> self, Number startIndex, Closure condition)
    Iterates over the elements of an Iterator, starting from a specified startIndex, and returns the index values of the items that match the condition specified in the closure.
    static <T> List<Number>
    findIndexValues(T[] self, Closure condition)
    Deprecated.
    static <T> List<Number>
    findIndexValues(T[] self, Number startIndex, Closure condition)
    Deprecated.
    static <T> int
    findLastIndexOf(Iterable<T> self, int startIndex, Closure condition)
    Iterates over the elements of an Iterable, starting from a specified startIndex, and returns the index of the last item that matches the condition specified in the closure.
    static <T> int
    findLastIndexOf(Iterable<T> self, Closure condition)
    Iterates over the elements of an Iterable and returns the index of the last item that matches the condition specified in the closure.
    static int
    findLastIndexOf(Object self, int startIndex, Closure condition)
    Iterates over the elements of an aggregate of items, starting from a specified startIndex, and returns the index of the last item that matches the condition specified in the closure.
    static int
    findLastIndexOf(Object self, Closure condition)
    Iterates over the elements of an aggregate of items and returns the index of the last item that matches the condition specified in the closure.
    static <T> int
    findLastIndexOf(Iterator<T> self, int startIndex, Closure condition)
    Iterates over the elements of an Iterator, starting from a specified startIndex, and returns the index of the last item that matches the condition specified in the closure.
    static <T> int
    findLastIndexOf(Iterator<T> self, Closure condition)
    Iterates over the elements of an Iterator and returns the index of the last item that matches the condition specified in the closure.
    static <T> int
    findLastIndexOf(T[] self, int startIndex, Closure condition)
    Deprecated.
    static <T> int
    findLastIndexOf(T[] self, Closure condition)
    Deprecated.
    static <S, T, U extends T, V extends T>
    T
    findResult(Iterable<S> self, U defaultResult, Closure<V> condition)
    Iterates through the Iterable calling the given closure condition for each item but stopping once the first non-null result is found and returning that result.
    static <T> T
    Iterates through the Iterable stopping once the first non-null result is found and returning that result.
    static <T, U> T
    findResult(Iterable<U> self, Closure<T> condition)
    Iterates through the Iterable calling the given closure condition for each item but stopping once the first non-null result is found and returning that result.
    static <T, U extends T, V extends T>
    T
    findResult(Iterable<U> self, V defaultResult)
    Iterates through the Iterable calling the given closure condition for each item but stopping once the first non-null result is found and returning that result.
    static Object
    Treats the object as iterable, iterating through the values it represents and returns the first non-null value, otherwise returns null.
    static Object
    findResult(Object self, Closure condition)
    Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns null.
    static Object
    findResult(Object self, Object defaultResult)
    Treats the object as iterable, iterating through the values it represents and returns the first non-null result, otherwise returns the defaultResult.
    static Object
    findResult(Object self, Object defaultResult, Closure condition)
    Treats the object as iterable, iterating through the values it represents and returns the first non-null result obtained from calling the closure, otherwise returns the defaultResult.
    static <S, T, U extends T, V extends T>
    T
    findResult(Iterator<S> self, U defaultResult, Closure<V> condition)
    Iterates through the Iterator calling the given closure condition for each item but stopping once the first non-null result is found and returning that result.
    static <T> T
    Iterates through the Iterator stopping once the first non-null result is found and returning that result.
    static <T, U> T
    findResult(Iterator<U> self, Closure<T> condition)
    Iterates through the Iterator calling the given closure condition for each item but stopping once the first non-null result is found and returning that result.
    static <T, U extends T, V extends T>
    T
    findResult(Iterator<U> self, V defaultResult)
    Iterates through the Iterator stopping once the first non-null result is found and returning that result.
    static <T, U extends T, V extends T, A, B>
    T
    findResult(Map<A,B> self, U defaultResult, Closure<V> condition)
    Returns the first non-null closure result found by passing each map entry to the closure, otherwise the defaultResult is returned.
    static <T, K, V> T
    findResult(Map<K,V> self, Closure<T> condition)
    Returns the first non-null closure result found by passing each map entry to the closure, otherwise null is returned.
    static <S, T> T
    findResult(S[] self, Closure<T> condition)
    Deprecated.
    static <S, T, U extends T, V extends T>
    T
    findResult(S[] self, U defaultResult, Closure<V> condition)
    Deprecated.
    static <T> T
    findResult(T[] self)
    Deprecated.
    static <T, U extends T, V extends T>
    T
    findResult(U[] self, V defaultResult)
    Deprecated.
    static <T> Collection<T>
    Iterates through the Iterable collecting any non-null results.
    static <T, U> Collection<T>
    findResults(Iterable<U> self, Closure<T> filteringTransform)
    Iterates through the Iterable transforming items using the supplied closure and collecting any non-null results.
    static <T> Collection<T>
    Iterates through the Iterator collecting any non-null results.
    static <T, U> Collection<T>
    findResults(Iterator<U> self, Closure<T> filteringTransform)
    Iterates through the Iterator transforming items using the supplied closure and collecting any non-null results.
    static <T, K, V> Collection<T>
    findResults(Map<K,V> self, Closure<T> filteringTransform)
    Iterates through the map transforming items using the supplied closure and collecting any non-null results.
    static <T> Collection<T>
    findResults(T[] self)
    Deprecated.
    static <T, U> Collection<T>
    findResults(U[] self, Closure<T> filteringTransform)
    Deprecated.
    static <T> T
    first(Iterable<T> self)
    Returns the first item from the Iterable.
    static <T> T
    first(List<T> self)
    Returns the first item from the List.
    static <T> T
    first(T[] self)
    Deprecated.
    static Collection
    flatten(boolean[] self)
    Deprecated.
    static Collection
    flatten(byte[] self)
    Deprecated.
    static Collection
    flatten(char[] self)
    Deprecated.
    static Collection
    flatten(double[] self)
    Deprecated.
    static Collection
    flatten(float[] self)
    Deprecated.
    static Collection
    flatten(int[] self)
    Deprecated.
    static Collection
    flatten(long[] self)
    Deprecated.
    static Collection
    flatten(short[] self)
    Deprecated.
    static <T, E> Collection<T>
    flatten(Iterable<E> self, boolean flattenOptionals, Closure<?> flattenUsing)
    Flatten an Iterable.
    static <T, E> Collection<T>
    flatten(Iterable<E> self, Closure<?> flattenUsing)
    Flatten an Iterable.
    static <T> Collection<T>
    flatten(Iterable<T> self)
    Flatten an Iterable.
    static <T> Collection<T>
    flatten(Iterable<T> self, boolean flattenOptionals)
    Flatten an Iterable.
    static Collection
    flatten(Object[] self)
    Deprecated.
    static <T> Collection<T>
    Flatten a Collection.
    static <T> List<T>
    flatten(List<T> self)
    Flatten a List.
    static <T> Collection<T>
    flatten(Optional<T> self)
    Flatten an Optional.
    static <T> Set<T>
    flatten(Set<T> self)
    Flatten a Set.
    static <T> SortedSet<T>
    flatten(SortedSet<T> self)
    Flatten a SortedSet.
    flattenMany(Iterable<?> self, Closure<?> transform)
    Flatten an Iterable.
    static <K, V> V
    get(Map<K,V> map, K key, V defaultValue)
    Looks up an item in a Map for the given key and returns the corresponding value.
    static List<Boolean>
    getAt(boolean[] self, IntRange range)
    Deprecated.
    static List<Boolean>
    getAt(boolean[] self, ObjectRange range)
    Deprecated.
    static List<Boolean>
    getAt(boolean[] self, Range range)
    Deprecated.
    static List<Boolean>
    getAt(boolean[] self, Collection indices)
    Deprecated.
    static List<Byte>
    getAt(byte[] self, IntRange range)
    Deprecated.
    static List<Byte>
    getAt(byte[] self, ObjectRange range)
    Deprecated.
    static List<Byte>
    getAt(byte[] self, Range range)
    Deprecated.
    static List<Byte>
    getAt(byte[] self, Collection indices)
    Deprecated.
    static List<Character>
    getAt(char[] self, IntRange range)
    Deprecated.
    static List<Character>
    getAt(char[] self, ObjectRange range)
    Deprecated.
    static List<Character>
    getAt(char[] self, Range range)
    Deprecated.
    static List<Character>
    getAt(char[] self, Collection indices)
    Deprecated.
    static List<Double>
    getAt(double[] self, IntRange range)
    Deprecated.
    static List<Double>
    getAt(double[] self, ObjectRange range)
    Deprecated.
    static List<Double>
    getAt(double[] self, Range range)
    Deprecated.
    static List<Double>
    getAt(double[] self, Collection indices)
    Deprecated.
    static List<Float>
    getAt(float[] self, IntRange range)
    Deprecated.
    static List<Float>
    getAt(float[] self, ObjectRange range)
    Deprecated.
    static List<Float>
    getAt(float[] self, Range range)
    Deprecated.
    static List<Float>
    getAt(float[] self, Collection indices)
    Deprecated.
    static List<Integer>
    getAt(int[] self, IntRange range)
    Deprecated.
    static List<Integer>
    getAt(int[] self, ObjectRange range)
    Deprecated.
    static List<Integer>
    getAt(int[] self, Range range)
    Deprecated.
    static List<Integer>
    getAt(int[] self, Collection indices)
    Deprecated.
    static List<Long>
    getAt(long[] self, IntRange range)
    Deprecated.
    static List<Long>
    getAt(long[] self, ObjectRange range)
    Deprecated.
    static List<Long>
    getAt(long[] self, Range range)
    Deprecated.
    static List<Long>
    getAt(long[] self, Collection indices)
    Deprecated.
    static List<Short>
    getAt(short[] self, IntRange range)
    Deprecated.
    static List<Short>
    getAt(short[] self, ObjectRange range)
    Deprecated.
    static List<Short>
    getAt(short[] self, Range range)
    Deprecated.
    static List<Short>
    getAt(short[] self, Collection indices)
    Deprecated.
    static <T> List<T>
    getAt(ListWithDefault<T> self, EmptyRange range)
    Support the range subscript operator for an eager or lazy List.
    static <T> List<T>
    getAt(ListWithDefault<T> self, Range range)
    Support the range subscript operator for an eager or lazy List.
    static <T> List<T>
    getAt(ListWithDefault<T> self, Collection indices)
    Select a List of items from an eager or lazy List using a Collection to identify the indices to be selected.
    static <T> T
    getAt(Iterable<T> self, int idx)
    Support the subscript operator for an Iterable.
    static Object
    getAt(Object self, String property)
    Allows the subscript operator to be used to lookup dynamic property values.
    static boolean
    getAt(BitSet self, int index)
    Support the subscript operator for a Bitset
    static BitSet
    getAt(BitSet self, IntRange range)
    Support retrieving a subset of a BitSet using a Range
    static List
    getAt(Collection coll, String property)
    Support the subscript operator for Collection.
    static <T> T
    getAt(Iterator<T> self, int idx)
    Support the subscript operator for an Iterator.
    static <T> T
    getAt(List<T> self, int idx)
    Support the subscript operator for a List.
    static <T> List<T>
    getAt(List<T> self, EmptyRange range)
    Support the range subscript operator for a List.
    static <T> List<T>
    getAt(List<T> self, Range range)
    Support the range subscript operator for a List.
    static <T> T
    getAt(List<T> self, Number idx)
    Support subscript operator for list access.
    static <T> List<T>
    getAt(List<T> self, Collection indices)
    Select a List of items from a List using a Collection to identify the indices to be selected.
    static <K, V> V
    getAt(Map<K,V> self, Object key)
    Support the subscript operator for a Map.
    static <T> List<T>
    getAt(T[] self, EmptyRange range)
    Deprecated.
    static <T> List<T>
    getAt(T[] self, IntRange range)
    Deprecated.
    static <T> List<T>
    getAt(T[] self, ObjectRange range)
    Deprecated.
    static <T> List<T>
    getAt(T[] self, Range range)
    Deprecated.
    static <T> List<T>
    getAt(T[] self, Collection indices)
    Deprecated.
    static Groovydoc
    Gets runtime groovydoc.
    static IntRange
    getIndices(boolean[] self)
    Deprecated.
    static IntRange
    getIndices(byte[] self)
    Deprecated.
    static IntRange
    getIndices(char[] self)
    Deprecated.
    static IntRange
    getIndices(double[] self)
    Deprecated.
    static IntRange
    getIndices(float[] self)
    Deprecated.
    static IntRange
    getIndices(int[] self)
    Deprecated.
    static IntRange
    getIndices(long[] self)
    Deprecated.
    static IntRange
    getIndices(short[] self)
    Deprecated.
    static IntRange
    Returns indices of the collection.
    static <T> IntRange
    getIndices(T[] self)
    Deprecated.
    static URL
    Gets the url of the jar file/source file containing the specified class.
    static MetaClass
    Obtains a MetaClass for an object either from the registry or in the case of a GroovyObject from the object itself.
    static MetaClass
    Adds a "metaClass" property to all class objects so you can use the syntax String.metaClass.myMethod = { println "foo" }
    static MetaClass
    Obtains a MetaClass for an object either from the registry or in the case of a GroovyObject from the object itself.
    Retrieves the list of MetaProperty objects for 'self' and wraps it in a list of PropertyValue objects that additionally provide the value for each property of 'self'.
    static Map<String,Object>
    Convenience method that calls getMetaPropertyValues(java.lang.Object)(self) and provides the data in form of simple key/value pairs, i.e.
    Iterates through the classloader parents until it finds a loader with a class named "org.codehaus.groovy.tools.RootLoader".
    static Collection
    grep(Object self)
    Iterates over the collection of items which this Object represents and returns each item that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.
    static Collection
    grep(Object self, Object filter)
    Iterates over the collection of items which this Object represents and returns each item that matches the given filter - calling the isCase(java.lang.Object, java.lang.Object) method used by switch statements.
    static <T> Collection<T>
    grep(Collection<T> self)
    Iterates over the collection returning each element that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.
    static <T> Collection<T>
    grep(Collection<T> self, Object filter)
    Iterates over the collection of items and returns each item that matches the given filter - calling the isCase(java.lang.Object, java.lang.Object) method used by switch statements.
    static <T> List<T>
    grep(List<T> self)
    Iterates over the collection returning each element that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.
    static <T> List<T>
    grep(List<T> self, Object filter)
    Iterates over the collection of items and returns each item that matches the given filter - calling the isCase(java.lang.Object, java.lang.Object) method used by switch statements.
    static <T> Set<T>
    grep(Set<T> self)
    Iterates over the collection returning each element that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth.
    static <T> Set<T>
    grep(Set<T> self, Object filter)
    Iterates over the collection of items and returns each item that matches the given filter - calling the isCase(java.lang.Object, java.lang.Object) method used by switch statements.
    static <T> Collection<T>
    grep(T[] self)
    Deprecated.
    static <T> Collection<T>
    grep(T[] self, Object filter)
    Deprecated.
    protected static <K, T> void
    groupAnswer(Map<K,List<T>> answer, T element, K value)
    Groups the current element according to the value
    static <K, T> Map<K,List<T>>
    groupBy(Iterable<T> self, Closure<K> closure)
    Sorts all Iterable members into groups determined by the supplied mapping closure.
    static Map
    groupBy(Iterable self, Object... closures)
    Sorts all Iterable members into (sub)groups determined by the supplied mapping closures.
    static Map
    groupBy(Iterable self, List<Closure> closures)
    Sorts all Iterable members into (sub)groups determined by the supplied mapping closures.
    static Map
    groupBy(Object[] self, Object... closures)
    Deprecated.
    static Map
    groupBy(Object[] self, List<Closure> closures)
    Deprecated.
    static <G, K, V> Map<G,Map<K,V>>
    groupBy(Map<K,V> self, Closure<G> closure)
    Groups the members of a map into sub maps determined by the supplied mapping closure.
    static Map<Object,Map>
    groupBy(Map self, Object... closures)
    Groups the members of a map into sub maps determined by the supplied mapping closures.
    static Map<Object,Map>
    groupBy(Map self, List<Closure> closures)
    Groups the members of a map into sub maps determined by the supplied mapping closures.
    static <K, T> Map<K,List<T>>
    groupBy(T[] self, Closure<K> closure)
    Deprecated.
    static <G, K, V> Map<G,List<Map.Entry<K,V>>>
    groupEntriesBy(Map<K,V> self, Closure<G> closure)
    Groups all map entries into groups determined by the supplied mapping closure.
    hasProperty(Object self, String name)
    Returns true of the implementing MetaClass has a property of the given name
    static <T> T
    head(Iterable<T> self)
    Returns the first item from the Iterable.
    static <T> T
    head(List<T> self)
    Returns the first item from the List.
    static <T> T
    head(T[] self)
    Deprecated.
    static <T, U> T
    identity(U self, Closure<T> closure)
    Allows the closure to be called for the object reference self.
    static Boolean
    implies(Boolean left, Boolean right)
    Logical implication of two boolean operands.
    indexed(double[] self)
    Deprecated.
    indexed(double[] self, int offset)
    Deprecated.
    indexed(int[] self)
    Deprecated.
    indexed(int[] self, int offset)
    Deprecated.
    static Map<Integer,Long>
    indexed(long[] self)
    Deprecated.
    static Map<Integer,Long>
    indexed(long[] self, int offset)
    Deprecated.
    static <E> Map<Integer,E>
    indexed(Iterable<E> self)
    Zips an Iterable with indices in (index, value) order.
    static <E> Map<Integer,E>
    indexed(Iterable<E> self, int offset)
    Zips an Iterable with indices in (index, value) order.
    static <E> Iterator<Tuple2<Integer,E>>
    indexed(Iterator<E> self)
    Zips an iterator with indices in (index, value) order.
    static <E> Iterator<Tuple2<Integer,E>>
    indexed(Iterator<E> self, int offset)
    Zips an iterator with indices in (index, value) order.
    static <T> Collection<T>
    init(Iterable<T> self)
    Returns the items from the Iterable excluding the last item.
    static <T> Iterator<T>
    init(Iterator<T> self)
    Returns an Iterator containing all the items from this iterator except the last one.
    static <T> List<T>
    init(List<T> self)
    Returns the items from the List excluding the last item.
    static <T> SortedSet<T>
    init(SortedSet<T> self)
    Returns the items from the SortedSet excluding the last item.
    static <T> T[]
    init(T[] self)
    Deprecated.
    static <T> List<List<T>>
    inits(Iterable<T> self)
    Calculates the init values of this Iterable: the first value will be this list of all items from the iterable and the final one will be an empty list, with the intervening values the results of successive applications of init on the items.
    static <E extends T, T, V extends T>
    T
    inject(E[] self, Closure<V> closure)
    Deprecated.
    static <E, T, U extends T, V extends T>
    T
    inject(E[] self, U initialValue, Closure<V> closure)
    Deprecated.
    static <E extends T, T, V extends T>
    T
    inject(Iterable<E> self, Closure<V> closure)
    Iterates through the given object, passing the first two elements to the closure.
    static <E, T, U extends T, V extends T>
    T
    inject(Iterable<E> self, U initialValue, Closure<V> closure)
    Iterates through the given object, passing in the initial value to the 2-arg closure along with the first item.
    static <T, V extends T>
    T
    inject(Object self, Closure<V> closure)
    Iterates through the given object, passing the first two elements to the closure.
    static <T, U extends T, V extends T>
    T
    inject(Object self, U initialValue, Closure<V> closure)
    Iterates through the given object, passing in the initial value to the closure along with the first item.
    static <E extends T, T, V extends T>
    T
    inject(Collection<E> self, Closure<V> closure)
    Deprecated.
    static <E, T, U extends T, V extends T>
    T
    inject(Collection<E> self, U initialValue, Closure<V> closure)
    Deprecated.
    static <E, T, U extends T, V extends T>
    T
    inject(Iterator<E> self, U initialValue, Closure<V> closure)
    Iterates through the given iterator, passing in the initial value to the closure along with the first item.
    static <K, V, T, U extends T, W extends T>
    T
    inject(Map<K,V> self, U initialValue, Closure<W> closure)
    Iterates through the given map, passing in the initial value to the 2-arg Closure along with the first item (or 3-arg Closure along with the first key and value).
    static String
    Inspects returns the String that matches what would be typed into a terminal to create this object.
    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 <T> Collection<T>
    intersect(Iterable<T> left, Iterable<T> right)
    Create a Collection composed of the intersection of both iterables.
    static <T> Collection<T>
    intersect(Iterable<T> left, Iterable<T> right, Closure condition)
    Create a Collection composed of the intersection of both iterables.
    static <T> Collection<T>
    intersect(Iterable<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Create a Collection composed of the intersection of both iterables.
    static <T> Collection<T>
    intersect(Collection<T> left, Collection<T> right)
    Create a Collection composed of the intersection of both collections.
    static <T> Collection<T>
    intersect(Collection<T> left, Collection<T> right, Comparator<? super T> comparator)
    Create a Collection composed of the intersection of both collections.
    static <T> List<T>
    intersect(List<T> left, Iterable<T> right)
    Create a List composed of the intersection of a List and an Iterable.
    static <T> List<T>
    intersect(List<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Create a List composed of the intersection of a List and an Iterable.
    static <K, V> Map<K,V>
    intersect(Map<K,V> left, Map<K,V> right)
    Create a Map composed of the intersection of both maps.
    static <T> Set<T>
    intersect(Set<T> left, Iterable<T> right)
    Create a Set composed of the intersection of a Set and an Iterable.
    static <T> Set<T>
    intersect(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Create a Set composed of the intersection of a Set and an Iterable.
    static <T> SortedSet<T>
    intersect(SortedSet<T> left, Iterable<T> right)
    Create a SortedSet composed of the intersection of a SortedSet and an Iterable.
    static <T> SortedSet<T>
    intersect(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Create a SortedSet composed of the intersection of a SortedSet and an Iterable.
    static Object
    invokeMethod(Object object, String method, Object arguments)
    Provide a dynamic method invocation method which can be overloaded in classes to implement dynamic proxies easily.
    static boolean
    is(Object self, Object other)
    Identity check.
    static Boolean
    isAtLeast(BigDecimal left, String right)
    Compare a BigDecimal to a String representing a number.
    static Boolean
    Compare a BigDecimal to another.
    static boolean
    isCase(Class caseValue, Object switchValue)
    Special 'Case' implementation for Class, which allows testing whether some switch value is assignable from the given case class.
    static boolean
    isCase(Iterable caseValue, Object switchValue)
    'Case' implementation for iterable types which tests if the 'switch' operand is contained in any of the 'case' values.
    static boolean
    isCase(Number caseValue, Number switchValue)
    Special 'case' implementation for all numbers, which delegates to the compareTo() method for comparing numbers of different types.
    static boolean
    isCase(Object caseValue, Object switchValue)
    Method for overloading the behavior of the 'case' method in switch statements.
    static boolean
    isCase(Collection caseValue, Object switchValue)
    'Case' implementation for collections which tests if the 'switch' operand is contained in any of the 'case' values.
    static boolean
    isCase(Map caseValue, Object switchValue)
    'Case' implementation for maps which tests the groovy truth value obtained using the 'switch' operand as key.
    static boolean
    Determines if a character is a digit.
    static boolean
    Check whether an Iterable has elements
    static boolean
    Determines if a character is a letter.
    static boolean
    Determines if a character is a letter or digit.
    static boolean
    Determines if a Character is lowercase.
    static boolean
    isNotCase(Closure<?> caseValue, Object switchValue)
     
    static boolean
    isNotCase(Class<?> caseValue, Object switchValue)
     
    static boolean
    isNotCase(Number caseValue, Number switchValue)
     
    static boolean
    isNotCase(Object caseValue, Object switchValue)
     
    static boolean
    isNotCase(Collection<?> caseValue, Object switchValue)
     
    static boolean
    isNotCase(Map<?,?> caseValue, Object switchValue)
     
    static boolean
    Determines if a Character is uppercase.
    static boolean
    Determines if a character is a whitespace character.
    static Iterator
    Attempts to create an Iterator for the given object by first converting it to a Collection.
    static <T> Iterator<T>
    iterator(Enumeration<T> enumeration)
    Allows an Enumeration to behave like an Iterator.
    static <T> Iterator<T>
    iterator(Iterator<T> self)
    An identity function for iterators, supporting 'duck-typing' when trying to get an iterator for each object within a collection, some of which may already be iterators.
    static <T> Iterator<T>
    iterator(T[] self)
    Deprecated.
    static String
    join(boolean[] self, String separator)
    Deprecated.
    static String
    join(byte[] self, String separator)
    Deprecated.
    static String
    join(char[] self, String separator)
    Deprecated.
    static String
    join(double[] self, String separator)
    Deprecated.
    static String
    join(float[] self, String separator)
    Deprecated.
    static String
    join(int[] self, String separator)
    Deprecated.
    static String
    join(long[] self, String separator)
    Deprecated.
    static String
    join(short[] self, String separator)
    Deprecated.
    static String
    join(Iterable<?> self)
    Concatenates the toString() representation of each item from the Iterable.
    static String
    join(Iterable<?> self, String separator)
    Concatenates the toString() representation of each item from the Iterable, with the given String as a separator between each item.
    static String
    join(Iterator<?> self)
    Concatenates the toString() representation of each item from the Iterator.
    static String
    join(Iterator<?> self, String separator)
    Concatenates the toString() representation of each item from the Iterator, with the given String as a separator between each item.
    static <T> String
    join(T[] self, String separator)
    Deprecated.
    static <T> T
    last(Iterable<T> self)
    Returns the last item from the Iterable.
    static <T> T
    last(Deque<T> self)
    An optimized version of last(List).
    static <T> T
    last(List<T> self)
    Returns the last item from the List.
    static <T> T
    last(T[] self)
    Deprecated.
    static Number
    leftShift(Number self, Number operand)
    Implementation of the left shift operator for integral types.
    static BitSet
    leftShift(BitSet self, Number operand)
    Implementation of the left shift operator for BitSets, returning a new BitSet and leaving the original unchanged.
    static <T> Collection<T>
    leftShift(Collection<T> self, T value)
    Overloads the left shift operator to provide an easy way to append objects to a Collection.
    static <T> BlockingQueue<T>
    leftShift(BlockingQueue<T> self, T value)
    Overloads the left shift operator to provide an easy way to append objects to a BlockingQueue.
    static <T> List<T>
    leftShift(List<T> self, T value)
    Overloads the left shift operator to provide an easy way to append objects to a List.
    static <K, V> Map<K,V>
    leftShift(Map<K,V> self, Map.Entry<K,V> entry)
    Overloads the left shift operator to provide an easy way to append Map.Entry values to a Map.
    static <K, V> Map<K,V>
    leftShift(Map<K,V> self, Map<K,V> other)
    Overloads the left shift operator to provide an easy way to put one maps entries into another map.
    static <T> Set<T>
    leftShift(Set<T> self, T value)
    Overloads the left shift operator to provide an easy way to append objects to a Set.
    static <T> SortedSet<T>
    leftShift(SortedSet<T> self, T value)
    Overloads the left shift operator to provide an easy way to append objects to a SortedSet.
    static double
    max(double[] self)
    Deprecated.
    static int
    max(int[] self)
    Deprecated.
    static long
    max(long[] self)
    Deprecated.
    static <T> T
    max(Iterable<T> self)
    Adds max() method to Iterable objects.
    static <T> T
    max(Iterable<T> self, Closure closure)
    Selects the item in the iterable which when passed as a parameter to the supplied closure returns the maximum value.
    static <T> T
    max(Iterable<T> self, Comparator<? super T> comparator)
    Selects the maximum value found in the Iterable using the given comparator.
    static <T> T
    max(Iterator<T> self)
    Adds max() method to Iterator objects.
    static <T> T
    max(Iterator<T> self, Closure closure)
    Selects the maximum value found from the Iterator using the closure to determine the correct ordering.
    static <T> T
    max(Iterator<T> self, Comparator<? super T> comparator)
    Selects the maximum value found from the Iterator using the given comparator.
    static <K, V> Map.Entry<K,V>
    max(Map<K,V> self, Closure closure)
    Selects an entry in the map having the maximum calculated value as determined by the supplied closure.
    static <T> T
    max(T[] self)
    Deprecated.
    static <T> T
    max(T[] self, Closure closure)
    Deprecated.
    static <T> T
    max(T[] self, Comparator<? super T> comparator)
    Deprecated.
    static MetaClass
    metaClass(Class self, Closure closure)
    Sets/updates the metaclass for a given class to a closure.
    static MetaClass
    metaClass(Object self, Closure closure)
    Sets/updates the metaclass for a given object to a closure.
    static double
    min(double[] self)
    Deprecated.
    static int
    min(int[] self)
    Deprecated.
    static long
    min(long[] self)
    Deprecated.
    static <T> T
    min(Iterable<T> self)
    Adds min() method to Collection objects.
    static <T> T
    min(Iterable<T> self, Closure closure)
    Selects the item in the iterable which when passed as a parameter to the supplied closure returns the minimum value.
    static <T> T
    min(Iterable<T> self, Comparator<? super T> comparator)
    Selects the minimum value found in the Iterable using the given comparator.
    static <T> T
    min(Iterator<T> self)
    Adds min() method to Iterator objects.
    static <T> T
    min(Iterator<T> self, Closure closure)
    Selects the minimum value found from the Iterator using the closure to determine the correct ordering.
    static <T> T
    min(Iterator<T> self, Comparator<? super T> comparator)
    Selects the minimum value found from the Iterator using the given comparator.
    static <K, V> Map.Entry<K,V>
    min(Map<K,V> self, Closure closure)
    Selects an entry in the map having the minimum calculated value as determined by the supplied closure.
    static <T> T
    min(T[] self)
    Deprecated.
    static <T> T
    min(T[] self, Closure closure)
    Deprecated.
    static <T> T
    min(T[] self, Comparator<? super T> comparator)
    Deprecated.
    static Number
    minus(Character left, Character right)
    Subtract one Character from another.
    static Number
    minus(Character left, Number right)
    Subtract a Number from a Character.
    static <T> Collection<T>
    minus(Iterable<T> self, Iterable<?> removeMe)
    Create a new Collection composed of the elements of the first Iterable minus every occurrence of elements of the given Iterable.
    static <T> Collection<T>
    minus(Iterable<T> self, Iterable<?> removeMe, Closure condition)
    Create a new Collection composed of the elements of the first Iterable minus every matching occurrence as determined by the condition closure of elements of the given Iterable.
    static <T> Collection<T>
    minus(Iterable<T> self, Iterable<?> removeMe, Comparator<? super T> comparator)
    Create a new Collection composed of the elements of the first Iterable minus every matching occurrence as determined by the condition comparator of elements of the given Iterable.
    static <T> Collection<T>
    minus(Iterable<T> self, Object removeMe)
    Create a new Collection composed of the elements of the first Iterable minus every occurrence of the given element to remove.
    static Number
    minus(Number left, Character right)
    Subtract a Character from a Number.
    static <T> Collection<T>
    minus(Collection<T> self, Collection<?> removeMe)
    Create a new Collection composed of the elements of the first Collection minus every occurrence of elements of the given Collection.
    static <T> List<T>
    minus(List<T> self, Iterable<?> removeMe)
    Create a new List composed of the elements of the first List minus every occurrence of elements of the given Iterable.
    static <T> List<T>
    minus(List<T> self, Object removeMe)
    Create a new List composed of the elements of the first List minus every occurrence of the given element to remove.
    static <T> List<T>
    minus(List<T> self, Collection<?> removeMe)
    Create a List composed of the elements of the first list minus every occurrence of elements of the given Collection.
    static <K, V> Map<K,V>
    minus(Map<K,V> self, Map removeMe)
    Create a Map composed of the entries of the first map minus the entries of the given map.
    static <T> Set<T>
    minus(Set<T> self, Iterable<?> removeMe)
    Create a Set composed of the elements of the first Set minus the elements from the given Iterable.
    static <T> Set<T>
    minus(Set<T> self, Object removeMe)
    Create a Set composed of the elements of the first Set minus the given element.
    static <T> Set<T>
    minus(Set<T> self, Collection<?> removeMe)
    Create a Set composed of the elements of the first Set minus the elements of the given Collection.
    static <T> SortedSet<T>
    minus(SortedSet<T> self, Iterable<?> removeMe)
    Create a SortedSet composed of the elements of the first SortedSet minus the elements of the given Iterable.
    static <T> SortedSet<T>
    minus(SortedSet<T> self, Object removeMe)
    Create a SortedSet composed of the elements of the first SortedSet minus the given element.
    static <T> SortedSet<T>
    minus(SortedSet<T> self, Collection<?> removeMe)
    Create a SortedSet composed of the elements of the first SortedSet minus the elements of the given Collection.
    static <T> T[]
    minus(T[] self, Iterable removeMe)
    Deprecated.
    static <T> T[]
    minus(T[] self, Object removeMe)
    Deprecated.
    static <T> T[]
    minus(T[] self, Object[] removeMe)
    Deprecated.
    static void
    mixin(MetaClass self, Class categoryClass)
    Extend class globally with category methods.
    static void
    mixin(MetaClass self, Class[] categoryClass)
    Extend class globally with category methods.
    static void
    mixin(MetaClass self, List<Class> categoryClasses)
    Extend object with category methods.
    static void
    mixin(Class self, Class categoryClass)
    Extend class globally with category methods.
    static void
    mixin(Class self, Class[] categoryClass)
    Extend class globally with category methods.
    static void
    mixin(Class self, List<Class> categoryClasses)
    Extend class globally with category methods.
    static Number
    mod(Number left, Number right)
    Performs a division modulus operation.
    static Number
    Multiply two Characters.
    static Number
    multiply(Character left, Number right)
    Multiply a Character by a Number.
    static <T> Collection<T>
    multiply(Iterable<T> self, Number factor)
    Create a Collection composed of the elements of this Iterable, repeated a certain number of times.
    static Number
    multiply(Number left, Character right)
    Multiply a Number by a Character.
    static Number
    multiply(BigDecimal left, Double right)
    Multiply a BigDecimal and a Double.
    static Number
    Multiply a BigDecimal and a BigInteger.
    static <T> List<T>
    multiply(List<T> self, Number factor)
    Create a List composed of the elements of this Iterable, repeated a certain number of times.
    static <T> T
    Convenience method to dynamically create a new instance of this class.
    static <T> T
    newInstance(Class<T> c, Object[] args)
    Helper to construct a new instance from the given arguments.
    static Character
    Increment a Character by one.
    static Number
    next(Number self)
    Increment a Number by one.
    static int
    Provides a method that compares two comparables using Groovy's default number aware comparator.
    static Boolean
    or(Boolean left, Boolean right)
    Logical disjunction of two boolean operators
    static Number
    or(Number left, Number right)
    Bitwise OR together two numbers.
    static BitSet
    or(BitSet left, BitSet right)
    Bitwise OR together two BitSets.
    static <T> Set<T>
    or(Set<T> left, Iterable<T> right)
    Create a Set as a union of a Set and an Iterable.
    static <T> SortedSet<T>
    or(SortedSet<T> left, Iterable<T> right)
    Create a SortedSet as a union of a SortedSet and an Iterable.
    static <T> Set<List<T>>
    Finds all permutations of an iterable.
    static <T, V> List<V>
    permutations(Iterable<T> self, Closure<V> function)
    Finds all permutations of an iterable, applies a function to each permutation and collects the result into a list.
    static Number
    plus(Character left, Character right)
    Add one Character to another.
    static Number
    plus(Character left, Number right)
    Add a Character and a Number.
    static <T> Collection<T>
    plus(Iterable<T> left, Iterable<T> right)
    Create a Collection as a union of two iterables.
    static <T> Collection<T>
    plus(Iterable<T> left, T right)
    Create a collection as a union of an Iterable and an Object.
    static Number
    plus(Number left, Character right)
    Add a Number and a Character.
    static <T> Collection<T>
    plus(Collection<T> left, Iterable<T> right)
    Create a Collection as a union of a Collection and an Iterable.
    static <T> Collection<T>
    plus(Collection<T> left, Collection<T> right)
    Create a Collection as a union of two collections.
    static <T> Collection<T>
    plus(Collection<T> left, T right)
    Create a collection as a union of a Collection and an Object.
    static <T> List<T>
    plus(List<T> self, int index, Iterable<T> additions)
    Creates a new List by inserting all the elements in the given Iterable to the elements from this List at the specified index.
    static <T> List<T>
    plus(List<T> self, int index, List<T> additions)
    Creates a new List by inserting all the elements in the given additions List to the elements from the original List at the specified index.
    static <T> List<T>
    plus(List<T> self, int index, T[] items)
    Creates a new List by inserting all the elements in the specified array to the elements from the original List at the specified index.
    static <T> List<T>
    plus(List<T> left, Iterable<T> right)
    Create a List as a union of a List and an Iterable.
    static <T> List<T>
    plus(List<T> left, Collection<T> right)
    Create a List as a union of a List and a Collection.
    static <T> List<T>
    plus(List<T> left, T right)
    Create a List as a union of a List and an Object.
    static <K, V> Map<K,V>
    plus(Map<K,V> self, Collection<? extends Map.Entry<? extends K,? extends V>> entries)
    Returns a new Map containing all entries from self and entries, giving precedence to entries.
    static <K, V> Map<K,V>
    plus(Map<K,V> left, Map<K,V> right)
    Returns a new Map containing all entries from left and right, giving precedence to right.
    static String
    plus(Map left, GString right)
    Appends a GString to the literal of the Map instance.
    static String
    plus(Map left, String right)
    Appends a String to the literal of the Map instance.
    static <T> Set<T>
    plus(Set<T> left, Iterable<T> right)
    Create a Set as a union of a Set and an Iterable.
    static <T> Set<T>
    plus(Set<T> left, Collection<T> right)
    Create a Set as a union of a Set and a Collection.
    static <T> Set<T>
    plus(Set<T> left, T right)
    Create a Set as a union of a Set and an Object.
    static <T> SortedSet<T>
    plus(SortedSet<T> left, Iterable<T> right)
    Create a SortedSet as a union of a SortedSet and an Iterable.
    static <T> SortedSet<T>
    plus(SortedSet<T> left, Collection<T> right)
    Create a SortedSet as a union of a SortedSet and a Collection.
    static <T> SortedSet<T>
    plus(SortedSet<T> left, T right)
    Create a SortedSet as a union of a SortedSet and an Object.
    static <T> T[]
    plus(T[] left, Iterable<?> right)
    Deprecated.
    static <T> T[]
    plus(T[] left, Object right)
    Deprecated.
    static <T> T[]
    plus(T[] left, Object[] right)
    Deprecated.
    static <T> T[]
    plus(T[] left, Collection<?> right)
    Deprecated.
    static <T> T
    pop(List<T> self)
    Removes the initial item from the List.
    static Number
    power(Integer self, Integer exponent)
    Power of an integer to an integer certain exponent.
    static Number
    power(Long self, Integer exponent)
    Power of a long to an integer certain exponent.
    static Number
    power(Number self, Number exponent)
    Power of a Number to a certain exponent.
    static Number
    power(BigDecimal self, Integer exponent)
    Power of a BigDecimal to an integer certain exponent.
    static Number
    power(BigInteger self, Integer exponent)
    Power of a BigInteger to an integer certain exponent.
    static BigInteger
    power(BigInteger self, BigInteger exponent)
    Power of a BigInteger to a BigInteger certain exponent.
    static Character
    Decrement a Character by one.
    static Number
    Decrement a Number by one.
    protected static Object
    primitiveArrayGet(Object self, int idx)
    Deprecated.
    protected static List
    Deprecated.
    protected static List
    Deprecated.
    protected static Object
    primitiveArrayPut(Object self, int idx, Object newValue)
    Deprecated.
    static void
    print(Closure self, Object value)
    Print a value to the standard output stream.
    static void
    print(PrintStream self, Object value)
    Print a value formatted Groovy style to the print stream.
    static void
    print(PrintWriter self, Object value)
    Print a value formatted Groovy style to the print writer.
    static void
    print(Object self, PrintWriter out)
    Print to a console in interactive format.
    static void
    print(Object self, Object value)
    Print a value formatted Groovy style to self if it is a Writer, otherwise to the standard output stream.
    static void
    printf(Closure self, String format, Object value)
    Printf a value to the standard output stream using a format string.
    static void
    printf(Closure self, String format, Object[] values)
    Printf 0 or more values to the standard output stream using a format string.
    static void
    printf(Object self, String format, Object arg)
    Prints a formatted string using the specified format string and arguments.
    static void
    printf(Object self, String format, Object[] values)
    Printf to the standard output stream.
    static void
    Print a linebreak to the standard output stream.
    static void
    println(Closure self, Object value)
    Print a value (followed by a newline) to the standard output stream.
    static void
    println(PrintStream self, Object value)
    Print a value formatted Groovy style (followed by a newline) to the print stream.
    static void
    println(PrintWriter self, Object value)
    Print a value formatted Groovy style (followed by a newline) to the print writer.
    static void
    Print a linebreak to the standard output stream.
    static void
    Print to a console in interactive format.
    static void
    println(Object self, Object value)
    Print a value formatted Groovy style (followed by a newline) to self if it is a Writer, otherwise to the standard output stream.
    static <T> boolean
    push(List<T> self, T value)
    Prepends an item to the start of the List.
    static <K, V> Map<K,V>
    putAll(Map<K,V> self, Collection<? extends Map.Entry<? extends K,? extends V>> entries)
    Provides an easy way to append multiple Map.Entry values to a Map.
    static void
    putAt(Object self, String property, Object newValue)
    Allows the subscript operator to be used to set dynamically named property values.
    static void
    putAt(BitSet self, int index, boolean value)
    Support subscript-style assignment for a BitSet.
    static void
    putAt(BitSet self, IntRange range, boolean value)
    Support assigning a range of values with a single assignment statement.
    static <T> void
    putAt(List<T> self, int idx, T value)
    A helper method to allow lists to work with subscript operators.
    static <T> void
    putAt(List<T> self, Number idx, T value)
    Support subscript operator for list modification.
    static void
    putAt(List self, EmptyRange range, Object value)
    A helper method to allow lists to work with subscript operators.
    static void
    putAt(List self, EmptyRange range, Collection value)
    A helper method to allow lists to work with subscript operators.
    static void
    putAt(List self, IntRange range, Object value)
    List subscript assignment operator when given a range as the index.
    static void
    putAt(List self, IntRange range, Collection col)
    List subscript assignment operator when given a range as the index and the assignment operand is a collection.
    static void
    putAt(List self, List splice, Object value)
    A helper method to allow lists to work with subscript operators.
    static void
    putAt(List self, List splice, Collection values)
    A helper method to allow lists to work with subscript operators.
    static void
    putAt(List self, List splice, List values)
    Deprecated.
    static <K, V> V
    putAt(Map<K,V> self, K key, V value)
    A helper method to allow maps to work with subscript operators
    static Number
    remainder(Number left, Number right)
    Performs a division modulus operation.
    static <T> boolean
    removeAll(Collection<T> self, Closure condition)
    Modifies this collection by removing the elements that are matched according to the specified closure condition.
    static boolean
    removeAll(Collection self, Object[] items)
    Modifies this collection by removing its elements that are contained within the specified object array.
    static <K, V> boolean
    removeAll(Map<K,V> self, Closure condition)
    Modifies this map by removing the elements that are matched according to the specified closure condition.
    static <E> E
    removeAt(List<E> self, int index)
    Modifies this list by removing the element at the specified position in this list.
    static <E> boolean
    Modifies this collection by removing a single instance of the specified element from this collection, if it is present.
    static <T> T
    removeLast(List<T> self)
    Removes the last item from the List.
    respondsTo(Object self, String name)
    Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name regardless of the arguments.
    respondsTo(Object self, String name, Object[] argTypes)
    Returns an object satisfying Groovy truth if the implementing MetaClass responds to a method with the given name and arguments types.
    static <T> boolean
    retainAll(Collection<T> self, Closure condition)
    Modifies this collection so that it retains only its elements that are matched according to the specified closure condition.
    static boolean
    retainAll(Collection self, Object[] items)
    Modifies this collection so that it retains only its elements that are contained in the specified array.
    static <K, V> boolean
    retainAll(Map<K,V> self, Closure condition)
    Modifies this map so that it retains only its elements that are matched according to the specified closure condition.
    static <T> Iterator<T>
    reverse(Iterator<T> self)
    Reverses the iterator.
    static <T> List<T>
    reverse(List<T> self)
    Creates a new List with the identical contents to this list but in reverse order.
    static <T> List<T>
    reverse(List<T> self, boolean mutate)
    Reverses the elements in a list.
    static <T> T[]
    reverse(T[] self)
    Deprecated.
    static <T> T[]
    reverse(T[] self, boolean mutate)
    Deprecated.
    static <T> List<T>
    reverseEach(List<T> self, Closure closure)
    Iterate over each element of the list in the reverse order.
    static <K, V> Map<K,V>
    reverseEach(Map<K,V> self, Closure<?> closure)
    Allows a Map to be iterated through in reverse order using a closure.
    static <T> NavigableSet<T>
    reverseEach(NavigableSet<T> self, Closure closure)
    Iterate over each element of the set in reverse order.
    static <T> T[]
    reverseEach(T[] self, Closure closure)
    Deprecated.
    static Number
    rightShift(Number self, Number operand)
    Implementation of the right shift operator for integral types.
    static BitSet
    rightShift(BitSet self, Number operand)
    Implementation of the right shift operator for BitSets, returning a new BitSet and leaving the original unchanged.
    static Number
    Implementation of the right shift (unsigned) operator for integral types.
    static BitSet
    Implementation of the right shift (unsigned) operator for BitSets, returning a new BitSet and leaving the original unchanged.
    static long
    round(Double number)
    Round the value
    static double
    round(Double number, int precision)
    Round the value
    static int
    round(Float number)
    Round the value
    static float
    round(Float number, int precision)
    Round the value
    static BigDecimal
    round(BigDecimal number)
    Round the value
    static BigDecimal
    round(BigDecimal number, int precision)
    Round the value
    static TimerTask
    runAfter(Timer timer, int delay, Closure closure)
    Allows a simple syntax for using timers.
    static void
    Sets the metaclass for a GroovyObject.
    static void
    setMetaClass(Class self, MetaClass metaClass)
    Sets the metaclass for a given class.
    static void
    setMetaClass(Object self, MetaClass metaClass)
    Sets the metaclass for an object.
    static void
    shuffle(List<?> self)
    Randomly reorders the elements of the specified list.
    static void
    shuffle(List<?> self, Random rnd)
    Randomly reorders the elements of the specified list using the specified random instance as the source of randomness.
    static <T> void
    shuffle(T[] self)
    Deprecated.
    static <T> void
    shuffle(T[] self, Random rnd)
    Deprecated.
    static <T> List<T>
    shuffled(List<T> self)
    Creates a new list containing the elements of the specified list but in a random order.
    static <T> List<T>
    shuffled(List<T> self, Random rnd)
    Creates a new list containing the elements of the specified list but in a random order using the specified random instance as the source of randomness.
    static <T> T[]
    shuffled(T[] self)
    Deprecated.
    static <T> T[]
    shuffled(T[] self, Random rnd)
    Deprecated.
    static int
    size(boolean[] self)
    Deprecated.
    static int
    size(byte[] self)
    Deprecated.
    static int
    size(char[] self)
    Deprecated.
    static int
    size(double[] self)
    Deprecated.
    static int
    size(float[] self)
    Deprecated.
    static int
    size(int[] self)
    Deprecated.
    static int
    size(long[] self)
    Deprecated.
    static int
    size(short[] self)
    Deprecated.
    static int
    size(Iterable self)
    Provide the standard Groovy size() method for Iterable.
    static int
    size(Object[] self)
    Deprecated.
    static int
    size(Iterator self)
    Provide the standard Groovy size() method for Iterator.
    static <T> List<T>
    sort(Iterable<T> self)
    Sorts the Collection.
    static <T> List<T>
    sort(Iterable<T> self, boolean mutate)
    Sorts the Iterable.
    static <T> List<T>
    sort(Iterable<T> self, boolean mutate, Closure closure)
    Sorts this Iterable using the given Closure to determine the correct ordering.
    static <T> List<T>
    sort(Iterable<T> self, boolean mutate, Comparator<? super T> comparator)
    Sorts the Iterable using the given Comparator.
    static <T> List<T>
    sort(Iterable<T> self, Closure closure)
    Sorts this Iterable using the given Closure to determine the correct ordering.
    static <T> Iterator<T>
    sort(Iterator<T> self)
    Sorts the given iterator items into a sorted iterator.
    static <T> Iterator<T>
    sort(Iterator<T> self, Closure closure)
    Sorts the given iterator items into a sorted iterator using the Closure to determine the correct ordering.
    static <T> Iterator<T>
    sort(Iterator<T> self, Comparator<? super T> comparator)
    Sorts the given iterator items into a sorted iterator using the comparator.
    static <K, V> Map<K,V>
    sort(Map<K,V> self)
    Sorts the elements from the given map into a new ordered Map using the natural ordering of the keys to determine the ordering.
    static <K, V> Map<K,V>
    sort(Map<K,V> self, Closure closure)
    Sorts the elements from the given map into a new ordered map using the closure as a comparator to determine the ordering.
    static <K, V> Map<K,V>
    sort(Map<K,V> self, Comparator<? super K> comparator)
    Sorts the elements from the given map into a new ordered Map using the specified key comparator to determine the ordering.
    static <K, V> SortedMap<K,V>
    sort(SortedMap<K,V> self)
    Avoids doing unnecessary work when sorting an already sorted map (i.e.
    static <T> SortedSet<T>
    sort(SortedSet<T> self)
    Avoids doing unnecessary work when sorting an already sorted set (i.e.
    static <T> T[]
    sort(T[] self)
    Deprecated.
    static <T> T[]
    sort(T[] self, boolean mutate)
    Deprecated.
    static <T> T[]
    sort(T[] self, boolean mutate, Closure closure)
    Deprecated.
    static <T> T[]
    sort(T[] self, boolean mutate, Comparator<? super T> comparator)
    Deprecated.
    static <T> T[]
    sort(T[] self, Closure closure)
    Deprecated.
    static <T> T[]
    sort(T[] self, Comparator<? super T> comparator)
    Deprecated.
    static Collection
    split(Object self, Closure closure)
    Splits all items into two lists based on the closure condition.
    static <T> Collection<Collection<T>>
    split(Collection<T> self, Closure closure)
    Splits all items into two collections based on the closure condition.
    static <T> List<List<T>>
    split(List<T> self, Closure closure)
    Splits all items into two collections based on the closure condition.
    static <T> List<Set<T>>
    split(Set<T> self, Closure closure)
    Splits all items into two collections based on the closure condition.
    static <T> Collection<Collection<T>>
    split(T[] self, Closure closure)
    Deprecated.
    static SpreadMap
    spread(Map self)
    static String
    sprintf(Object self, String format, Object arg)
    Returns a formatted string using the specified format string and arguments.
    static String
    sprintf(Object self, String format, Object[] values)
    Sprintf to a string.
    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 <K, V> Map<K,V>
    subMap(Map<K,V> map, Collection<K> keys)
    Creates a sub-Map containing the given keys.
    static <K, V> Map<K,V>
    subMap(Map<K,V> map, K[] keys)
    Creates a sub-Map containing the given keys.
    static <T> Set<List<T>>
    subsequences(List<T> self)
    Finds all non-null subsequences of a list.
    static byte
    sum(byte[] self)
    Deprecated.
    static byte
    sum(byte[] self, byte initialValue)
    Deprecated.
    static char
    sum(char[] self)
    Deprecated.
    static char
    sum(char[] self, char initialValue)
    Deprecated.
    static double
    sum(double[] self)
    Deprecated.
    static double
    sum(double[] self, double initialValue)
    Deprecated.
    static float
    sum(float[] self)
    Deprecated.
    static float
    sum(float[] self, float initialValue)
    Deprecated.
    static int
    sum(int[] self)
    Deprecated.
    static int
    sum(int[] self, int initialValue)
    Deprecated.
    static long
    sum(long[] self)
    Deprecated.
    static long
    sum(long[] self, long initialValue)
    Deprecated.
    static short
    sum(short[] self)
    Deprecated.
    static short
    sum(short[] self, short initialValue)
    Deprecated.
    static Object
    sum(Iterable<?> self)
    Sums the items in an Iterable.
    static Object
    sum(Iterable<?> self, Object initialValue)
    Sums the items in an Iterable, adding the result to some initial value.
    static <T> Object
    sum(Iterable<T> self, Closure closure)
    Sums the result of applying a closure to each item of an Iterable.
    static <T> Object
    sum(Iterable<T> self, Object initialValue, Closure closure)
    Sums the result of applying a closure to each item of an Iterable to some initial value.
    static Object
    sum(Object[] self)
    Deprecated.
    static Object
    sum(Object[] self, Object initialValue)
    Deprecated.
    static Object
    sum(Iterator<?> self, Object initialValue)
    Sums the items from an Iterator, adding the result to some initial value.
    static Object
    Sums the items from an Iterator.
    static <T> Object
    sum(Iterator<T> self, Closure closure)
    Sums the result of applying a closure to each item returned from an iterator.
    static <T> Object
    sum(Iterator<T> self, Object initialValue, Closure closure)
    Sums the result of applying a closure to each item of an Iterator to some initial value.
    static <T> Object
    sum(T[] self, Closure closure)
    Deprecated.
    static <T> Object
    sum(T[] self, Object initialValue, Closure closure)
    Deprecated.
    static boolean[]
    swap(boolean[] self, int i, int j)
    Deprecated.
    static byte[]
    swap(byte[] self, int i, int j)
    Deprecated.
    static char[]
    swap(char[] self, int i, int j)
    Deprecated.
    static double[]
    swap(double[] self, int i, int j)
    Deprecated.
    static float[]
    swap(float[] self, int i, int j)
    Deprecated.
    static int[]
    swap(int[] self, int i, int j)
    Deprecated.
    static long[]
    swap(long[] self, int i, int j)
    Deprecated.
    static short[]
    swap(short[] self, int i, int j)
    Deprecated.
    static <T> List<T>
    swap(List<T> self, int i, int j)
    Swaps two elements at the specified positions.
    static <T> T[]
    swap(T[] self, int i, int j)
    Deprecated.
    static <T> Collection<T>
    tail(Iterable<T> self)
    Returns the items from the Iterable excluding the first item.
    static <T> Iterator<T>
    tail(Iterator<T> self)
    Returns the original iterator after throwing away the first element.
    static <T> List<T>
    tail(List<T> self)
    Returns the items from the List excluding the first item.
    static <T> SortedSet<T>
    tail(SortedSet<T> self)
    Returns the items from the SortedSet excluding the first item.
    static <T> T[]
    tail(T[] self)
    Deprecated.
    static <T> List<List<T>>
    tails(Iterable<T> self)
    Calculates the tail values of this Iterable: the first value will be this list of all items from the iterable and the final one will be an empty list, with the intervening values the results of successive applications of tail on the items.
    static <T> Collection<T>
    take(Iterable<T> self, int num)
    Returns the first num elements from the head of this Iterable.
    static <T> Iterator<T>
    take(Iterator<T> self, int num)
    Returns an iterator of up to the first num elements from this iterator.
    static <T> List<T>
    take(List<T> self, int num)
    Returns the first num elements from the head of this List.
    static <K, V> Map<K,V>
    take(Map<K,V> self, int num)
    Returns a new map containing the first num elements from the head of this map.
    static <T> SortedSet<T>
    take(SortedSet<T> self, int num)
    Returns the first num elements from the head of this SortedSet.
    static <T> T[]
    take(T[] self, int num)
    Deprecated.
    static <T> Collection<T>
    takeRight(Iterable<T> self, int num)
    Returns the last num elements from the tail of this Iterable.
    static <T> List<T>
    takeRight(List<T> self, int num)
    Returns the last num elements from the tail of this List.
    static <T> SortedSet<T>
    takeRight(SortedSet<T> self, int num)
    Returns the last num elements from the tail of this SortedSet.
    static <T> T[]
    takeRight(T[] self, int num)
    Deprecated.
    static <T> Collection<T>
    takeWhile(Iterable<T> self, Closure condition)
    Returns a Collection containing the longest prefix of the elements from this Iterable where each element passed to the given closure evaluates to true.
    static <T> Iterator<T>
    takeWhile(Iterator<T> self, Closure condition)
    Returns the longest prefix of elements in this iterator where each element passed to the given condition closure evaluates to true.
    static <T> List<T>
    takeWhile(List<T> self, Closure condition)
    Returns the longest prefix of this list where each element passed to the given closure condition evaluates to true.
    static <K, V> Map<K,V>
    takeWhile(Map<K,V> self, Closure condition)
    Returns the longest prefix of this Map where each entry (or key/value pair) when passed to the given closure evaluates to true.
    static <T> SortedSet<T>
    takeWhile(SortedSet<T> self, Closure condition)
    Returns the longest prefix of this SortedSet where each element passed to the given closure condition evaluates to true.
    static <T> T[]
    takeWhile(T[] self, Closure condition)
    Deprecated.
    static <T, U> U
    tap(U self, Closure<T> closure)
    Allows the closure to be called for the object reference self (similar to with) and always returns self.
    static void
    times(Number self, Closure closure)
    Executes the closure this many times, starting from zero.
    static String
    Deprecated.
    static BigDecimal
    Transforms a Number into a BigDecimal.
    static BigInteger
    Transforms this Number into a BigInteger.
    static Boolean
    Identity conversion which returns Boolean.TRUE for a true Boolean and Boolean.FALSE for a false Boolean.
    static Double
    Transforms a Number into a Double.
    static Float
    Transforms a Number into a Float.
    static Integer
    Transforms a Number into an Integer.
    static List<Boolean>
    toList(boolean[] self)
    Deprecated.
    static List<Byte>
    toList(byte[] self)
    Deprecated.
    static List<Character>
    toList(char[] self)
    Deprecated.
    static List<Double>
    toList(double[] self)
    Deprecated.
    static List<Float>
    toList(float[] self)
    Deprecated.
    static List<Integer>
    toList(int[] self)
    Deprecated.
    static List<Long>
    toList(long[] self)
    Deprecated.
    static List<Short>
    toList(short[] self)
    Deprecated.
    static <T> List<T>
    toList(Iterable<T> self)
    Convert an Iterable to a List.
    static <T> List<T>
    Convert an enumeration to a List.
    static <T> List<T>
    toList(Iterator<T> self)
    Convert an iterator to a List.
    static <T> List<T>
    toList(T[] self)
    Deprecated.
    static String
    Returns the string representation of the given list.
    static String
    toListString(Collection self, int maxSize)
    Returns the string representation of the given list.
    static Long
    toLong(Number self)
    Transforms a Number into a Long.
    static char
    Converts the character to lowercase.
    static String
    Returns the string representation of this map.
    static String
    toMapString(Map self, int maxSize)
    Returns the string representation of this map.
    static Set<Boolean>
    toSet(boolean[] self)
    Deprecated.
    static Set<Byte>
    toSet(byte[] self)
    Deprecated.
    static Set<Character>
    toSet(char[] self)
    Deprecated.
    static Set<Double>
    toSet(double[] self)
    Deprecated.
    static Set<Float>
    toSet(float[] self)
    Deprecated.
    static Set<Integer>
    toSet(int[] self)
    Deprecated.
    static Set<Long>
    toSet(long[] self)
    Deprecated.
    static Set<Short>
    toSet(short[] self)
    Deprecated.
    static <T> Set<T>
    toSet(Iterable<T> self)
    Convert an Iterable to a Set.
    static <T> Set<T>
    toSet(Collection<T> self)
    Convert a Collection to a Set.
    static <T> Set<T>
    toSet(Enumeration<T> self)
    Convert an enumeration to a Set.
    static <T> Set<T>
    toSet(Iterator<T> self)
    Convert an iterator to a Set.
    static <T> List<T>
    toSorted(Iterable<T> self)
    Sorts the Iterable.
    static <T> List<T>
    toSorted(Iterable<T> self, Closure closure)
    Sorts this Iterable using the given Closure to determine the correct ordering.
    static <T> List<T>
    toSorted(Iterable<T> self, Comparator<? super T> comparator)
    Sorts the Iterable using the given Comparator.
    static <T> Iterator<T>
    toSorted(Iterator<T> self)
    Sorts the Iterator.
    static <T> Iterator<T>
    toSorted(Iterator<T> self, Closure closure)
    Sorts the given iterator items into a sorted iterator using the Closure to determine the correct ordering.
    static <T> Iterator<T>
    toSorted(Iterator<T> self, Comparator<? super T> comparator)
    Sorts the given iterator items using the comparator.
    static <K, V> Map<K,V>
    toSorted(Map<K,V> self)
    Sorts the elements from the given map into a new ordered map using a NumberAwareComparator on map entry values to determine the resulting order.
    static <K, V> Map<K,V>
    toSorted(Map<K,V> self, Closure condition)
    Sorts the elements from the given map into a new ordered map using the supplied Closure condition as a comparator to determine the ordering.
    static <K, V> Map<K,V>
    toSorted(Map<K,V> self, Comparator<Map.Entry<K,V>> comparator)
    Sorts the elements from the given map into a new ordered map using the supplied comparator to determine the ordering.
    static <K, V> Map<K,V>
    toSorted(SortedMap<K,V> self)
    Avoids doing unnecessary work when sorting an already sorted map
    static <T> Set<T>
    Avoids doing unnecessary work when sorting an already sorted set
    static <T> T[]
    toSorted(T[] self)
    Deprecated.
    static <T> T[]
    toSorted(T[] self, Closure closure)
    Deprecated.
    static <T> T[]
    toSorted(T[] self, Comparator<? super T> comparator)
    Deprecated.
    static SpreadMap
    Creates a spreadable map from this iterable.
    static SpreadMap
    Deprecated.
    static SpreadMap
    Creates a spreadable map from this list.
    static SpreadMap
    Returns a new SpreadMap from this map.
    static String
    toString(boolean[] self)
    Deprecated.
    static String
    toString(byte[] self)
    Deprecated.
    static String
    toString(char[] self)
    Deprecated.
    static String
    toString(double[] self)
    Deprecated.
    static String
    toString(float[] self)
    Deprecated.
    static String
    toString(int[] self)
    Deprecated.
    static String
    toString(long[] self)
    Deprecated.
    static String
    toString(short[] self)
    Deprecated.
    static String
    Create a String representation of this object.
    static String
    toString(Object[] self)
    Deprecated.
    static String
    Returns the string representation of the given collection.
    static String
    Returns the string representation of the given map.
    static <T> Collection<T>
    toUnique(Iterable<T> self)
    Returns a Collection containing the items from the Iterable but with duplicates removed using the natural ordering of the items to determine uniqueness.
    static <T> Collection<T>
    toUnique(Iterable<T> self, Closure condition)
    Returns a Collection containing the items from the Iterable but with duplicates removed.
    static <T> Collection<T>
    toUnique(Iterable<T> self, Comparator<? super T> comparator)
    Returns a Collection containing the items from the Iterable but with duplicates removed.
    static <T> Iterator<T>
    toUnique(Iterator<T> self)
    Returns an iterator equivalent to this iterator with all duplicated items removed by using the natural ordering of the items.
    static <T> Iterator<T>
    toUnique(Iterator<T> self, Closure condition)
    Returns an iterator equivalent to this iterator but with all duplicated items removed where duplicate (equal) items are deduced by calling the supplied Closure condition.
    static <T> Iterator<T>
    toUnique(Iterator<T> self, Comparator<? super T> comparator)
    Returns an iterator equivalent to this iterator with all duplicated items removed by using the supplied comparator.
    static <T> List<T>
    toUnique(List<T> self)
    Returns a List containing the items from the List but with duplicates removed using the natural ordering of the items to determine uniqueness.
    static <T> List<T>
    toUnique(List<T> self, Closure condition)
    Returns a List containing the items from the List but with duplicates removed.
    static <T> List<T>
    toUnique(List<T> self, Comparator<? super T> comparator)
    Returns a List containing the items from the List but with duplicates removed.
    static <T> T[]
    toUnique(T[] self)
    Deprecated.
    static <T> T[]
    toUnique(T[] self, Closure closure)
    Deprecated.
    static <T> T[]
    toUnique(T[] self, Comparator<? super T> comparator)
    Deprecated.
    static char
    Converts the character to uppercase.
    static double[][]
    transpose(double[][] self)
    Deprecated.
    static int[][]
    transpose(int[][] self)
    Deprecated.
    static long[][]
    transpose(long[][] self)
    Deprecated.
    static List
    Adds GroovyCollections#transpose(List) as a method on lists.
    static double
    trunc(Double number)
    Truncate the value
    static double
    trunc(Double number, int precision)
    Truncate the value
    static float
    trunc(Float number)
    Truncate the value
    static float
    trunc(Float number, int precision)
    Truncate the value
    static BigDecimal
    trunc(BigDecimal number)
    Truncate the value
    static BigDecimal
    trunc(BigDecimal number, int precision)
    Truncate the value
    static Number
    Negates the number.
    static Number
    Returns the number, effectively being a noop for numbers.
    static <T> Collection<T>
    union(Iterable<T> left, Iterable<T> right)
    Create a Collection composed of the union of both iterables.
    static <T> Collection<T>
    union(Iterable<T> left, Iterable<T> right, Closure condition)
    Create a Collection composed of the union of both iterables.
    static <T> Collection<T>
    union(Iterable<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Create a Collection composed of the union of both iterables.
    static Object[]
    union(Object[] left, Iterable<?> right)
    Deprecated.
    static Object[]
    union(Object[] left, Object right)
    Deprecated.
    static Object[]
    union(Object[] left, Object[] right)
    Deprecated.
    static Object[]
    union(Object[] left, Collection<?> right)
    Deprecated.
    static <T> Collection<T>
    union(Collection<T> left, Collection<T> right)
    Create a Collection composed of the union of both collections.
    static <T> Collection<T>
    union(Collection<T> left, Collection<T> right, Comparator<? super T> comparator)
    Create a Collection composed of the union of both collections.
    static <T> List<T>
    union(List<T> left, Iterable<T> right)
    Create a List composed of the union of a List and an Iterable.
    static <T> List<T>
    union(List<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Create a List composed of the union of a List and an Iterable.
    static <T> Set<T>
    union(Set<T> left, Iterable<T> right)
    Create a Set composed of the union of a Set and an Iterable.
    static <T> Set<T>
    union(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Create a Set composed of the union of a Set and an Iterable.
    static <T> SortedSet<T>
    union(SortedSet<T> left, Iterable<T> right)
    Create a SortedSet composed of the union of a SortedSet and an Iterable.
    static <T> SortedSet<T>
    union(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Create a SortedSet composed of the intersection of a SortedSet and an Iterable.
    static <T> Collection<T>
    unique(Collection<T> self)
    Modifies this collection to remove all duplicated items, using Groovy's default number-aware comparator.
    static <T> Collection<T>
    unique(Collection<T> self, boolean mutate)
    Remove all duplicates from a given Collection using Groovy's default number-aware comparator.
    static <T> Collection<T>
    unique(Collection<T> self, boolean mutate, Closure closure)
    A convenience method for making a collection unique using a Closure to determine duplicate (equal) items.
    static <T> Collection<T>
    unique(Collection<T> self, boolean mutate, Comparator<? super T> comparator)
    Remove all duplicates from a given Collection.
    static <T> Collection<T>
    unique(Collection<T> self, Closure closure)
    A convenience method for making a collection unique using a Closure to determine duplicate (equal) items.
    static <T> Collection<T>
    unique(Collection<T> self, Comparator<? super T> comparator)
    Remove all duplicates from a given Collection.
    static <T> Iterator<T>
    unique(Iterator<T> self)
    Returns an iterator equivalent to this iterator with all duplicated items removed by using Groovy's default number-aware comparator.
    static <T> Iterator<T>
    unique(Iterator<T> self, Closure condition)
    Returns an iterator equivalent to this iterator but with all duplicated items removed by using a Closure to determine duplicate (equal) items.
    static <T> Iterator<T>
    unique(Iterator<T> self, Comparator<? super T> comparator)
    Returns an iterator equivalent to this iterator with all duplicated items removed by using the supplied comparator.
    static <T> List<T>
    unique(List<T> self)
    Modifies this List to remove all duplicated items, using Groovy's default number-aware comparator.
    static <T> List<T>
    unique(List<T> self, boolean mutate)
    Remove all duplicates from a given List using Groovy's default number-aware comparator.
    static <T> List<T>
    unique(List<T> self, boolean mutate, Closure closure)
    A convenience method for making a List unique using a Closure to determine duplicate (equal) items.
    static <T> List<T>
    unique(List<T> self, boolean mutate, Comparator<? super T> comparator)
    Remove all duplicates from a given List.
    static <T> List<T>
    unique(List<T> self, Closure closure)
    A convenience method for making a List unique using a Closure to determine duplicate (equal) items.
    static <T> List<T>
    unique(List<T> self, Comparator<? super T> comparator)
    Remove all duplicates from a given List.
    static void
    upto(double self, Number to, Closure closure)
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
    static void
    upto(float self, Number to, Closure closure)
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
    static void
    upto(long self, Number to, Closure closure)
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
    static void
    upto(Double self, Number to, Closure closure)
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
    static void
    upto(Float self, Number to, Closure closure)
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
    static void
    upto(Long self, Number to, Closure closure)
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
    static void
    upto(Number self, Number to, Closure closure)
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
    static void
    upto(BigDecimal self, Number to, Closure closure)
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
    static void
    upto(BigInteger self, Number to, Closure closure)
    Iterates from this number up to the given number, inclusive, incrementing by one each time.
    static <T> T
    use(Object self, Class categoryClass, Closure<T> closure)
    Scoped use method
    static Object
    use(Object self, Object[] array)
    Allows you to use a list of categories, specifying the list as varargs.
    static <T> T
    use(Object self, List<Class> categoryClassList, Closure<T> closure)
    Scoped use method with list of categories.
    static <T, U extends T, V extends T>
    T
    with(U self, boolean returnIt, Closure<V> closure)
    Allows the closure to be called for the object reference self.
    static <T, U> T
    with(U self, Closure<T> closure)
    Allows the closure to be called for the object reference self.
    static <K, V> Map<K,V>
    withCollectedKeys(Iterable<V> values, Function<? super V,K> keyTransform)
    Transform Iterable elements into Map entries with values unchanged and keys transformed using the supplied function.
    static <K, V> Map<K,V>
    withCollectedKeys(Iterable<V> values, Map<K,V> collector, Function<? super V,K> keyTransform)
    Transform Iterable elements into Map entries with values unchanged and keys transformed using the supplied function.
    static <K, V> Map<K,V>
    withCollectedKeys(Iterator<V> values, Function<? super V,K> keyTransform)
    A variant of withCollectedKeys for Iterators.
    static <K, V> Map<K,V>
    withCollectedKeys(Iterator<V> values, Map<K,V> collector, Function<? super V,K> keyTransform)
    A variant of withCollectedKeys for Iterators.
    static <K, V> Map<K,V>
    withCollectedValues(Iterable<K> keys, Function<? super K,V> valueTransform)
    Transform Iterable elements into Map entries with keys unchanged and values transformed using the supplied function.
    static <K, V> Map<K,V>
    withCollectedValues(Iterable<K> keys, Map<K,V> collector, Function<? super K,V> valueTransform)
    Transform Iterable elements into Map entries with keys unchanged and values transformed using the supplied function.
    static <K, V> Map<K,V>
    withCollectedValues(Iterator<K> keys, Function<? super K,V> valueTransform)
    A variant of withCollectedValues for Iterators.
    static <K, V> Map<K,V>
    withCollectedValues(Iterator<K> keys, Map<K,V> collector, Function<? super K,V> valueTransform)
    A variant of withCollectedValues for Iterators.
    static <T> ListWithDefault<T>
    withDefault(List<T> self, Closure<T> init)
    An alias for withLazyDefault which decorates a list allowing it to grow when called with index values outside the normal list bounds.
    static <K, V> Map<K,V>
    withDefault(Map<K,V> self, boolean autoGrow, boolean autoShrink, Closure<V> init)
    Wraps a map using the decorator pattern with a wrapper that intercepts all calls to get(key) and put(key, value).
    static <K, V> Map<K,V>
    withDefault(Map<K,V> self, Closure<V> init)
    Wraps a map using the decorator pattern with a wrapper that intercepts all calls to get(key).
    static <T> List<T>
    withDefault$$bridge(List<T> self, Closure<T> init)
    Deprecated.
    static <T> ListWithDefault<T>
    withEagerDefault(List<T> self, Closure<T> init)
    Decorates a list allowing it to grow when called with a non-existent index value.
    static <T> List<T>
    Deprecated.
    static <E> List<Tuple2<E,Integer>>
    Zips an Iterable with indices in (value, index) order.
    static <E> List<Tuple2<E,Integer>>
    withIndex(Iterable<E> self, int offset)
    Zips an Iterable with indices in (value, index) order.
    static <E> Iterator<Tuple2<E,Integer>>
    Zips an iterator with indices in (value, index) order.
    static <E> Iterator<Tuple2<E,Integer>>
    withIndex(Iterator<E> self, int offset)
    Zips an iterator with indices in (value, index) order.
    static <T> ListWithDefault<T>
    withLazyDefault(List<T> self, Closure<T> init)
    Decorates a list allowing it to grow when called with a non-existent index value.
    static <T> List<T>
    Deprecated.
    static Object
    withTraits(Object self, Class<?>... traits)
    Dynamically wraps an instance into something which implements the supplied trait classes.
    static Boolean
    xor(Boolean left, Boolean right)
    Exclusive disjunction of two boolean operators
    static Number
    xor(Number left, Number right)
    Bitwise XOR together two Numbers.
    static BitSet
    xor(BitSet left, BitSet right)
    Bitwise XOR together two BitSets.
    static <T> Set<T>
    xor(Set<T> left, Iterable<T> right)
    Create a Set composed of the symmetric difference of a Set and an Iterable.
    static <T> Set<T>
    xor(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Create a Set composed of the symmetric difference of a Set and an Iterable.
    static <T> SortedSet<T>
    xor(SortedSet<T> left, Iterable<T> right)
    Create a SortedSet composed of the symmetric difference of a SortedSet and an Iterable.
    static <T> SortedSet<T>
    xor(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)
    Create a SortedSet composed of the symmetric difference of a SortedSet and an Iterable.
    static <U, V> Iterator<Tuple2<U,V>>
    zip(Iterable<U> self, Iterable<V> other)
    An iterator of all the pairs of two Iterables.
    static <U, V> Iterator<Tuple2<U,V>>
    zip(Iterator<U> self, Iterator<V> other)
    An iterator of all the pairs of two Iterators.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ADDITIONAL_CLASSES

      public static final Class[] ADDITIONAL_CLASSES
    • DGM_LIKE_CLASSES

      public static final Class[] DGM_LIKE_CLASSES
  • Constructor Details

    • DefaultGroovyMethods

      public DefaultGroovyMethods()
  • Method Details

    • callClosureForLine

      protected static <T> T callClosureForLine(@ClosureParams(value=FromString.class,options={"String","String,Integer"}) Closure<T> closure, String line, int counter)
    • callClosureForMapEntry

      protected static <T, K, V> T callClosureForMapEntry(@ClosureParams(value=FromString.class,options={"K,V","Map.Entry<K,V>"}) Closure<T> closure, Map.Entry<K,V> entry)
    • callClosureForMapEntryAndCounter

      protected static <T, K, V> T callClosureForMapEntryAndCounter(@ClosureParams(value=FromString.class,options={"K,V,Integer","K,V","Map.Entry<K,V>"}) Closure<T> closure, Map.Entry<K,V> entry, int counter)
    • abs

      public static int abs(Number number)
      Gets the absolute value.

      Note: This method is NOT called if number is a BigInteger or BigDecimal, because those classes implement a method with a better exact match.

      Parameters:
      number - a Number
      Returns:
      the absolute value of that Number
      Since:
      1.0
    • abs

      public static long abs(Long number)
      Gets the absolute value.
      Parameters:
      number - a Long
      Returns:
      the absolute value of that Long
      Since:
      1.0
    • abs

      public static float abs(Float number)
      Gets the absolute value.
      Parameters:
      number - a Float
      Returns:
      the absolute value of that Float
      Since:
      1.0
    • abs

      public static double abs(Double number)
      Gets the absolute value.
      Parameters:
      number - a Double
      Returns:
      the absolute value of that Double
      Since:
      1.0
    • addAll

      public static <T> boolean addAll(Collection<T> self, Iterator<? extends T> items)
      Adds all items from the iterator to the Collection.
      Parameters:
      self - the collection
      items - the items to add
      Returns:
      true if the collection changed
    • addAll

      public static <T> boolean addAll(Collection<T> self, Iterable<? extends T> items)
      Adds all items from the iterable to the Collection.
      Parameters:
      self - the collection
      items - the items to add
      Returns:
      true if the collection changed
    • addAll

      public static <T> boolean addAll(Collection<T> self, T[] items)
      Modifies the collection by adding all the elements in the specified array to the collection. The behavior of this operation is undefined if the specified array is modified while the operation is in progress.

      See also plus or the '+' operator if wanting to produce a new collection containing additional items but while leaving the original collection unchanged.

      Parameters:
      self - a Collection to be modified
      items - array containing elements to be added to this collection
      Returns:
      true if this collection changed as a result of the call
      Since:
      1.7.2
      See Also:
    • addAll

      public static <T> boolean addAll(List<T> self, int index, T[] items)
      Modifies this list by inserting all the elements in the specified array into the list at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they occur in the array. The behavior of this operation is undefined if the specified array is modified while the operation is in progress. See also plus for similar functionality with copy semantics, i.e. which produces a new list after adding the additional items at the specified position but leaves the original list unchanged.
      Parameters:
      self - a list to be modified
      items - array containing elements to be added to this collection
      index - index at which to insert the first element from the specified array
      Returns:
      true if this collection changed as a result of the call
      Since:
      1.7.2
      See Also:
    • addShutdownHook

      public static void addShutdownHook(Object self, Closure closure)
      Allows the usage of addShutdownHook without getting the runtime first.
      Parameters:
      self - the object the method is called on (ignored)
      closure - the shutdown hook action
      Since:
      1.5.0
    • and

      public static Number and(Number left, Number right)
      Bitwise AND together two Numbers.
      Parameters:
      left - a Number
      right - another Number to bitwise AND
      Returns:
      the bitwise AND of both Numbers
      Since:
      1.0
    • and

      public static BitSet and(BitSet left, BitSet right)
      Bitwise AND together two BitSets.
      Parameters:
      left - a BitSet
      right - another BitSet to bitwise AND
      Returns:
      the bitwise AND of both BitSets
      Since:
      1.5.0
    • and

      public static Boolean and(Boolean left, Boolean right)
      Logical conjunction of two boolean operators.
      Parameters:
      left - left operator
      right - right operator
      Returns:
      result of logical conjunction
      Since:
      1.0
    • and

      public static <T> Set<T> and(Set<T> left, Iterable<T> right)
      Creates a Set composed of the intersection of a Set and an Iterable. Any elements that exist in both are added to the resultant Set.

      This operation will always create a new object for the result, while the operands remain unchanged.

       def a = [1,2,3,4] as Set
       def b = [3,4,5,6] as Set
       assert (a & b) == [3,4] as Set
       
      By default, Groovy uses a NumberAwareComparator when determining if an element exists in both sets.
      Parameters:
      left - a Set
      right - an Iterable
      Returns:
      a Set as an intersection of a Set and an Iterable
      Since:
      5.0.0
      See Also:
    • and

      public static <T> Set<T> and(Set<T> left, Iterable<T> right, Comparator<? super T> comparator)
      Creates a Set composed of the intersection of a Set and an Iterable. Any elements that exist in both iterables are added to the resultant collection.

      This operation will always create a new object for the result, while the operands remain unchanged.

       assert [3,4] as Set == ([1,2,3,4] as Set).and([3,4,5,6], Comparator.naturalOrder())
       
      Parameters:
      left - a Set
      right - an Iterable
      comparator - a Comparator
      Returns:
      a Set as an intersection of a Set and an Iterable
      Since:
      5.0.0
      See Also:
    • and

      public static <T> SortedSet<T> and(SortedSet<T> left, Iterable<T> right)
      Creates a SortedSet composed of the intersection of a SortedSet and an Iterable. Any elements that exist in both are added to the resultant SortedSet.

      This operation will always create a new object for the result, while the operands remain unchanged.

       def a = [1,2,3,4] as SortedSet
       def b = [3,4,5,6] as Set
       assert (a & b) == [3,4] as SortedSet
       
      By default, Groovy uses a NumberAwareComparator when determining if an element exists in both sets.
      Parameters:
      left - a SortedSet
      right - an Iterable
      Returns:
      a SortedSet as an intersection of a SortedSet and an Iterable
      Since:
      5.0.0
      See Also:
    • and

      public static <T> SortedSet<T> and(SortedSet<T> left, Iterable<T> right, Comparator<? super T> comparator)
      Creates a SortedSet composed of the intersection of a SortedSet and an Iterable. Any elements that exist in both iterables are added to the resultant collection.

      This operation will always create a new object for the result, while the operands remain unchanged.

       assert [3,4] as SortedSet == ([1,2,3,4] as SortedSet).and([3,4,5,6], Comparator.naturalOrder())
       
      Parameters:
      left - a SortedSet
      right - an Iterable
      comparator - a Comparator
      Returns:
      a SortedSet as an intersection of a SortedSet and an Iterable
      Since:
      5.0.0
      See Also:
    • any

      public static boolean any(Object self)
      Iterates over the elements of a collection, and checks whether at least one element is true according to the Groovy Truth. Equivalent to self.any({element -> element})