|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unkrig.commons.lang.protocol.RunnableUtil
public final class RunnableUtil
Various Runnable-related utility methods.
| Field Summary | |
|---|---|
static java.lang.Runnable |
NOP
A Runnable that does simply nothing. |
| Method Summary | ||
|---|---|---|
static
|
asRunnable(RunnableWhichThrows<EX> delegate)
Converts a RunnableWhichThrows into a Runnable, which is possible iff the source runnable's
exception is a subclass of RuntimeException. |
|
static
|
asRunnableWhichThrows(java.lang.Runnable delegate)
Converts a Runnable into a RunnableWhichThrows. |
|
static
|
runSequentially(java.util.Collection<RunnableWhichThrows<EX>> delegates)
Runs the given delegates in the current thread, in the order of the collection's iterator. |
|
static
|
runSequentially(RunnableWhichThrows<EX> delegate1,
RunnableWhichThrows<EX> delegate2)
Runs delegate1, then delegate2 in the current thread. |
|
static
|
sparingRunnable(java.lang.Runnable delegate,
Predicate<ST> condition,
ST subject)
The returned Runnable runs the delegate iff the condition evaluates to true. |
|
static java.lang.Runnable |
sparingRunnable(java.lang.Runnable delegate,
Producer<java.lang.Boolean> condition)
The returned Runnable runs the delegate iff the condition produces Boolean.TRUE. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.Runnable NOP
Runnable that does simply nothing.
| Method Detail |
|---|
public static <EX extends java.lang.Exception> RunnableWhichThrows<EX> runSequentially(RunnableWhichThrows<EX> delegate1,
RunnableWhichThrows<EX> delegate2)
delegate1, then delegate2 in the current thread.
delegate1 and then delegate2RunnableWhichThrows.run()public static <EX extends java.lang.Exception> RunnableWhichThrows<EX> runSequentially(java.util.Collection<RunnableWhichThrows<EX>> delegates)
delegates in the current thread, in the order of the collection's iterator.
delegates in strict sequenceRunnableWhichThrows.run()public static <EX extends java.lang.RuntimeException> java.lang.Runnable asRunnable(RunnableWhichThrows<EX> delegate)
RunnableWhichThrows into a Runnable, which is possible iff the source runnable's
exception is a subclass of RuntimeException.
EX - The source runnable's exceptionpublic static <EX extends java.lang.Exception> RunnableWhichThrows<EX> asRunnableWhichThrows(java.lang.Runnable delegate)
Runnable into a RunnableWhichThrows.
public static <ST> java.lang.Runnable sparingRunnable(java.lang.Runnable delegate,
Predicate<ST> condition,
ST subject)
Runnable runs the delegate iff the condition evaluates to true.
(The condition is evaluated with null as the subject argument.)
subject - The subject for the condition
public static java.lang.Runnable sparingRunnable(java.lang.Runnable delegate,
Producer<java.lang.Boolean> condition)
Runnable runs the delegate iff the condition produces Boolean.TRUE.
PredicateUtil.after(long),
ProducerUtil.every(long)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||