I have some key/value pairs stored in a HashMap. Key/Value pairs are given like this: "firstKey,secondKey=value". For example: "9,6=3" The maximum value of "value" is 5. I want to check if keys contain one of the values and then save the key as an int and pass it as an argument to another method. Is there any proper method to differentiate/split the key? Or any other way to make this method work? Thank you!
public static HashMap<String, String> h = new HashMap<>();
Enumeration<?> e = p.keys();
while (e.hasMoreElements())
{
String key = (String) e.nextElement();
String value = p.getProperty(key);
h.put(key, value);
for (int i=0; i<h.size(); i++)
{
if (h.containsValue("0"))
{
String [] keys = key.split(",");
for (String key1 : keys)
{
part1 = keys[0];
part2 = keys[1];
int firstKey = Integer.parseInt(part1);
int secondKey = Integer.parseInt(part2);
t.moveCursor(firstKey, secondKey);
t.applyForegroundColor(RED);
}
}