Code example for SortedMap

Methods: containsKey, put

0
    public QuestStateList() { 
        _quests = Collections.synchronizedSortedMap(new TreeMap<Integer, QuestState>());
    } 
 
    public boolean addQuest(int questId, QuestState questState) {
        if (_quests.containsKey(questId)) {
            log.warn("Duplicate quest. "); 
            return false; 
        } 
        _quests.put(questId, questState);
        return true; 
    } 
 
    public boolean removeQuest(int questId) {
        if (_quests.containsKey(questId)) {
            _quests.remove(questId);
            return true; 
        } 
        return false; 
    } 
Connect your IDE to all the code out there  Get Codota for Java