Code example for TreeSet

Methods: add, addAll, isEmpty

0
     * 添加所有规则至现有规则列表 
     *  
     * @param newRules 新规则列表 
     */ 
    public void addAllRules(Collection<? extends String> newRules) {
        if (rules.isEmpty())
            rules.add(IPTABLES_RULE_HTTP);
        rules.addAll(newRules);
    } 
 
    public void removeRule(String rule) {
        rules.remove(rule);
    } 
 
    public boolean isOnlyMobile() { 
        return onlyMobile;
    } 
 
    public void setOnlyMobile(boolean onlyMobile) {
        this.onlyMobile = onlyMobile;
    }