aspose file tools*
The moose likes Clojure and the fly likes  How to Collapse Nested Map into a Sequence of Flat Maps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Languages » Clojure
Bookmark " How to Collapse Nested Map into a Sequence of Flat Maps " Watch " How to Collapse Nested Map into a Sequence of Flat Maps " New topic
Author

How to Collapse Nested Map into a Sequence of Flat Maps

Ari King
Greenhorn

Joined: Apr 22, 2010
Posts: 20
How I can collapse a nested map with "n" number of keys (tiers) to create a sequence of flat maps which are comprised of composite keys and a values.

For example, let's say we have:



I'd like to collapse the nest into a sequence of flat maps like:

Ari King
Greenhorn

Joined: Apr 22, 2010
Posts: 20
I've put together a solution (see below) that collapses nested maps into a sequence of flat maps with composite keys. Unfortunately, the solution wraps the result within another list, anyone know why? Thanks.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Collapse Nested Map into a Sequence of Flat Maps
 
Similar Threads
Recursive Grouping
Map
Extracting and Comparing Data
External jars and clojure
Compare 2 Maps