|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Combining HashMaps
If I have two hash maps created by new_java_util_HashMap() how do I combine them into one? I thought I should use java_util_Map_putAll() but I can't get this to work properly. Maybe I have the syntax wrong?
In some cases the two maps I need to combine have no overlapping keys, in other cases the same key may appear in both maps. If the key does exist in both maps I want the resulting combined subgroup to contain all elements. (The same element will never exist in both maps I am trying to combine.) Thanks in advance, Tom
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#2
|
||||
|
||||
I don't mean to be snarky but we can't tell you if it's right or wrong unless you show us what you have.
You will most likely have to write your own code to do that. Map.putAll() doesn't know about the internal structure of the map values and will just replace one value with another without trying to merge them. If the values are arrays or lists and you want them merged, you'll have to do that yourself.
__________________
-- Greg |
#3
|
||||
|
||||
Greg,
For _putAll I tried _putAll(List1, List2) hoping that it would combine everything from List1 into List2. I also tried it the other way around. I'm using the maps to group Airings so the key for each map is whatever I am grouping by and each key returns one or more Airings. Thanks for your continued help. Tom
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#4
|
|||
|
|||
Since you are not coding directly in java can you not do a dataunion or dataintersection before the grouping since in the end you are grouping the same anyways.
Pluckyhd |
#5
|
||||
|
||||
Quote:
I decided just to combine the groups manually by spinning through all of the elements and using AddToGrouping(). It's not elegant but it works. The bad news is that I have a lot to learn about java. The good news is that I've installed Netbeans and have started doing some experiments.
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#6
|
|||
|
|||
Quote:
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Combining Music folders! | joematt | SageTV Beta Test Software | 0 | 03-12-2009 09:18 PM |
Combining OTA and QAM possible? | dinki | Hardware Support | 8 | 08-08-2008 04:23 PM |
Combining shares in NAS Lite? | matt91 | The SageTV Community | 3 | 01-04-2008 02:58 PM |
Combining 2 sagetv mpg files together? | steingra | General Discussion | 7 | 11-07-2005 07:03 PM |
Combining MPG files? | kelemvor | General Discussion | 7 | 11-05-2005 11:34 PM |