Questions tagged [multikey]

78 questions
0
votes
0 answers

Multikey hashmap - strong/weak key based lookup

I'm building a simple multi key hash map in a Java based application which would return a lookup value provided different combinations of keys where all keys and values are vanilla strings. Let's say below is a sample data…
0
votes
1 answer

c# Multikey Dictionary, "KeyNotFoundException" when replacing Tuple by own mutable class

I declared a mutable class which serves as a replacement for a tuple as key for a dictionary. The reason is serialization. Serialization works just fine. The following problem occurs, I get a "KeyNotFoundException" when using this class, but only if…
Johannes
  • 161
  • 1
  • 6
0
votes
1 answer

Parameterize MultiKeyMap with Multiple Keys

Is there any way to parameterize Apache Commons' MultiKeyMap with multiple keys? i.e. MultiKeyMap m = new MultiKeyMap(); I originally had raw MultiKeyMaps but because of the frequency…
17slim
  • 1,233
  • 1
  • 16
  • 21
0
votes
1 answer

Change every value of a MultiKeyMap (Apache Commons)

As part of a larger program I am trying to multiply every value of an Apache Commons MultiKeyMap by 120. I think I could use an Iterator, but I believe those only work for normal hashmaps. What I want to do, in terms of arrays, is this: int[] array…
17slim
  • 1,233
  • 1
  • 16
  • 21
0
votes
0 answers

Commons MultiKeyMap vs nested HashMaps

I have to associate an Object to a n keys, such as --> . I am considering using Commons MultiKeyMap or nesting HashMaps (such as Map>>). Question: I was wondering which alternative generates the least memory overhead. Note: I…
k88074
  • 2,042
  • 5
  • 29
  • 43
0
votes
2 answers

Used Multikey(1,2,3) to store entries in Map. Now only have (1) . Can I retrieve all the entries that have (1) in the Multikeys?

I've inserted values into a Map using Multikey with 3 params. Now I would like to retrieve all the entries that have a specific key in their Multikey -and I've no idea as to values of the other 2 .. map.put(new MultiKey(valueA,valueB,valueC),…
akapulko2020
  • 1,079
  • 2
  • 22
  • 36
0
votes
2 answers

Java: Map with doubleKey type, how to make the right hashCode()?

I have a MultiKey object as keys for a Map. A Key consists of a Name (String) and an ID (int). The following contract has to be fullfilled: Keys have to be equal if either the names of both keys are equal or the ids of both keys. How do I have to…
Jan
  • 2,025
  • 17
  • 27
0
votes
1 answer

mongodb multikey index bounds in arrays of subdocs

For background, the page from the docs that seems most relevant to my question is this page on multikey index bounds and index intersection. I'm having an issue where it seems like mongo is not properly combining index boundaries in an $elemMatch…
underrun
  • 6,713
  • 2
  • 41
  • 53
0
votes
2 answers

How to create and populate a nested dictionary with three keys

I have a unique double corresponding to a variation of three strings. I want to populate a dictionary or something such that I can call something like dict[key1][key2][key3] and get the value. I've tried a whole bunch of things like …
Charles Clayton
  • 17,005
  • 11
  • 87
  • 120
0
votes
1 answer

Mongodb - Query MultiKey Indexed Documents

My question is about the way MongoDB operates when querying MultiKey document. Assuming I have these documents: { a: 1, b: 2, c: ['x','y','z'] }, { a:3, b: null, c: ['x','z'] } My query is this: db..find({ b: null, c:…
refaelos
  • 7,927
  • 7
  • 36
  • 55
0
votes
3 answers

Pygame multiple keys weird behaviour

I'm making a game with pygame and I encountered a problem with the following code : while not self.end: # main game loop keys = pygame.key.get_pressed() if keys[K_LEFT]: adddirection(LEFT) elif keys[K_RIGHT]: …
Waroulolz
  • 297
  • 9
  • 23
0
votes
1 answer

geospatial index with another multikey index... Any solutions?

I have a collection like below. I want to index "location" and "product_list.id". MongoDB seems to permit only single multi key index in a document. Any work around possible? { "location":[62.99932,71.23424], "product_list":[ …
Joe
  • 3
  • 1
0
votes
1 answer

Moving MongoDB to Multikeys but indexOnly is returning false

What I'm trying to do sounds logical to me however I'm not sure. I am trying to improve part of a MongoDB collection by using Multikeys. For example: I have multiple documents with the following format: Document: { "_id":…
Levi Roberts
  • 1,277
  • 3
  • 22
  • 44
0
votes
1 answer

Collection data modeling in mongoDB

I want to design a model for profiles interaction, for example A <-> interact <-> B , the interaction contains common fields for A and B. Lets say I have collection called Interactions, I have few thoughts in mind and I am looking for the best…
assaf_miz84
  • 687
  • 2
  • 15
  • 33
0
votes
1 answer

Mongo sort by multiple fields in a nested array

I have a mongo collection with documents like- { _id : 1abc, 'data' :'blah', 'createdDate' : ISODate("2013-05-26T01:34:10Z"), 'a': [ { _id : a1adas, 'createdDate' : ISODate("2013-05-26T01:35:10Z"), 'b':[ …
Anand Hemmige
  • 3,593
  • 6
  • 21
  • 31