org.codehaus.groovy.runtime
Class IteratorClosureAdapter

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by groovy.lang.Closure
          extended by org.codehaus.groovy.runtime.IteratorClosureAdapter
All Implemented Interfaces:
GroovyObject, java.io.Serializable, java.lang.Cloneable, java.lang.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: 12708 $
Author:
James Strachan
See Also:
Serialized Form

Field Summary
private  java.util.List list
           
private  MetaClass metaClass
           
 
Fields inherited from class groovy.lang.Closure
DELEGATE_FIRST, DELEGATE_ONLY, DONE, maximumNumberOfParameters, OWNER_FIRST, OWNER_ONLY, parameterTypes, SKIP, TO_SELF
 
Constructor Summary
IteratorClosureAdapter(java.lang.Object delegate)
           
 
Method Summary
 java.util.List asList()
           
protected  java.lang.Object doCall(java.lang.Object argument)
           
 MetaClass getMetaClass()
          Returns the metaclass for a given class.
 void setMetaClass(MetaClass metaClass)
          Allows the MetaClass to be replaced with a derived implementation.
 
Methods inherited from class groovy.lang.Closure
asWritable, call, call, call, clone, curry, getDelegate, getDirective, getMaximumNumberOfParameters, getOwner, getParameterTypes, getProperty, getResolveStrategy, getThisObject, isCase, run, setDelegate, setDirective, setProperty, setResolveStrategy, throwRuntimeException
 
Methods inherited from class groovy.lang.GroovyObjectSupport
invokeMethod
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

private final java.util.List list

metaClass

private MetaClass metaClass
Constructor Detail

IteratorClosureAdapter

public IteratorClosureAdapter(java.lang.Object delegate)
Method Detail

getMetaClass

public MetaClass getMetaClass()
Description copied from interface: GroovyObject
Returns the metaclass for a given class.

Specified by:
getMetaClass in interface GroovyObject
Overrides:
getMetaClass in class GroovyObjectSupport
Returns:
the metaClass of this instance

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
Parameters:
metaClass - the new metaclass

asList

public java.util.List asList()

doCall

protected java.lang.Object doCall(java.lang.Object argument)


Copyright © ${year} The Codehaus. All Rights Reserved.