Code example for SortedMap

Methods: containsKey, remove

0
        _quests.put(questId, questState);
        return true; 
    } 
 
    public boolean removeQuest(int questId) {
        if (_quests.containsKey(questId)) {
            _quests.remove(questId);
            return true; 
        } 
        return false; 
    } 
 
    public QuestState getQuestState(int questId) {
        return _quests.get(questId);
    } 
 
    public Collection<QuestState> getAllQuestState() {
        return _quests.values();
    } 
}