Plugin Help Hashmap, ArrayLists, Biggest OH MY!

Discussion in 'Plugin Help/Development/Requests' started by terturl890, May 27, 2015.

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

    terturl890

    So I have a plugin... but I need to check for the largest size of an arraylist that is in a class in a HashMap.

    the HashMap: HashMap<String, HeadHunt> hhunt = new HashMap<String, HeadHunt>();

    the class HeadHunt has a private List

    List: List<String> collectedHeads = new ArrayList<String>();

    I want to be able loop through all the entries in the HashMap to look for the list that has the biggest size... Can anyone help?
     
  2. @terturl890 You can use a for loop to loop through the entries of the hashmap.
    Code:
    for(Entry<String, HeadHunt> entry : hhunt.entrySet()) {
        entry.getValue(); //Returns your HeadHunt object. Find the list from here and compare them.
    }
     
Thread Status:
Not open for further replies.

Share This Page