Questions tagged as 'hashmap'

1
answer

How to create a pair of values within a Map in Java

Is it possible to create a Map in Java using the concept of pair that exists in C ++? I have tried using the form below, however, I can not assign values to my map. Map<String, Entry<Entry<Integer,Integer>,String>...
asked by 04.04.2015 / 21:46
4
answers

Dealing with collisions in dictionary C #

I need to map an array of strings to a dictionary so that I can later test whether an informed string is valid by checking that it is part of dict , and would like to retrieve some other information stored in dict . For th...
asked by 23.03.2014 / 15:40
1
answer

Java: Convert point-delimited strings to nested JSON

I have a lot of attributes coming as dot-delimited strings like "company.id", "company.address.number", "user.name", "isAtive", and I need to create a nested JSON with their respective values. These attributes and values are in a HashMap. Not...
asked by 12.07.2018 / 19:40
1
answer

Error returning HashMap for JavaScript

When returning the hashmap to javascript I get the following error:    The resource identified by this request is only capable of generating   responses with characteristics not acceptable according to the request   "accept" headers. Call...
asked by 23.06.2016 / 03:15
4
answers

Is there performance gain using .replace () instead of .put () in a Map?

There is some performance gain using the .replace() method instead of using .put() in a Map . Studying Maps I noticed that the .put() and .replace() method have practically the same function. I made a...
asked by 31.07.2018 / 20:26
2
answers

Higher frequency of a string

I have a text where I am handling various things. Now I need to get the 3 words that repeat the most in the entire text. How can I do this? What is the best solution? I thought about storing in a list but I do not know how to put the word and...
asked by 09.09.2014 / 03:11
1
answer

Save Integer, Integer, ArrayListInteger in a collection

What I want is to do a data binding as follows: (<<Integer>, <Integer>, ArrayList<Integer>) I tried to create a HashMap<Integer,HashMap<Integer,ArrayList<Integer>>> the problem is that I forgot...
asked by 04.12.2014 / 12:05
2
answers

How to traverse the values of a HashMap through a given key?

How can I go through the values of a HashMap through a given key? An example to illustrate: I have a HashMap named values, with a key that is an id represented by String and a value that is an integer. HashMap<String, Integer> valores...
asked by 22.04.2015 / 21:58
1
answer

map.forEach Unexpected return value

I have the following map: private static Map<ParseCreator, Parseable> map = new HashMap<>(); I run this map as follows: for (Map.Entry<ParseCreator, Parseable> entry : map.entrySet()) { ParseCreator creator = ent...
asked by 09.05.2018 / 13:52
1
answer

Mapping active users and disconnecting if they exceed 3 concurrent users in java

I would like to know how I could map the users that connect based on their unique id's and id session so that when there are more than 3 sessions for this id, the users who connected first are removed from the HashMap and so on. Example: Us...
asked by 06.01.2017 / 17:00