Formatting java codes with sbt-java-formatter.
This commit is contained in:
parent
27500001ea
commit
998c5a9285
401 changed files with 19750 additions and 17450 deletions
|
|
@ -9,7 +9,7 @@ import java.util.Map;
|
|||
|
||||
import akka.actor.AbstractActor;
|
||||
|
||||
//#worker
|
||||
// #worker
|
||||
public class StatsWorker extends AbstractActor {
|
||||
|
||||
Map<String, Integer> cache = new HashMap<String, Integer>();
|
||||
|
|
@ -17,15 +17,17 @@ public class StatsWorker extends AbstractActor {
|
|||
@Override
|
||||
public Receive createReceive() {
|
||||
return receiveBuilder()
|
||||
.match(String.class, word -> {
|
||||
Integer length = cache.get(word);
|
||||
if (length == null) {
|
||||
length = word.length();
|
||||
cache.put(word, length);
|
||||
}
|
||||
getSender().tell(length, getSelf());
|
||||
})
|
||||
.build();
|
||||
.match(
|
||||
String.class,
|
||||
word -> {
|
||||
Integer length = cache.get(word);
|
||||
if (length == null) {
|
||||
length = word.length();
|
||||
cache.put(word, length);
|
||||
}
|
||||
getSender().tell(length, getSelf());
|
||||
})
|
||||
.build();
|
||||
}
|
||||
}
|
||||
//#worker
|
||||
// #worker
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue