public class DefaultGroovyMethodsSupport extends Object
Support methods for DefaultGroovyMethods and PluginDefaultMethods.
Type Params | Return Type | Name and description |
---|---|---|
<T> | protected static Collection<T> |
cloneSimilarCollection(Collection<T> orig, int newCapacity) |
<K, V> | protected static Map<K, V> |
cloneSimilarMap(Map<K, V> orig) |
public static void |
closeQuietly(Closeable c) Close the Closeable. | |
public static void |
closeWithWarning(Closeable closeable) Close the Closeable. | |
<T> | protected static T[] |
createSimilarArray(T[] orig, int newCapacity) |
<T> | protected static Collection<T> |
createSimilarCollection(Iterable<T> iterable) |
<T> | protected static Collection<T> |
createSimilarCollection(Collection<T> collection) |
<T> | protected static Collection<T> |
createSimilarCollection(Collection<T> orig, int newCapacity) |
<T> | protected static List<T> |
createSimilarList(List<T> orig, int newCapacity) |
<K, V> | protected static Map<K, V> |
createSimilarMap(Map<K, V> orig) |
protected static Collection |
createSimilarOrDefaultCollection(Object object) | |
<T> | protected static Queue<T> |
createSimilarQueue(Queue<T> orig) |
<T> | protected static Set<T> |
createSimilarSet(Set<T> orig) |
protected static int |
normaliseIndex(int i, int size) This converts a possibly negative index to a real index into the array. | |
protected static boolean |
sameType(Collection[] cols) Determines if all items of this array are of the same type. | |
protected static RangeInfo |
subListBorders(int size, Range range) | |
protected static RangeInfo |
subListBorders(int size, EmptyRange range) | |
protected static void |
writeUTF16BomIfRequired(Writer writer, String charset) | |
protected static void |
writeUTF16BomIfRequired(Writer writer, Charset charset) | |
protected static void |
writeUTF16BomIfRequired(OutputStream stream, String charset) | |
protected static void |
writeUTF16BomIfRequired(OutputStream stream, Charset charset) |
Methods inherited from class | Name |
---|---|
class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Close the Closeable. Ignore any problems that might occur.
c
- the thing to closeClose the Closeable. Logging a warning if any problems occur.
closeable
- the thing to closeThis converts a possibly negative index to a real index into the array.
i
- the unnormalized indexsize
- the array sizeDetermines if all items of this array are of the same type.
cols
- an array of collections
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/org/codehaus/groovy/runtime/DefaultGroovyMethodsSupport.html