jet.utils
Class Loop<C,RESULT>

java.lang.Object
  extended by jet.utils.Loop<C,RESULT>
All Implemented Interfaces:
java.lang.Runnable

public abstract class Loop<C,RESULT>
extends java.lang.Object
implements java.lang.Runnable

Author:
mmeiste10.1

Field Summary
protected  java.util.Collection collection
           
protected  java.util.Enumeration<C> enumeration
           
protected  java.util.Iterator<C> iterator
           
private  java.util.Collection<EventListener> listeners
           
protected  long pos
           
protected  RESULT result
           
private  boolean wcontinue
           
 
Constructor Summary
Loop()
          Creates a new instance of ForEach
 
Method Summary
 void addListener(EventListener l)
           
 RESULT execute()
           
 RESULT execute(C[] c)
           
 RESULT execute(java.util.Collection c)
           
 RESULT execute(java.util.Enumeration e)
           
 RESULT execute(java.util.Iterator i)
           
 RESULT getResult()
           
abstract  void iteration(C object)
           
private  void notifyAllListeners(boolean success)
           
 void run()
           
 void setArray(C[] a)
           
 void setCollection(java.util.Collection<C> c)
           
 void setEnumeration(java.util.Enumeration<C> e)
           
 void setIterator(java.util.Iterator<C> i)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collection

protected java.util.Collection collection

iterator

protected java.util.Iterator<C> iterator

enumeration

protected java.util.Enumeration<C> enumeration

result

protected RESULT result

pos

protected long pos

wcontinue

private boolean wcontinue

listeners

private java.util.Collection<EventListener> listeners
Constructor Detail

Loop

public Loop()
Creates a new instance of ForEach

Method Detail

setCollection

public void setCollection(java.util.Collection<C> c)

setArray

public void setArray(C[] a)

setIterator

public void setIterator(java.util.Iterator<C> i)

setEnumeration

public void setEnumeration(java.util.Enumeration<C> e)

iteration

public abstract void iteration(C object)

execute

public final RESULT execute(java.util.Iterator i)

execute

public final RESULT execute(java.util.Collection c)

execute

public final RESULT execute(C[] c)

execute

public final RESULT execute(java.util.Enumeration e)

execute

public final RESULT execute()

stop

public void stop()

run

public void run()
Specified by:
run in interface java.lang.Runnable

start

public void start()

getResult

public RESULT getResult()

addListener

public void addListener(EventListener l)

notifyAllListeners

private void notifyAllListeners(boolean success)