Libraries |
| Script |
import com.google.common.collect.ArrayTable; import com.google.common.collect.ImmutableList; final ArrayTable <String, Integer, Object> table = ArrayTable.create( ImmutableList.of("1", "2", "3"), ImmutableList.of(0, 1, 2)); table.put("1", 0, "value1"); table.put("1", 1, "value2"); table.put("1", 2, "value3"); table.put("2", 0, "value11"); table.put("2", 1, "value22"); table.put("2", 2, "value33"); table.put("3", 0, "value111"); table.put("3", 1, "value222"); table.put("3", 2, "value333"); ret = ""; for (final Integer columnKey : table.columnKeyList()) { ret += table.column(columnKey).values() + "\n"; } return ret;
Script Result |