Class DoWhileProcedure
- java.lang.Object
-
- org.apache.commons.functor.core.composite.AbstractLoopProcedure
-
- org.apache.commons.functor.core.composite.DoWhileProcedure
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Runnable,Functor,NullaryFunctor,Procedure
public class DoWhileProcedure extends AbstractLoopProcedure
AProcedureimplementation of a while loop. Given aPredicatec and anProcedurep,runsdo { p.run(); } while(c.test()).Note that although this class implements
Serializable, a given instance will only be trulySerializableif all the underlying functors are. Attempts to serialize an instance whose delegates are not allSerializablewill result in an exception.- Version:
- $Revision$ $Date$
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUIDserialVersionUID declaration.
-
Constructor Summary
Constructors Constructor Description DoWhileProcedure(Procedure action, Predicate condition)Create a new DoWhileProcedure.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()Execute this procedure.java.lang.StringtoString()Returns a human readable description of this functor.-
Methods inherited from class org.apache.commons.functor.core.composite.AbstractLoopProcedure
equals, getAction, getCondition, hashCode, hashCode
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
serialVersionUID declaration.- See Also:
- Constant Field Values
-
-
Method Detail
-
run
public final void run()
Execute this procedure.
-
toString
public java.lang.String 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
-
-