Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*    */ package org.dom4j.rule;
 /*    */ 
 /*    */ import java.util.ArrayList;
 /*    */ import java.util.Collections;
 /*    */ import org.dom4j.Node;
 /*    */ 
 /*    */ public class RuleSet
 /*    */ {
 /* 28 */   private ArrayList rules = new ArrayList();
/*    */   private Rule[] ruleArray;
/*    */ 
/*    */   public String toString()
/*    */   {
/* 37 */     return super.toString() + " [RuleSet: " + this. + " ]";
/*    */   }
/*    */ 
/*    */   public Rule getMatchingRule(Node node)
/*    */   {
/* 50 */     Rule[] matches = getRuleArray();
/*    */ 
/* 52 */     for (int i = matches.length - 1; i >= 0; i--) {
/* 53 */       Rule rule = matches[i];
/*    */ 
/* 55 */       if (rule.matches(node)) {
/* 56 */         return rule;
/*    */       }
/*    */     }
/*    */ 
/* 60 */     return null;
/*    */   }
/*    */ 
/*    */   public void addRule(Rule rule) {
/* 64 */     this..add(rule);
/* 65 */     this. = null;
/*    */   }
/*    */ 
/*    */   public void removeRule(Rule rule) {
/* 69 */     this..remove(rule);
/* 70 */     this. = null;
/*    */   }
/*    */ 
/*    */   public void addAll(RuleSet that)
/*    */   {
/* 80 */     this..addAll(that.rules);
/* 81 */     this. = null;
/*    */   }
/*    */ 
/*    */   protected Rule[] getRuleArray()
/*    */   {
/* 91 */     if (this. == null) {
/* 92 */       Collections.sort(this.);
/*    */ 
/* 94 */       int size = this..size();
/* 95 */       this. = new Rule[size];
/* 96 */       this..toArray(this.);
/*    */     }
/*    */ 
/* 99 */     return this.;
/*    */   }
/*    */ }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/thirdparty-all.jar
 * Qualified Name:     org.dom4j.rule.RuleSet
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X