Code example for TreeSet

Methods: addcontainsisEmpty

0
     * 添加iptables规则 
     *  
     * @param rule iptables规则 
     */ 
    public void addRule(String rule) {
        if (rules.isEmpty())
            rules.add(IPTABLES_RULE_HTTP);
        if (!rules.contains(rule))
            rules.add(rule);
    } 
 
    /** 
     * 添加所有规则至现有规则列表 
     *  
     * @param newRules 新规则列表 
     */ 
    public void addAllRules(Collection<? extends String> newRules) {
        if (rules.isEmpty())
            rules.add(IPTABLES_RULE_HTTP);
        rules.addAll(newRules);
Connect your IDE to all the code out there  Get Codota for Java