org.codehaus.groovy.runtime
Class IteratorClosureAdapter

java.lang.Object
  extended bygroovy.lang.GroovyObjectSupport
      extended bygroovy.lang.Closure
          extended byorg.codehaus.groovy.runtime.IteratorClosureAdapter
All Implemented Interfaces:
Cloneable, groovy.lang.GroovyObject, Runnable

public class IteratorClosureAdapter
extends groovy.lang.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

Field Summary
 
Fields inherited from class groovy.lang.Closure
DONE, SKIP
 
Constructor Summary
IteratorClosureAdapter(Object delegate)
           
 
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
 groovy.lang.MetaClass getMetaClass()
           
 void setMetaClass(groovy.lang.MetaClass metaClass)
          Allows the MetaClass to be replaced with a derived implementation
 
Methods inherited from class groovy.lang.Closure
asWritable, call, call, clone, curry, doCall, getDelegate, getDirective, getMethod, getOwner, getParameterTypes, getProperty, invokeMethod, run, setDelegate, setDirective, setProperty, throwRuntimeException
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorClosureAdapter

public IteratorClosureAdapter(Object delegate)
Method Detail

getMetaClass

public groovy.lang.MetaClass getMetaClass()

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Description copied from interface: groovy.lang.GroovyObject
Allows the MetaClass to be replaced with a derived implementation


asList

public List asList()

doCall

protected Object doCall(Object argument)
Description copied from class: groovy.lang.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

Parameters:
argument -
Returns:
the result of calling the closure


Copyright © 2003-2004 The Codehaus. All Rights Reserved.