public class DefaultGroovyMethodsSupport
extends java.lang.Object
Constructor and Description |
---|
DefaultGroovyMethodsSupport() |
Modifier and Type | Method and Description |
---|---|
protected static <T> java.util.Collection<T> |
cloneSimilarCollection(java.util.Collection<T> orig,
int newCapacity) |
protected static <K,V> java.util.Map<K,V> |
cloneSimilarMap(java.util.Map<K,V> orig) |
static void |
closeQuietly(java.io.Closeable c)
Close the Closeable.
|
static void |
closeWithWarning(java.io.Closeable c)
Close the Closeable.
|
protected static <T> T[] |
createSimilarArray(T[] orig,
int newCapacity) |
protected static <T> java.util.Collection<T> |
createSimilarCollection(java.util.Collection<T> collection) |
protected static <T> java.util.Collection<T> |
createSimilarCollection(java.util.Collection<T> orig,
int newCapacity) |
protected static <T> java.util.Collection<T> |
createSimilarCollection(java.lang.Iterable<T> iterable) |
protected static <T> java.util.List<T> |
createSimilarList(java.util.List<T> orig,
int newCapacity) |
protected static <K,V> java.util.Map<K,V> |
createSimilarMap(java.util.Map<K,V> orig) |
protected static java.util.Collection |
createSimilarOrDefaultCollection(java.lang.Object object) |
protected static <T> java.util.Set<T> |
createSimilarSet(java.util.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(java.util.Collection[] cols)
Determines if all items of this array are of the same type.
|
protected static RangeInfo |
subListBorders(int size,
EmptyRange range) |
protected static RangeInfo |
subListBorders(int size,
Range range) |
protected static RangeInfo subListBorders(int size, EmptyRange range)
protected static int normaliseIndex(int i, int size)
i
- the unnormalized indexsize
- the array sizepublic static void closeWithWarning(java.io.Closeable c)
c
- the thing to closepublic static void closeQuietly(java.io.Closeable c)
c
- the thing to closeprotected static <T> java.util.Collection<T> cloneSimilarCollection(java.util.Collection<T> orig, int newCapacity)
protected static java.util.Collection createSimilarOrDefaultCollection(java.lang.Object object)
protected static <T> java.util.Collection<T> createSimilarCollection(java.lang.Iterable<T> iterable)
protected static <T> java.util.Collection<T> createSimilarCollection(java.util.Collection<T> collection)
protected static <T> java.util.Collection<T> createSimilarCollection(java.util.Collection<T> orig, int newCapacity)
protected static <T> java.util.List<T> createSimilarList(java.util.List<T> orig, int newCapacity)
protected static <T> T[] createSimilarArray(T[] orig, int newCapacity)
protected static <T> java.util.Set<T> createSimilarSet(java.util.Set<T> orig)
protected static <K,V> java.util.Map<K,V> createSimilarMap(java.util.Map<K,V> orig)
protected static <K,V> java.util.Map<K,V> cloneSimilarMap(java.util.Map<K,V> orig)
protected static boolean sameType(java.util.Collection[] cols)
cols
- an array of collections