Questions tagged as 'hashmap'

1
answer

Is it possible HashMap with several values?

I need to populate a bank like this:    Milk 50 kcal 20 proteins 120 carbo etc hashmap , but I can only use a key for a value, I could do with multiple values, or some other way I can do this without using HashMap ? Map<Stri...
asked by 21.11.2017 / 16:44
1
answer

How to show HashMap value?

I'm having a hard time showing (this may be using for ) the value of this HashMap. Does anyone know how? The console only shows this value:    {joao = [Ljava.lang.String; @ 2b05039f} I can not show the inner vector, String[] :...
asked by 04.10.2015 / 19:17
1
answer

Display highest frequency word per line and calculate number of words per line

I have the following text and I have to display the words that appear most frequently per line and calculate number of words for each line This is a really really really cool experiment really Cute little experiment Will it work maybe it wi...
asked by 04.01.2018 / 01:33
1
answer

Check if position is between 2 positions

I am using this code here to check if a position is 'inside' an 'area', but it will probably explode if the hashmap has too many Keys / Values, what would be the best way to do this? Thank you. HashMap<String, Region_> regionsHash = new...
asked by 25.10.2016 / 12:21
1
answer

Given a list of words, return the size of each group of anagrams decreasing [closed]

I have a file with a list of words, each in a line of .txt. I need to group them that are anagrams and return the size of the group, in descending order. Here is an example: cat, bed, aeds, drop, saed, toga, maca The grouping would be:...
asked by 19.09.2015 / 05:00
1
answer

How do I search for the value of a HashMap element?

I have a very strange question, I have a HashMap that has this two values ids("pergunta","IdP"); The pergunta is a String and IdP is an Int I now to get the value of the IdP I have to do int a = ids.get("...
asked by 12.05.2015 / 16:00
0
answers

Compare two hashmaps

Hello, I need to buy the values of 2 Hashmaps. I'm doing an Image Matcher using the same amount of colors using this code, but I'm not sure how I can compare them. public static double DoesMatch2(BufferedImage arg0, BufferedImage arg1){ Ha...
asked by 25.05.2018 / 21:38
1
answer

How to create a custom filter in the android lestview that looks for words after the space character

In this code the filter is working until the first word. From the moment I type the space character the filter stops working. Example: Search for "Steve Jobs", the system gets lost. Now if you search only until "Steve" it returns right. ArrayL...
asked by 31.10.2016 / 14:35
0
answers

ArrayListHashMapString, String in a BaseAdapter Class

I have the following Arraylist: ArrayList<HashMap<String, String>> menuItens = new ArrayList<HashMap<String, String>>(); for (int i = 0; i < 6; i++){ HashMap<String,String> hashMap = new HashMap<String,S...
asked by 24.06.2015 / 13:14
0
answers

Problem with List and HashMap [closed]

I have a list as stated below: List<Map<String, String>> lista = new ArrayList<Map<String, String>>(); Map as stated below: Map<String, String> mapa = new HashMap<String, String>(); Values are loaded...
asked by 26.05.2015 / 16:18