Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Iterate per row, Guava HashBasedTable

Tags:

java

guava

How do I get all columns per row in a HashBasedTable? I initialized it this way:

Table<String, String, Integer> table = HashBasedTable.create();

I want to sum all the values mapped to each row.

like image 830
user3903214 Avatar asked Jun 03 '26 12:06

user3903214


1 Answers

If you call table.row(r), you'll get a Map from columns to values that you can call entrySet(), or values(), on.

like image 77
Louis Wasserman Avatar answered Jun 06 '26 02:06

Louis Wasserman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!