use of org.openstreetmap.osmosis.core.container.v0_6.EntityProcessor in project osmosis by openstreetmap.
the class EntityReporter method process.
/**
* {@inheritDoc}
*/
public void process(EntityContainer entityContainer) {
String userName;
final UserStatistics user;
// Obtain the user statistics object.
userName = entityContainer.getEntity().getUser().getName();
if (userName != null && userName.length() > 0) {
if (userMap.containsKey(userName)) {
user = userMap.get(userName);
} else {
user = new UserStatistics(userName);
userMap.put(userName, user);
}
} else {
user = anonymousUser;
}
// Increment the relevant user statistic.
entityContainer.process(new EntityProcessor() {
private UserStatistics processorUser = user;
public void process(BoundContainer bound) {
// Do nothing.
}
public void process(NodeContainer node) {
processorUser.incrementNodeCount();
totalUser.incrementNodeCount();
}
public void process(WayContainer way) {
processorUser.incrementWayCount();
totalUser.incrementWayCount();
}
public void process(RelationContainer relation) {
processorUser.incrementRelationCount();
totalUser.incrementRelationCount();
}
});
}
Aggregations