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
2 answers

LinkedHashMap - contains method

I need to read a flag to validate if I'll send or not an email, this flag is on a LinkedHashMap, so I'm trying to go over it looking for an ID, then I'll have to ask if is true or false, and I'm trying this: while(iterator.hasNext()){ …
rpassenger
  • 11
  • 2
0
votes
0 answers

getting rid of _1: and _2: in LinkedHashMap by changing insertion code

val hostSQLList = jsonObj.getOrElse("hostSQLList", " ").asInstanceOf[List[String]] var sqlRepMap = mutable.LinkedHashMap[String, Any]() var sqlStatusMap = mutable.LinkedHashMap[String, Any]() var sqlSlowQuery = mutable.LinkedHashMap[String,…
Tanvi
  • 413
  • 1
  • 5
  • 14
0
votes
1 answer

Using resultmap of mybatis to collect objects into a linkedhashmap

I have two tables: employee_details(department_id, employee_id) & skill_details(employee_id, skill_id). I want to construct LinkedHashMap of Employee_Details objects for each department_id, such that class Employee_Details { long employee_id; …
Ajay Bodhe
  • 51
  • 1
  • 11
0
votes
2 answers

LinkedHashMap or two separate arrays in java

I have two arrays of predefined length, let us say 8, which contains related data. I can arrange them in such a way that array1[0] has corresonding mapping at array2[0]. That is key value pairs are at the same index in both arrays. In such a case,…
User1234321232
  • 517
  • 10
  • 25
0
votes
2 answers

Iterating a LinkedHashMap which contains another one

I have a LinkedHashMap which contains another LinkedHashMap as below: LinkedHashMap> containerMap = new LinkedHashMap>(); I want to extract the values from the container Map…
JavaDeveloper
  • 92
  • 1
  • 1
  • 11
0
votes
1 answer

Sort a LinkedHashMap with Values and with Time Priority in case of Equal

I know that this topic can be well covered, but they only use a Treemap which use only one value and in case of same value does not return what I would like. Here is my object: public classe myObjectToMap { long id; double price; String…
Thomas Th.
  • 111
  • 2
  • 2
  • 10
0
votes
2 answers

LinkedHashMap with List values inside a List, How to display at JSP

I have my code like this ResourceDetailsBean.java public String empName; public String empCode; public LinkedHashMap> backFillPlanGAP; ResourceBandBean.java private String band; private String name; At the end of my…
Crawling
  • 87
  • 11
0
votes
1 answer

Why won't JComboBox display Strings from custom model?

I created a custom model for JCombobox to synchronize it with a LinkedHashMap. I wanted to create a model that could be reused with any LinkedHashMap (hence the use of generics). When I run it with my application, the String fail to appear. When I…
Skylion
  • 2,696
  • 26
  • 50
0
votes
1 answer

concurrently invalidate cache of several workers in java without hurting performances

I am creating my own cache object that will serve several threads, this is an assignment so i am not allowed to use packages and jar that are out there. I am trying to figure out how to invalidate all of them at the same time. I have a date…
Quantico
  • 2,398
  • 7
  • 35
  • 59
0
votes
2 answers

LinkedHashMap, functionality within method?

How does the following method work? Pairs is a LinkedHashMap, I am just not sure of the enhanced for loop and how it works with the hasmap. i.e the keyset. /** * Finds all names in the initial input list that match phonetically with …
user3287264
0
votes
2 answers

java: LinkedHashMap containsKey=true but get returns null

i have this weird problem: iterating over the keyset of a linkedhashmap, the get returns null on certain keys: ... System.out.println("Map: "+wildCardSummaryKey); try { rowKeys = wildCardSummaryKey.keySet().iterator(); while…
frb
  • 53
  • 5
0
votes
3 answers

How to get the keys from a LinkedHasMap?

I have a code populating a listView: JSONArray data = responseData.getJSONArray("data"); String[] values = new String[data.length()];//I wanna get rid of this LinkedHashMap helpData = new LinkedHashMap(); for (int i = 0; i <…
user1789769
0
votes
3 answers

How to sort Android Listview / HashMap

i need a little help with my listview / hashmap. I want to sort my listView by int values (TAG_EPOCH). During my search on internet i found out that i might need a LinkedHashMap or a TreeSet but i don't understand how to use them with my existing…
Maurice
  • 792
  • 11
  • 34
0
votes
1 answer

LinkedHashMap eldest entry giving null key,value

While trying to use a LinkedHashMap as a LRU cache, I am facing null pointer exceptions. A similar issue was discussed here, however my scenario is a bit different. @Override protected boolean removeEldestEntry(Map.Entry>…
sutanu dalui
  • 663
  • 7
  • 25
0
votes
3 answers

Walking a hashmap of hashmaps to retrieve a string value in Java

I'm new to Java (and not too comfortable with strong typing) and I have a method that takes in a HashMap. A key in this hashmap contains a key, which has a hashmap for value, which also points to a hashmap, etc, until we reach a…
Loic Duros
  • 5,472
  • 10
  • 43
  • 56