1 16 17 package org.apache.cocoon.transformation.pagination; 18 19 import java.util.ArrayList ; 20 import java.util.List ; 21 22 29 public class PageRules { 30 31 public String elementName; 32 public String elementURI; 33 public int elementCount = 0; 34 public int charCount = 0; 35 public int unitLinks = 0; 36 private List rangeLinks = new ArrayList (); 37 38 public boolean match(String element, String namespace) { 39 boolean elementMatches = ((this.elementName!=null) && 40 this.elementName.equals(element)); 41 42 if (this.elementURI==null) { 43 return elementMatches; 44 } else { 45 return elementMatches && this.elementURI.equals(namespace); 46 } 47 } 48 49 public boolean match(String namespace) { 50 return ((this.elementURI!=null) && 51 (this.elementURI.equals(namespace))); 52 } 53 54 public Integer [] getRangeLinks() { 55 return (Integer []) this.rangeLinks.toArray(new Integer [this.rangeLinks.size()]); 56 } 57 58 public void addRangeLink(Integer rangeLink) { 59 this.rangeLinks.add(rangeLink); 60 } 61 62 public void addRangeLink(int rangeLink) { 63 this.addRangeLink(new Integer (rangeLink)); 64 } 65 66 public void addRangeLink(String rangeLink) { 67 this.addRangeLink(new Integer (rangeLink)); 68 } 69 } 70 | Popular Tags |