Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7958581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:26:39+00:00 2026-06-04T04:26:39+00:00

I have been searching for hours through all the posts regarding LinkedHashMap but I

  • 0

I have been searching for hours through all the posts regarding LinkedHashMap but I seem to be missing the basics.

I will be generating a K,V sets from a db call, but no idea what each set will be. Some K,V will be processed and others not

I need to iterate the map, get the position (indexOf[i]??) + K(String).
This will then be passed out to anther method to ask how that K is to be processed (put into 2nd array)

Based on the 2nd array, I will then process the required K,V sets calling the position[i].

ie
1) poll db for info, records return as follows
– abc txt
– def blah
– ghi blah
– jkl txt
2) loop records and ask 2nd script what to do
– txt process like this …..
– blah do nothing
– save indexOf for quick referral as K may change value.
– change K,V if needed (spelling error corrected, remove spaces, strtolower etc)
3) based on further processing call indexOf as needed (K may have changed as above)

So is a LinkedHashMap the correct type to use?

From a PHP point of view seems easy, so I must be a bit thick on this.

Any code examples would be great.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:26:40+00:00Added an answer on June 4, 2026 at 4:26 am

    It sounds like you need to be able to efficiently find elements in your structure both by key and by position.

    One way to achieve this with standard Java containers is by using a Map in conjunction with an ArrayList (both storing references to the same objects). The former enables fast lookups by key; the latter, by position.

    Insertions into such a structure would be O(n). However, it sounds like you’re building the structure once, and not modifying it afterwards.

    Finally, if you don’t need to be able quickly locate an element given its key, you can lose the Map and just use an ArrayList.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been searching for hours but I can't seem to understand why this
I have been searching for an answer for 24 hours, but I did not
I have been searching to a resolution to this for hours, but I still
I've been searching stackoverflow for almost 2 hours now going through similar questions but
OK, so I have been searching for hours about my problem but nothing seems
I have been searching for several hours now how to do this, but can't
I have been searching for a few hours and cant seem to find answer
I have been searching and searching for this answer. But I cannot seem to
Have been searching how to convert a dictionary to a string. But the results
I have been searching everywhere but I could not find an answer. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.