Code example for TreeSet

Methods: iteratorsize

    private int selectedRectangle = -1;
    private String currentSelectedMove;
    private Iterator<String> possibleSelectedMoves = null;
    protected final void handleClickOnRectangle(int nRectangle) {
        if(selectedRectangle != nRectangle || !possibleSelectedMoves.hasNext()) {
            SortedSet<String> theMoves = new TreeSet<String>(getLegalMovesForRectangle(nRectangle));
            if(theMoves.size() == 0)
            possibleSelectedMoves = theMoves.iterator();            
        selectedRectangle = nRectangle;
        currentSelectedMove =;        
    // Cache all of the facts about cells that we compute, since they should not 
    // change unless the game state changes. 
    private Map<Integer, Set<String>> factsCache = new HashMap<Integer, Set<String>>();
Connect your IDE to all the code out there  Get Codota for Java