Is there an equivalent STL-Multiset container in Java?

I'm still looking for the perfect solution for this issue . To summarize, I model the power subsystem in Java, and for my data I need a container like Directed-Acyclic-Graph (DAG).

I found exactly what I need in the C ++ Standard Template Library (STL). This is a multiset that supports storing multiple data values ​​for the same key. I can clearly see how to store nodes and power keys, and their up / down connections as values ​​can be taken with this data structure.

My client has a strong need to write a Java power subsystem model, so I need a data structure identical to the multiset STL. I can potentially throw my own, but this is at the end of the game, and I cannot afford the risk of making a mistake.

I am extremely disappointed that Java is so easy in Tree / Graph collections.

Has anyone found a multiset structure in Java?

+2
source share
2 answers

Check out the Guava Multiset . In particular, HashMultiset and TreeMultiset .

+8
source

Source: https://habr.com/ru/post/889879/


All Articles