get the values form into an arrayIs Java “pass-by-reference” or “pass-by-value”?Does a finally block always get executed in Java?Sort a Map<Key, Value> by valuesCreate ArrayList from arrayWhat's the simplest way to print a Java array?A Java collection of value pairs? (tuples?)How to get an enum value from a string value in Java?How do I determine whether an array contains a particular value in Java?How do I declare and initialize an array in Java?Why is processing a sorted array faster than processing an unsorted array?
How might the United Kingdom become a republic?
How can I deal with a player trying to insert real-world mythology into my homebrew setting?
How do Windows version numbers work?
For a hashing function like MD5, how similar can two plaintext strings be and still generate the same hash?
What happens as wavelengths of sound waves approach tens of micrometers?
What explains 9 speed cassettes price differences?
What's an appropriate title for a person who deals with conflicts of an Empire?
Are randomly-generated passwords starting with "a" less secure?
Does throwing a penny at a train stop the train?
Why do Americans say "less than five people"?
Book where the stars go black due to aliens stopping human observation collapsing quantum possibilities
Why does the U.S. tolerate foreign influence from Saudi Arabia and Israel on its domestic policies while not tolerating that from China or Russia?
What is this welding tool I found in my attic?
Referring to different instances of the same character in time travel
Leave PhD after one year or finish it to the end?
Parse source code of the RAPID robot-automation language
Does the Dispel Magic spell work on the Mirror Image spell?
How were Martello towers supposed to work?
Do you know your 'KVZ's?
What would be the ideal melee weapon made of "Phase Metal"?
What are some examples of special things about Russian?
Why was hardware diversification an asset for the IBM PC ecosystem?
Was the Ford Model T black because of the speed black paint dries?
Is Trump personally blocking people on Twitter?
get the values form into an array
Is Java “pass-by-reference” or “pass-by-value”?Does a finally block always get executed in Java?Sort a Map<Key, Value> by valuesCreate ArrayList from arrayWhat's the simplest way to print a Java array?A Java collection of value pairs? (tuples?)How to get an enum value from a string value in Java?How do I determine whether an array contains a particular value in Java?How do I declare and initialize an array in Java?Why is processing a sorted array faster than processing an unsorted array?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I filtered a map with a key using mulitihashmap, but I couldn't handle the values for a particular key.
HashMap mh1 = new HashMap();
HashMap m2 = new HashMap(H6.getMap());
for(Object key : m2.keySet())
{
//System.out.println(key);
if(key.toString().toLowerCase().equals(keyword))
{
System.out.println(" Key : "+ key + "... value : " + m2.get(key));
String str = m2.get(key).toString();
m2
is a HashMap
. for the key, it has the values like [d1.txt, d2.txt, d3.txt, d4.txt, d5.txt, d5.txt], here I need to get the values into an array, but this str is completely a string.
the answer -->
Key : the... value : [d1.txt, d2.txt, d3.txt, d4.txt, d5.txt, d5.txt]
need to get the values in any form like array or sets only the values
java
|
show 4 more comments
I filtered a map with a key using mulitihashmap, but I couldn't handle the values for a particular key.
HashMap mh1 = new HashMap();
HashMap m2 = new HashMap(H6.getMap());
for(Object key : m2.keySet())
{
//System.out.println(key);
if(key.toString().toLowerCase().equals(keyword))
{
System.out.println(" Key : "+ key + "... value : " + m2.get(key));
String str = m2.get(key).toString();
m2
is a HashMap
. for the key, it has the values like [d1.txt, d2.txt, d3.txt, d4.txt, d5.txt, d5.txt], here I need to get the values into an array, but this str is completely a string.
the answer -->
Key : the... value : [d1.txt, d2.txt, d3.txt, d4.txt, d5.txt, d5.txt]
need to get the values in any form like array or sets only the values
java
String[] arr = str.split("\s*,\s*");
– Elliott Frisch
Mar 26 at 3:42
Why is it a string? And where does multihashmap come in?
– shmosel
Mar 26 at 3:46
What are the actual objects? Are they lists? Sets? Why are you using a raw HashMap? What doesH6.getMap()
return? Is it also raw?
– shmosel
Mar 26 at 4:01
You can split the strings by comma using regex, so it will produce an array of strings like d1.txt, d2.txt,...
– venkat
Mar 26 at 4:03
here the H6.getMap() return the words and the name of the text files which contains the word, then I filtered the map with a keyword.
– G Gayamini
Mar 26 at 4:05
|
show 4 more comments
I filtered a map with a key using mulitihashmap, but I couldn't handle the values for a particular key.
HashMap mh1 = new HashMap();
HashMap m2 = new HashMap(H6.getMap());
for(Object key : m2.keySet())
{
//System.out.println(key);
if(key.toString().toLowerCase().equals(keyword))
{
System.out.println(" Key : "+ key + "... value : " + m2.get(key));
String str = m2.get(key).toString();
m2
is a HashMap
. for the key, it has the values like [d1.txt, d2.txt, d3.txt, d4.txt, d5.txt, d5.txt], here I need to get the values into an array, but this str is completely a string.
the answer -->
Key : the... value : [d1.txt, d2.txt, d3.txt, d4.txt, d5.txt, d5.txt]
need to get the values in any form like array or sets only the values
java
I filtered a map with a key using mulitihashmap, but I couldn't handle the values for a particular key.
HashMap mh1 = new HashMap();
HashMap m2 = new HashMap(H6.getMap());
for(Object key : m2.keySet())
{
//System.out.println(key);
if(key.toString().toLowerCase().equals(keyword))
{
System.out.println(" Key : "+ key + "... value : " + m2.get(key));
String str = m2.get(key).toString();
m2
is a HashMap
. for the key, it has the values like [d1.txt, d2.txt, d3.txt, d4.txt, d5.txt, d5.txt], here I need to get the values into an array, but this str is completely a string.
the answer -->
Key : the... value : [d1.txt, d2.txt, d3.txt, d4.txt, d5.txt, d5.txt]
need to get the values in any form like array or sets only the values
java
java
edited Mar 26 at 3:54
G Gayamini
asked Mar 26 at 3:41
G GayaminiG Gayamini
11 bronze badge
11 bronze badge
String[] arr = str.split("\s*,\s*");
– Elliott Frisch
Mar 26 at 3:42
Why is it a string? And where does multihashmap come in?
– shmosel
Mar 26 at 3:46
What are the actual objects? Are they lists? Sets? Why are you using a raw HashMap? What doesH6.getMap()
return? Is it also raw?
– shmosel
Mar 26 at 4:01
You can split the strings by comma using regex, so it will produce an array of strings like d1.txt, d2.txt,...
– venkat
Mar 26 at 4:03
here the H6.getMap() return the words and the name of the text files which contains the word, then I filtered the map with a keyword.
– G Gayamini
Mar 26 at 4:05
|
show 4 more comments
String[] arr = str.split("\s*,\s*");
– Elliott Frisch
Mar 26 at 3:42
Why is it a string? And where does multihashmap come in?
– shmosel
Mar 26 at 3:46
What are the actual objects? Are they lists? Sets? Why are you using a raw HashMap? What doesH6.getMap()
return? Is it also raw?
– shmosel
Mar 26 at 4:01
You can split the strings by comma using regex, so it will produce an array of strings like d1.txt, d2.txt,...
– venkat
Mar 26 at 4:03
here the H6.getMap() return the words and the name of the text files which contains the word, then I filtered the map with a keyword.
– G Gayamini
Mar 26 at 4:05
String[] arr = str.split("\s*,\s*");
– Elliott Frisch
Mar 26 at 3:42
String[] arr = str.split("\s*,\s*");
– Elliott Frisch
Mar 26 at 3:42
Why is it a string? And where does multihashmap come in?
– shmosel
Mar 26 at 3:46
Why is it a string? And where does multihashmap come in?
– shmosel
Mar 26 at 3:46
What are the actual objects? Are they lists? Sets? Why are you using a raw HashMap? What does
H6.getMap()
return? Is it also raw?– shmosel
Mar 26 at 4:01
What are the actual objects? Are they lists? Sets? Why are you using a raw HashMap? What does
H6.getMap()
return? Is it also raw?– shmosel
Mar 26 at 4:01
You can split the strings by comma using regex, so it will produce an array of strings like d1.txt, d2.txt,...
– venkat
Mar 26 at 4:03
You can split the strings by comma using regex, so it will produce an array of strings like d1.txt, d2.txt,...
– venkat
Mar 26 at 4:03
here the H6.getMap() return the words and the name of the text files which contains the word, then I filtered the map with a keyword.
– G Gayamini
Mar 26 at 4:05
here the H6.getMap() return the words and the name of the text files which contains the word, then I filtered the map with a keyword.
– G Gayamini
Mar 26 at 4:05
|
show 4 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349529%2fget-the-values-form-into-an-array%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55349529%2fget-the-values-form-into-an-array%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
String[] arr = str.split("\s*,\s*");
– Elliott Frisch
Mar 26 at 3:42
Why is it a string? And where does multihashmap come in?
– shmosel
Mar 26 at 3:46
What are the actual objects? Are they lists? Sets? Why are you using a raw HashMap? What does
H6.getMap()
return? Is it also raw?– shmosel
Mar 26 at 4:01
You can split the strings by comma using regex, so it will produce an array of strings like d1.txt, d2.txt,...
– venkat
Mar 26 at 4:03
here the H6.getMap() return the words and the name of the text files which contains the word, then I filtered the map with a keyword.
– G Gayamini
Mar 26 at 4:05