## org.codehaus.groovy.runtime
Class DefaultGroovyMethodsSupport

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

Direct Known Subclasses:
  DefaultGroovyMethods, PluginDefaultGroovyMethods

    public class DefaultGroovyMethodsSupport

extends Object

Support methods for DefaultGroovyMethods and PluginDefaultMethods.

Nested Class Summary
`protected static class` `DefaultGroovyMethodsSupport.RangeInfo`

Constructor Summary
`DefaultGroovyMethodsSupport()`

Method Summary

`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 c)` Close the Closeable.

`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 Collection` `createSimilarOrDefaultCollection(Object object)`

`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 DefaultGroovyMethodsSupport.RangeInfo` `subListBorders(int size, EmptyRange range)`
`protected static DefaultGroovyMethodsSupport.RangeInfo` `subListBorders(int size, Range range)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultGroovyMethodsSupport

    public DefaultGroovyMethodsSupport()

Method Detail

### subListBorders

    protected static DefaultGroovyMethodsSupport.RangeInfo subListBorders(int size,
                                                                          Range range)

### subListBorders

    protected static DefaultGroovyMethodsSupport.RangeInfo subListBorders(int size,
                                                                          EmptyRange range)

### normaliseIndex

    protected static int normaliseIndex(int i,
                                        int size)

  This converts a possibly negative index to a real index into the array.

  Parameters:
    `i` - the unnormalised index
    `size` - the array size
  Returns:
    the normalised index

### closeWithWarning

    public static void closeWithWarning(Closeable c)

  Close the Closeable. Logging a warning if any problems occur.

  Parameters:
    `c` - the thing to close

### closeQuietly

    public static void closeQuietly(Closeable c)

  Close the Closeable. Ignore any problems that might occur.

  Parameters:
    `c` - the thing to close

### cloneSimilarCollection

    protected static <T> Collection<T> cloneSimilarCollection(Collection<T> orig,
                                                              int newCapacity)

### createSimilarOrDefaultCollection

    protected static Collection createSimilarOrDefaultCollection(Object object)

### createSimilarCollection

    protected static <T> Collection<T> createSimilarCollection(Collection<T> collection)

### createSimilarCollection

    protected static <T> Collection<T> createSimilarCollection(Collection<T> orig,
                                                               int newCapacity)

### createSimilarList

    protected static <T> List<T> createSimilarList(List<T> orig,
                                                   int newCapacity)

### createSimilarSet

    protected static <T> Set<T> createSimilarSet(Set<T> orig)

### createSimilarMap

    protected static <K,V> Map<K,V> createSimilarMap(Map<K,V> orig)

### cloneSimilarMap

    protected static <K,V> Map<K,V> cloneSimilarMap(Map<K,V> orig)

### sameType

    protected 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

Copyright © 2003-2009 The Codehaus. All rights reserved.