public class DefaultGroovyMethodsSupport extends Object
Constructor and Description |
---|
DefaultGroovyMethodsSupport() |
Modifier and Type | Method and Description |
---|---|
protected static <T> Collection<T> |
cloneSimilarCollection(Collection<T> orig,
int newCapacity) |
protected static <K,V> Map<K,V> |
cloneSimilarMap(Map<K,V> orig) |
static void |
closeQuietly(Closeable c)
Close the Closeable.
|
static void |
closeWithWarning(Closeable closeable)
Close the Closeable.
|
protected static <T> T[] |
createSimilarArray(T[] orig,
int newCapacity) |
protected static <T> Collection<T> |
createSimilarCollection(Collection<T> collection) |
protected static <T> Collection<T> |
createSimilarCollection(Collection<T> orig,
int newCapacity) |
protected static <T> Collection<T> |
createSimilarCollection(Iterable<T> iterable) |
protected static <T> List<T> |
createSimilarList(List<T> orig,
int newCapacity) |
protected static <K,V> Map<K,V> |
createSimilarMap(Map<K,V> orig) |
protected static Collection |
createSimilarOrDefaultCollection(Object object) |
protected static <T> Queue<T> |
createSimilarQueue(Queue<T> orig) |
protected static <T> 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,
EmptyRange range) |
protected static RangeInfo |
subListBorders(int size,
Range range) |
protected static void |
writeUTF16BomIfRequired(OutputStream stream,
Charset charset) |
protected static void |
writeUTF16BomIfRequired(OutputStream stream,
String charset) |
protected static void |
writeUTF16BomIfRequired(Writer writer,
Charset charset) |
protected static void |
writeUTF16BomIfRequired(Writer writer,
String charset) |
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(Closeable closeable)
closeable
- the thing to closepublic static void closeQuietly(Closeable c)
c
- the thing to closeprotected static <T> Collection<T> cloneSimilarCollection(Collection<T> orig, int newCapacity)
protected static Collection createSimilarOrDefaultCollection(Object object)
protected static <T> Collection<T> createSimilarCollection(Iterable<T> iterable)
protected static <T> Collection<T> createSimilarCollection(Collection<T> collection)
protected static <T> Collection<T> createSimilarCollection(Collection<T> orig, int newCapacity)
protected static <T> T[] createSimilarArray(T[] orig, int newCapacity)
protected static boolean sameType(Collection[] cols)
cols
- an array of collectionsprotected static void writeUTF16BomIfRequired(Writer writer, String charset) throws IOException
IOException
protected static void writeUTF16BomIfRequired(Writer writer, Charset charset) throws IOException
IOException
protected static void writeUTF16BomIfRequired(OutputStream stream, String charset) throws IOException
IOException
protected static void writeUTF16BomIfRequired(OutputStream stream, Charset charset) throws IOException
IOException