Filter the arraylist related with LinkedHashMap

292 Views Asked by At

I have no idea to filter the arraylist related with Map.

ArrayList<Map<String, String>> g_nodes = new ArrayList<Map<String, String>>();

*I used LinkedHashMap in my program.

After inserted the data from sql, g_nodes is displayed in console as the followings:

g_nodes = [{100=test100}, {100=test100, 101=test101}, {100=test100, 101=test101, 102=test102}, {100=test100, 101=test101, 102=test102, 103=test103}, {100=test100, 101=test101, 102=test102, 103=test103, 104=test104}, {100=test100, 101=test101, 102=test102, 103=test103, 104=test104, 105=test105}, {100=test100, 101=test101, 102=test102, 103=test103, 104=test104, 108=test108}, {100=test100, 101=test101, 102=test102, 103=test103, 106=test106}, {100=test100, 101=test101, 102=test102, 107=test107}, {100=test100, 999=test999}]

I want to filter the g_nodes to output in console as the followings:

g_nodes = [{100=test100}, {100=test100, 101=test101}, {100=test100, 101=test101, 102=test102},{100=test100, 101=test101, 102=test102, 103=test103, 104=test104, 105=test105, 108=test108, 106=test106},{100=test100, 101=test101, 102=test102, 107=test107}, {100=test100, 999=test999}]

pls teach me how can I get it?

0

There are 0 best solutions below