Maps.transformValues(tagSummaries, hierarchyType.sumOfMoney ()),
tagImportanceScheme
)
);
Money total = Money.zero(currency);
int totalCount = 0;
final List<Txaction> taggedTxactions = Lists.newArrayList();
final List<Txaction> untaggedTxactions = Lists.newArrayList();
for (Txaction txaction : Iterables.filter(txactions, hierarchyType.matcher ())) {
if (isAnalyzable(txaction) && !hasFilteredTag(txaction, filteredTags)) {
total = total.add(txaction.getConvertedAmountByFilteringTags(filteredTags, currency, exchangeRateMap).abs());
totalCount++;
if (txaction.isTagged()) {
taggedTxactions.add(txaction);
} else {
untaggedTxactions.add(txaction);
}
}
}
final List<Node> nodes = Lists.newArrayList(build(tagRankings, taggedTxactions, tagImportanceScheme, currency, maxTags));
Money sum = Money.zero(currency);
for (Txaction txaction : untaggedTxactions) {
sum = sum.add(txaction.getConvertedAmount(currency, exchangeRateMap).abs());
}
if (!untaggedTxactions.isEmpty()) {
nodes.add(new Node(UNTAGGED, new SumOfMoney(sum, untaggedTxactions.size()), ImmutableList.<Node>of()));
}