Code example for TreeSet

Methods: add, iterator

0
        if (this.idToString == null) {
            return null; 
        } 
 
        // put them in a treeset first to sort them 
        final TreeSet treeSet = new TreeSet(this.idToString.values());
        if (this.hasEmptyValue) {
            treeSet.add("");
        } 
        return treeSet.iterator();
    } 
 
    public String toString() {
        if (this.value == null) {
            return ""; 
        } else if (this.idToString.get(this.value) == null) {
            return ""; 
        } else { 
            return this.idToString.get(this.value).toString();
        } 
    }