Class WhileDoProcedure
java.lang.Object
org.apache.commons.functor.core.composite.AbstractLoopProcedure
org.apache.commons.functor.core.composite.WhileDoProcedure
- All Implemented Interfaces:
Serializable, Runnable, Functor, NullaryFunctor, Procedure
A
Procedure implementation of a while loop. Given a Predicate
c and an Procedure p, runs
while(c.test()) { p.run(); }.
Note that although this class implements
Serializable, a given instance will
only be truly Serializable if all the
underlying functors are. Attempts to serialize
an instance whose delegates are not all
Serializable will result in an exception.
- Version:
- $Revision$ $Date$
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longserialVersionUID declaration. -
Constructor Summary
ConstructorsConstructorDescriptionWhileDoProcedure(Predicate condition, Procedure action) Create a new WhileDoProcedure. -
Method Summary
Methods inherited from class AbstractLoopProcedure
equals, getAction, getCondition, hashCode, hashCode
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDserialVersionUID declaration.- See Also:
-
-
Constructor Details
-
WhileDoProcedure
-
-
Method Details
-
run
public void run()Execute this procedure. -
toString
Returns a human readable description of this functor. Implementators are strongly encouraged but not strictly required to override the defaultObjectimplementation of this method.- Specified by:
toStringin interfaceFunctor- Overrides:
toStringin classAbstractLoopProcedure- Returns:
- a human readable description of this functor
-