Most voted "hashmap" questions
A data structure that uses a hash function to map identification values, known as keys, to their associated values.
Learn more…68 questions
Sort by count of
-
0
votes1
answer248
viewsAdding values to the Hashmap <Integer, List<Integer>> and fetching them through the key?
I’m making an app focused on external vendors. 1 external seller has several customers, and also several products, which is traded freely with these customers. These products do not always remain at…
-
0
votes1
answer574
viewsHow to check if the value of a key exists on a map in c++
I am doing a graph TAD and I use a map structure to map the ID of a vertex to its index in the adjacency matrix and to do this I need to first check if given the vertex id it is already added to the…
-
0
votes2
answers95
viewsHashmap type attribute 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…
-
0
votes1
answer127
viewsConnection Android Studio Database Passing Date
I’m having trouble with the following, I make the connection with the database everything right but in the code I use a parameter Map because I pass username, password, etc., but I need to pass a…
-
0
votes1
answer62
viewsUse user-selected content in Combobox as key (map) in Enum class
All right, you guys? With a difficulty. That’s exactly what the title says. Code containing the Cbox: JFileChooser fc = new JFileChooser(new File(pastaPadrao)); String[] siglaStrings = {…
-
0
votes1
answer54
viewsDoubt - Hashmap
I need to go through a list of hotel reservations and, for each such reservation, capture the Event that is associated with it. At the end of the process I need to say how many hotel reservations…
-
0
votes1
answer50
viewsDoubt - Hashmap & List
My need was as follows: A report that would bring the Event and the number of hotel reservations that was associated with that Event. And so it followed as the code below shows:…
-
0
votes1
answer202
viewsUse of hashmap to make comparisons
I have the following situation: I get a list of itensVenda, and in it I have associated with Venda. In the Venda I have a list of itensVenda and the Cliente, and in Customer, I have associated a…
-
0
votes1
answer153
viewsHashmap overrides values
I am 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" }, {…
-
0
votes1
answer727
viewsList of attributes with differences 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 present difference. I need this logic for a generic object, capable of receiving any type. Ex:…
-
0
votes1
answer37
viewsString replace is not performing swap
I am not able to alter the character of my string with that of the map value, if they are equal: key and character. import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; public…
-
0
votes1
answer132
viewsAfter recovering the objects with Valueeventlistener the List does not retain the data
I’m doing an Activity, which searches in Firebase the User objects, traversing a Hashmap with Valueeventlistener to display the result inside a Recyclerview. The first Log returns the Arraylist…
-
0
votes1
answer42
viewsHow much can the access cost of an unodered_map hinder the performance of a game?
The cost of access to unordered_map can cause FPS to drop in a game if it is accessed thousands of times per second? class var { public: template < typename t = double > static inline auto…
-
0
votes1
answer30
viewsHow can I identify if 2 Hashmaps have Objects with Common Ids
Right now I’m playing a card game, in which each Player has an inventory of his Cards. I am now trying to create a Deck and my goal is to make the Cards that are already in the Deck not appear on…
-
0
votes1
answer27
viewsHow to compare 2 different Hashmaps in Java
I have 2 Strings that convert to Hashmaps, the first is an input that the user gives to the application. The second is an Array that contains a lot of words. I need to compare both Hashmaps to see…
-
-1
votes1
answer33
viewsAdd more than one identical key to a table
A problem arose in an excerpt of the code, where it is stored in a variable Hashmap 2 different values, the problem is that the indexing as I understand it is done by the key, that is, it is not…
-
-1
votes1
answer401
viewsHow to get the value of an Object that is inside an array of objects > java?
I have a list of boletos in my GRID and I need to select some to have only the selected ones printed, so I am passing as parameter lArc_dados(grid) so that I can at the time of logic pick only those…
-
-2
votes1
answer31
viewsQuestion about using Hashmap
I have a question about the use of Hashmap of Java. On this occasion, I have a class with the attribute Hashmap custo. In this class, I need to create a builder and in this builder, I need to…