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.
Questions tagged [linkedhashmap]
703 questions
0
votes
2 answers
How to convert arraylist to array?
I have an arraylist with JSON values. I want to convert it to an array, then I will send it to MapActivity. I tried a lot of ways but I failed.
for (int i = 0; i < matchFixture.length(); i++)
{
JSONObject c = matchFixture.getJSONObject(i);
…

Naveed Abbas
- 220
- 3
- 10
0
votes
1 answer
Using Maps to store data in JDBC postgresql
I'm trying to create a table called TOPPINGS_IN_STOCK and insert datas into it, but I've come across with an error. What's wrong?
package insertToDataBase;
import java.sql.Connection;
import java.sql.DriverManager;
import…

Capfer
- 829
- 9
- 22
0
votes
2 answers
Why am I unable to assign an embedded ArrayList to a locally declared ArrayList?
Sorry if the title is not clear, I'm not very good with programming jargon.
I have 2 string ArrayLists and an integer ArrayList obtained from one method which is passed to a separate method through the collection LinkedHashMap< String, List<…

Lagostax
- 15
- 3
0
votes
2 answers
how can I print out data saved in LinkedHashMap
This is a simple code to get person's info. For example, when I type in enter#runnan#male#23#Earth it would save the data in LinkedHashMap. Also when I type in search#runnan it would search the datas in LinkedHashMap and find name runnan then print…

Runnan
- 7
- 2
0
votes
2 answers
How to take separate data from LinkedHashMap in Java
I used LinkedHashMap . I want to take separate values from it. If it is Array we can use .get[2] ,.get[5] etc. for take 2nd and 5th value. But for LinkedHashMap how to do it. I used following code. But it print all…

Emalka
- 381
- 2
- 4
- 16
0
votes
1 answer
Copying from one HashMap to another without using putAll()
I am trying to copy all my data from an old HashMap to a new one after I resize it.
Right now, M = 10, so when the mapSize is 2*M it will double the amount of buckets.
I got the doubling thing down, and it works I checked.
I am just wondering how…

John Doe
- 31
- 12
0
votes
0 answers
REST API response getting changed
I am facing a very weird issue(at least that's what I think). I have an API which returns an object in JSON format. There is a linkedHashMap field in this object. This map is showing some weird behaviour. When I am logging this object just before…

viks1010
- 101
- 8
0
votes
1 answer
LinkedHashMap removeEldestEntry and Overriding Remove
I have a class which extends LinkedHashMap which I'm using as a cache. This cache has a property which defines the maximum size in bytes that the cache is allowed to store. I use a rough estimate for the size of the objects that I store.
I override…

Kialandei
- 394
- 1
- 11
0
votes
2 answers
LinkedHashMap error
My code is as follows:
LinkedHashMap parameters = new LinkedHashMap();
I am getting error:
not a statement
I included java.util.LinkedHashMap package and am using JDK version 4.1.2
0
votes
3 answers
Iterating through LinkedHashMap Values Isn't Ordered?
For a problem I'm designing in Java, I'm given a list of dates and winning lottery numbers. I'm supposed to do things with them, and spit them back out in order. I decided to choose a LinkedHashMap to solve it, the Date containing the date, and…

Luiserebii
- 55
- 2
- 11
0
votes
1 answer
Using Arraylist, Linked Hashmaps and Lists in GWT
So GWT creats Javascript for every object and I've once heard that you should be carefull while using List for example because it is so generic and since GWT doesn't know runtime it creates classes for every kind of functionality even though you…

user3839833
- 111
- 1
- 2
- 9
0
votes
3 answers
Feasiable algorithm to list days of months as dropdown in java
I have two dropdownlist,one indicates month and another indicates days.
My month dropdown list is as follows,
public Map month(){
final Map month = new LinkedHashMap();
…

Miller
- 744
- 3
- 15
- 39
0
votes
2 answers
sort descending linkedhashmap by value
i have 3 hashmap :
Map> tokenUnikTF= new LinkedHashMap<>();
Map> tokenUnikDF= new LinkedHashMap<>();
Map> tokenUnikWeight= new LinkedHashMap<>();
the…

Shasapo
- 183
- 2
- 15
0
votes
2 answers
Linkedhashmap
I need guidance to iterate through a LinkedHashMap with below values
{"8":{"Name":"test","city":"ny"}, "9":{"Name":"test","city":"ny"}}
I am able to display key as 8 and value as {"Name":"test","city":"ny"}
but I'am trying to display Name and city…

Angular zeus
- 23
- 1
- 9
0
votes
1 answer
Android ListView with LinkedHashMap - scrambled list when scrolling
I've had trouble finding much documentation on using LinkedHashMap with a ListView for Android, but I was able to get the list to populate correctly with the below.
Unfortunately, when I scroll, the list is scrambled the same as it would be if I…

sean
- 3,484
- 5
- 27
- 45