Questions tagged [linkedhashmap]

LinkedHashMap is a Hash table and linked list implementation of the Map interface in the Java Standard library. This implementation provides a predictable iteration order, in contrast with the unspecified ordering provided by HashMap, which is normally the order in which keys were inserted into the map.

703 questions
0
votes
1 answer

Hashmap order inside the expandable listview varies from device to another

Now i'm making an application that it should display a list of courses in an expandable list view and when the user clicks on a child element it opens a new activity with the course details , everything works pretty fine but , when i tested the…
0
votes
2 answers

ExpandableListAdapter using Nested LinkedHashMap

Good morning guys, I need to build a custom adapter using the following nested linked hashmap: LinkedHashMap>>. I am extending BaseExpandableListAdapter and have implemented the methods required. I have written…
Owen Nel
  • 367
  • 3
  • 9
  • 21
0
votes
3 answers

Java Linked HashMap with ArrayList empty checking

How to check wheather specific kay have an empty value in a LinkedhashMap Map>resultTable = new LinkedHashMap>(); following are the resultTable Key = Sr.ID and values are {660316, 660320, 590089, 661725,…
Prabu
  • 3,550
  • 9
  • 44
  • 85
0
votes
0 answers

Java LinkedHashMap : 2 / 3 dimensional array

like to know how to use LinkedHashMap to store data which is like Sector 1 will have Block 1 , //Block will have Entry 1, 2,3 ... n values Entry 1, Entry 2, Entry 3, …
SKay
  • 147
  • 1
  • 22
0
votes
1 answer

Output the numbers in sequence using LinkedHashMap in Java

I'm new to java and I'm working on a question where I need to output the elements from a HashMap in the order of the input. I understood that HashMap cannot do it and LinkedHashMap was specifically designed to maintain this order. I've implemented…
sdgd
  • 723
  • 1
  • 17
  • 38
0
votes
1 answer

Why do the same values get put into my LinkedHashMap Array?

I am using LinkedHashMap with an array. What is the way to 'put' and 'get' values? In my LinkedHashMap I have: Key 1 -> integer array like {5,6,2,4} Key 2 -> integer array, like {7,2,6,1} .... goes on Here is the code snippet…
SKay
  • 147
  • 1
  • 22
0
votes
1 answer

LinkedHashMap vs ArrayList with Bluetooth Scanning and ListView

I have a little bit of a confusion when it comes to what is considered the better implementation. One the one hand, LinkedHashMap provides the following benefits: Prevents duplicate items (I need to be able to prevent a scanned Bluetooth device to…
Timothy Frisch
  • 2,995
  • 2
  • 30
  • 64
0
votes
1 answer

Jsoup ArrayList and LinkedHashMap Combo

The code I've written uses jsoup to go to a site, views all the paragraph headings, then saves them to an ArrayList called headingList. Here's the tricky part. I've got a map that takes Strings as the keys and ArrayLists as the values. The code is…
REAL O G
  • 693
  • 7
  • 23
0
votes
0 answers

Getting generic return from Jongo finds

I have a collection structure mapped on a Java class ( just like jongo does ). One of those objects is a generic class ( T ). To insert data on the collection I used the annotation JsonProperty( "property_name" ) and it works pretty charm. The…
Guerino Rodella
  • 321
  • 4
  • 16
0
votes
2 answers

how to show LinkedHashMap values

I am facing a problem to iterate and show the values using LinkedHashMap. I have a Model class which have the getter setter for attributes. This is my main class... public class main { public static void main(String[] args) throws SQLException { …
Subho
  • 921
  • 5
  • 25
  • 48
0
votes
1 answer

Grails Object --> LinkedHashMap converter

Like the JSON converter, is there any easy way to convert an object into LinkedHashMap. The JSON string is constructed as def query = new JSON(cmd).toString() anything similar.. thanks..
bsr
  • 57,282
  • 86
  • 216
  • 316
0
votes
4 answers

LinkedHashMap Implementation in Java

I cannot understand the use of HashFunction in LinkedHashMap. In the HashMap implementation, the use of hashFunction is to find the index of the internal array, which can be justified, following the hashfunction contract (same key will must have…
Sashi Kant
  • 13,277
  • 9
  • 44
  • 71
0
votes
1 answer

How to filter the results of a hashMap to pick up all Keys starting with a certain letter Groovy

I have created a LinkedHashMap, which produces a list of statuses in groovy. These are the results of a mysql query. I want to filter the results of my map to use key entries (statusName) in the map which start with the letter "O". However I am…
AD26891
  • 73
  • 2
  • 11
0
votes
1 answer

how to reverse the key stored in a linkedhashmap in java

I have a method which stores the value from array into a linkedhashmap.Map stores key as 10,20 30 now I want to reverse the order of the storage of map i.e to 30,20..so on.Is there any function which can do so?? My code is- public …
tiddi rastogi
  • 526
  • 3
  • 10
  • 33
0
votes
3 answers

Duplicate keys in LinkedHashMap

Suppose I have LinkedhashMap myLHM = new LinkedHashMap<>() Values of myLHM : In above eg., Roy and Neha is repetitive/duplicate. Is it possible to hold…