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 9182267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:31:12+00:00 2026-06-17T18:31:12+00:00

Below is an example of the input I am dealing with: A linkedHashMap with

  • 0

Below is an example of the input I am dealing with:

A linkedHashMap with String,Double as parameters

NumericMap: { p=20.0, r=5.0, i=2.0}

And file input:

p = i * i * r

What I now need to do is take the file input and store it in the program as a data structure that allows duplicates and maintains the order of the items from the file, based on insertion. From there I need to be able to apply the doubles in the relevant order into the file input, resulting in:

20 = 2 * 2 * 5

From here I need to say:

If(the file input structure .contains("*"){
Double1 = the double in front of the *
Double2 = the double after the *
Answer1 = Double1 * Double2
}

So far I have managed to achieve all of this by putting the file input into a linkedHashMap as well, but linkedHashMaps do not allow for duplicate entries. Someone suggested to me to use a multiMap like so:

Multimap map = ArrayListMultimap.create();
map.put(key, value1);
map.put(key, value2);
List values = map.get(key);

But unfortunately this just returns errors. I have also attempted to do this with arrayLists, but obviously arrayLists do not maintain there order once adjusted.

Any ideas on what I can use for my file input to obtain all of the above and how I should go about doing it.

Regards

  • 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-17T18:31:13+00:00Added an answer on June 17, 2026 at 6:31 pm

    You can code your own multiple map class. Here is one of the implementation:

    import java.util.HashMap;
    import java.util.LinkedList;
    import java.util.List;
    import java.util.Map;
    
    
    public class MultiMap<K, V> {
        Map<K, List<V>> map = new HashMap<K, List<V>>();
    
        public void put(K key, V value) {
            List<V> values = null;
            if(!map.containsKey(key)) {
                values = new LinkedList<V>();
                map.put(key, values);
            } else {
                values = map.get(key);
            }
    
            assert(values != null);
            values.add(value);
        }
    
        public List<V> get(K key) {
            return map.get(key);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used below code for customize the file input type, <form class=example action=#> <!--<input
about click and submit example below: <form action=url method=post> <input type=text id=input1/> <input type=submit
The example below, is just an example, I know that I don't need an
How to select empty all 'input type=text' elements with class name 'myTextbox example below
In my example below I'm using a dijit.form.DateTextBox : <input type=text name=startDate dojoType=dijit.form.DateTextBox constraints={datePattern:'MM/dd/yyyy'}
In this below example, say file.xml There are values inside tags return code= I
I'm using the example below: APT command line interface-like yes/no input? I want to
See my example below. I'm trying to enter Mike into the input and then
So, in my example below, InputDate' is an input type=text, DateColumn is a TD
In PHP how do I validate user input like an example below. Example valid

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.