Package org.codehaus.groovy.runtime
Class DefaultGroovyMethodsSupport
- java.lang.Object
- 
- org.codehaus.groovy.runtime.DefaultGroovyMethodsSupport
 
- 
- Direct Known Subclasses:
- DateGroovyMethods,- DefaultGroovyMethods,- IOGroovyMethods,- NioExtensions,- NioGroovyMethods,- PluginDefaultGroovyMethods,- PluginDefaultGroovyMethods,- ProcessGroovyMethods,- ResourceGroovyMethods,- SocketGroovyMethods,- StringGroovyMethods
 
 public class DefaultGroovyMethodsSupport extends Object Support methods for DefaultGroovyMethods and PluginDefaultMethods.
- 
- 
Constructor SummaryConstructors Constructor Description DefaultGroovyMethodsSupport()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method 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 voidcloseQuietly(Closeable c)Close the Closeable.static voidcloseWithWarning(Closeable closeable)Close the Closeable.protected static <T> T[]createSimilarArray(T[] orig, int newCapacity)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> List<T>createSimilarList(List<T> orig, int newCapacity)protected static <K,V>
 Map<K,V>createSimilarMap(Map<K,V> orig)protected static CollectioncreateSimilarOrDefaultCollection(Object object)protected static <T> Queue<T>createSimilarQueue(Queue<T> orig)protected static <T> Set<T>createSimilarSet(Set<T> orig)protected static intnormaliseIndex(int i, int size)This converts a possibly negative index to a real index into the array.protected static booleansameType(Collection[] cols)Determines if all items of this array are of the same type.protected static RangeInfosubListBorders(int size, EmptyRange range)protected static RangeInfosubListBorders(int size, Range range)protected static voidwriteUTF16BomIfRequired(OutputStream stream, String charset)protected static voidwriteUTF16BomIfRequired(OutputStream stream, Charset charset)protected static voidwriteUTF16BomIfRequired(Writer writer, String charset)protected static voidwriteUTF16BomIfRequired(Writer writer, Charset charset)
 
- 
- 
- 
Method Detail- 
subListBordersprotected static RangeInfo subListBorders(int size, EmptyRange range) 
 - 
normaliseIndexprotected static int normaliseIndex(int i, int size)This converts a possibly negative index to a real index into the array.- Parameters:
- i- the unnormalized index
- size- the array size
- Returns:
- the normalised index
 
 - 
closeWithWarningpublic static void closeWithWarning(Closeable closeable) Close the Closeable. Logging a warning if any problems occur.- Parameters:
- closeable- the thing to close
 
 - 
closeQuietlypublic static void closeQuietly(Closeable c) Close the Closeable. Ignore any problems that might occur.- Parameters:
- c- the thing to close
 
 - 
cloneSimilarCollectionprotected static <T> Collection<T> cloneSimilarCollection(Collection<T> orig, int newCapacity) 
 - 
createSimilarOrDefaultCollectionprotected static Collection createSimilarOrDefaultCollection(Object object) 
 - 
createSimilarCollectionprotected static <T> Collection<T> createSimilarCollection(Iterable<T> iterable) 
 - 
createSimilarCollectionprotected static <T> Collection<T> createSimilarCollection(Collection<T> collection) 
 - 
createSimilarCollectionprotected static <T> Collection<T> createSimilarCollection(Collection<T> orig, int newCapacity) 
 - 
createSimilarArrayprotected static <T> T[] createSimilarArray(T[] orig, int newCapacity)
 - 
sameTypeprotected static boolean sameType(Collection[] cols) Determines if all items of this array are of the same type.- Parameters:
- cols- an array of collections
- Returns:
- true if the collections are all of the same type
 
 - 
writeUTF16BomIfRequiredprotected static void writeUTF16BomIfRequired(Writer writer, String charset) throws IOException - Throws:
- IOException
 
 - 
writeUTF16BomIfRequiredprotected static void writeUTF16BomIfRequired(Writer writer, Charset charset) throws IOException - Throws:
- IOException
 
 - 
writeUTF16BomIfRequiredprotected static void writeUTF16BomIfRequired(OutputStream stream, String charset) throws IOException - Throws:
- IOException
 
 - 
writeUTF16BomIfRequiredprotected static void writeUTF16BomIfRequired(OutputStream stream, Charset charset) throws IOException - Throws:
- IOException
 
 
- 
 
-