Solved Checking Hash Map Values

Discussion in 'Plugin Development' started by dart2112, Jan 24, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    dart2112

    say i have this hash map:
    Map<Player, Long> AFKTime = new HashMap<Player, Long>();
    and i want to check if any players have a long greater than a number pulled from a config, how would i get a players name that has a long higher than the set number.
     
  2. Offline

    mythbusterma

    @dart2112

    Iterate over all the values and see if the value is greater than your threshold.
     
  3. Offline

    dart2112

    ok so how would i get the player from that
     
  4. Offline

    mythbusterma

    @dart2112

    You can iterate over entries using the entry set.
     
  5. Offline

    dart2112

    ok i dont work with hash maps much, could you point me to a java doc

    i have used the magic of Google to find what i needed, thanks for the help
     
    Last edited by a moderator: Jan 24, 2015
Thread Status:
Not open for further replies.

Share This Page