Groovy 2.2.1

org.codehaus.groovy.runtime
[Java] Class DefaultGroovyMethodsSupport

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

public class DefaultGroovyMethodsSupport
extends Object

Support methods for DefaultGroovyMethods and PluginDefaultMethods.


Method Summary
protected static Collection cloneSimilarCollection(Collection orig, int newCapacity)

protected static Map cloneSimilarMap(Map orig)

static void closeQuietly(Closeable c)

Close the Closeable.

static void closeWithWarning(Closeable c)

Close the Closeable.

protected static Object[] createSimilarArray(Object[] orig, int newCapacity)

protected static Collection createSimilarCollection(Collection collection)

protected static Collection createSimilarCollection(Collection orig, int newCapacity)

protected static List createSimilarList(List orig, int newCapacity)

protected static Map createSimilarMap(Map orig)

protected static Collection createSimilarOrDefaultCollection(Object object)

protected static Set createSimilarSet(Set 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)

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Method Detail

cloneSimilarCollection

@SuppressWarningsif (answer != null) return answer;
protected static Collection cloneSimilarCollection(Collection orig, int newCapacity)


cloneSimilarMap

@SuppressWarnings// fall back to some defaults
protected static Map cloneSimilarMap(Map orig)


closeQuietly

public static void closeQuietly(Closeable c)
Close the Closeable. Ignore any problems that might occur.
Parameters:
c - the thing to close


closeWithWarning

public static void closeWithWarning(Closeable c)
Close the Closeable. Logging a warning if any problems occur.
Parameters:
c - the thing to close


createSimilarArray

@SuppressWarnings
protected static Object[] createSimilarArray(Object[] orig, int newCapacity)


createSimilarCollection

protected static Collection createSimilarCollection(Collection collection)


createSimilarCollection

protected static Collection createSimilarCollection(Collection orig, int newCapacity)


createSimilarList

protected static List createSimilarList(List orig, int newCapacity)


createSimilarMap

@SuppressWarningsif (orig instanceof Properties) {
protected static Map createSimilarMap(Map orig)


createSimilarOrDefaultCollection

protected static Collection createSimilarOrDefaultCollection(Object object)


createSimilarSet

@SuppressWarningsreturn new LinkedHashSet();
protected static Set createSimilarSet(Set orig)


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


sameType

@SuppressWarningsif (all.size() == 0)
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


subListBorders

protected static RangeInfo subListBorders(int size, Range range)


subListBorders

protected static RangeInfo subListBorders(int size, EmptyRange range)


 

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