For my schooling I have to write a programm, which read and return costumer value from data. To do that, I have created an double hash map. In the inner, i have mapped for example, keys like name, to values like chris. The outer map is for mapping the inner maps, to the costumers name.
To create a list of the accessible files/costumers, I have created that code:
for (HashMap<String, String> file: output.MapForFileMaps.values())
{
h = h + 1;
if (fileRequest == h)
{
requestIsListet = true;
for (String key: file.keySet())
{
p = p + 1;
System.out.println("Press " + p + " for " + key);
}
}
}
Question: Could I reach directly that part of the hash map, which is needed, by asking for the value or key of the hash map on the n`th place?
Current Problem is, that I want to check wheather the input is connected to a accessible part of the map, or not. So I could return this area of code by an while loop, while request is not available.