Questions tagged as 'hashmap'

1
answer

How to check if the value of a key exists on a map in c ++

I'm doing a TAD of graphs and I use a map structure to map the ID of a vertex to its index in the adjacency array and to do that I need to first check if given the vertex id it's already added to the graph, so how can I check if there is a mappe...
asked by 02.07.2017 / 23:59
1
answer

Adding values to the HashMap Integer, ListInteger, and fetching them through the key?

I'm making an application focused on external vendors. 1 external seller has several customers, and also various products, which is freely marketed with these customers. These products do not always remain in the same value (discounts, taxes, et...
asked by 22.05.2015 / 22:09
1
answer

List with attributes that present difference between objects - Java

I need to compare two objects in JAVA so I can get a MAP with key and value of the attributes that have difference. I need this logic for a generic object, able to receive any type. Ex: OBJETO 1 - nome: João, email: [email protected]...
asked by 02.01.2018 / 20:07
1
answer

Hashmap overwrites values

I'm trying to generate a hashmap (String, List Exercises) from a json: [ { "grupo":"Joelho", "nome":"joelho_1", "habilitar":"1" }, { "grupo":"Joelho", "nome":"joelho_2", "habilitar":"1" }, {...
asked by 02.12.2017 / 22:29
2
answers

Attribute of type HashMap appears as Object

I'm using the Spring framework and the repositories, and in one of the interfaces of one of these repositories I have, for example, a method like this: @Query("select extract(month from u.atributo1), coalesce(sum(u.atributo2), 0) from #{#entit...
asked by 21.10.2015 / 15:10
2
answers

Using a map to store 1 ID for N values? [closed]

EDIT For lack of details, I've reset the question here . The question has been flagged and a moderator will delete it as soon as possible, thanks. I have the following IDs and values, respectively: 1 - 18; 1 - 19; 1 - 20; 3 - 21; 3 - 22;...
asked by 22.05.2015 / 21:02
1
answer

Operations with HashMap

Good afternoon people, I need to do some operations using HashMap. I'm new to the area. I have the following map protected Map<String, Map<String, Integer>> elementos = new HashMap<>();' The first String is a key, the v...
asked by 05.12.2014 / 18:50
1
answer

How much can an unodered_map access cost hamper the performance of a game?

Can access cost to unordered_map cause FPS drop in a game if accessed thousands of times per second? class var { public: template < typename t = double > static inline auto get( const std::string& var_name ) -> t&a...
asked by 02.08.2018 / 19:15
1
answer

After retrieving objects with ValueEventListener, the List does not retain the data

I'm doing an Activity, which searches the Firebase for User objects, traversing a HashMap with the ValueEventListener to display the result inside a RecyclerView. The first Log returns the ArrayList listaJogadores filled correct...
asked by 24.05.2018 / 05:20
1
answer

String replace is not performing exchange

I can not change the character of my string with the value of the map, if they are equal: key and character. import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; public class Mapa { public static Map<Character,...
asked by 14.04.2018 / 19:36