org.codehaus.groovy.runtime
Class IteratorClosureAdapter
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.Closure
org.codehaus.groovy.runtime.IteratorClosureAdapter
- All Implemented Interfaces:
- Cloneable, GroovyObject, Runnable
- public class IteratorClosureAdapter
- extends Closure
A closure which stores calls in a List so that method calls
can be iterated over in a 'yield' style way
- Version:
- $Revision: 1.2 $
- Author:
- James Strachan
Method Summary |
List |
asList()
|
protected Object |
doCall(Object argument)
An attempt to optimise calling closures with one parameter
If the closure has one untyped parameter then it will overload this function
If not this will be called ans will use reflection to deal with the case of a
single typed parameter |
MetaClass |
getMetaClass()
|
void |
setMetaClass(MetaClass metaClass)
Allows the MetaClass to be replaced with a derived implementation |
Methods inherited from class groovy.lang.Closure |
asWritable, call, call, callSpecial, clone, curry, doCall, doCall, getDelegate, getDirective, getMethod, getOwner, getParameterTypes, getProperty, invokeMethod, isCase, run, setDelegate, setDirective, setProperty, throwRuntimeException |
IteratorClosureAdapter
public IteratorClosureAdapter(Object delegate)
getMetaClass
public MetaClass getMetaClass()
- Specified by:
getMetaClass
in interface GroovyObject
- Overrides:
getMetaClass
in class GroovyObjectSupport
setMetaClass
public void setMetaClass(MetaClass metaClass)
- Description copied from interface:
GroovyObject
- Allows the MetaClass to be replaced with a derived implementation
- Specified by:
setMetaClass
in interface GroovyObject
- Overrides:
setMetaClass
in class GroovyObjectSupport
asList
public List asList()
doCall
protected Object doCall(Object argument)
- Description copied from class:
Closure
- An attempt to optimise calling closures with one parameter
If the closure has one untyped parameter then it will overload this function
If not this will be called ans will use reflection to deal with the case of a
single typed parameter
- Overrides:
doCall
in class Closure
- Parameters:
argument
-
- Returns:
- the result of calling the closure
Copyright © 2003-2005 The Codehaus. All Rights Reserved.