Database Reference
In-Depth Information
});
}
The
Command<E>
interfaces only passes a
key
and a
value
. If more
parameters are needed, they can be passed into the anonymous class by
making the parameters final. This is demonstrated in the
doSomethingMore
method, which takes a second value parameter:
public void
doSomethingMore(
long
timestamp,String
key,String value,
final
String another) {
aggregator.each(timestamp, key, value,
new
Command<String>() {
public
String execute(
long
timestamp,
long
quantized,
String quantizedString, String key, String
value) {
String k = key+":"+quantizedString;
System.
out
.println(k+"="+value+","+another);
return
k;
}
});
}