public final class BoundProcedure extends Object implements Procedure, Serializable
UnaryProcedure
to the
Procedure interface
using a constant unary argument.
Note that although this class implements
Serializable, a given instance will
only be truly Serializable if the
underlying objects are. Attempts to serialize
an instance whose delegates are not
Serializable will result in an exception.| Constructor and Description |
|---|
BoundProcedure(UnaryProcedure<? super A> procedure,
A arg)
Create a new BoundProcedure instance.
|
| Modifier and Type | Method and Description |
|---|---|
static <A> BoundProcedure |
bind(UnaryProcedure<? super A> procedure,
A arg)
Adapt the given, possibly-
null,
UnaryProcedure to the
Procedure interface by binding
the specified Object as a constant
argument. |
boolean |
equals(BoundProcedure that)
Learn whether a given BoundProcedure is equal to this.
|
boolean |
equals(Object that) |
int |
hashCode() |
void |
run()
Execute this procedure.
|
String |
toString() |
public BoundProcedure(UnaryProcedure<? super A> procedure, A arg)
A - arg typeprocedure - the procedure to adaptarg - the constant argument to usepublic void run()
public boolean equals(BoundProcedure that)
that - the BoundProcedure to testpublic static <A> BoundProcedure bind(UnaryProcedure<? super A> procedure, A arg)
null,
UnaryProcedure to the
Procedure interface by binding
the specified Object as a constant
argument.
When the given UnaryProcedure is null,
returns null.A - arg typeprocedure - the possibly-null
UnaryProcedure to adaptarg - the object to bind as a constant argumentBoundProcedure wrapping the given
UnaryProcedure, or null
if the given UnaryProcedure is nullCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.