com.agentpp.explorer.script.external
Interface LoopCondition

All Superinterfaces:
java.util.Collection, java.lang.Iterable

public interface LoopCondition
extends java.util.Collection

The LoopCondition interface provides a pseudo Collection that returns increasing numbers through the collection's iterator(s) until it is stopped. An instance of this class can be used in a VTL #foreach loop to implement a classic for-loop with a boolean loop condition.

Since:
2.2.2
Version:
2.2.2

Method Summary
 boolean isStopped()
          Checks if the loop is stopped.
 void setLoopCondition(boolean condition)
          Sets the loop condition.
 void stop()
          Stops the loop which has the same effect as calling setLoopCondition(boolean) to false.
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

stop

void stop()
Stops the loop which has the same effect as calling setLoopCondition(boolean) to false.


setLoopCondition

void setLoopCondition(boolean condition)
Sets the loop condition.

Parameters:
condition - if true another number may be returned by an Iterator on this object, otherwise iterator().hasNext() will return false.

isStopped

boolean isStopped()
Checks if the loop is stopped.

Returns:
true if the loop has been stopped, false otherwise.

Copyright 2003-2011, Frank Fock, All Rights Reserved. http://www.mibexplorer.com