1 28 29 package com.caucho.xsl; 30 31 import com.caucho.vfs.Path; 32 33 import org.w3c.dom.Document ; 34 35 import java.util.ArrayList ; 36 37 40 public class CacheableDocument { 41 private ArrayList depends; 42 private Document document; 43 44 CacheableDocument(Document document, ArrayList depends) 45 { 46 this.document = document; 47 this.depends = depends; 48 } 49 50 53 public Document getDocument() 54 { 55 return document; 56 } 57 58 61 public boolean isCacheable() 62 { 63 return depends != null; 64 } 65 66 69 public long getLastModified() 70 { 71 if (depends == null) 72 return 0; 73 74 long lastModified = 0; 75 for (int i = 0; i < depends.size(); i++) { 76 Path path = (Path) depends.get(i); 77 78 long time = path.getLastModified(); 79 if (time > lastModified) 80 lastModified = time; 81 } 82 83 return lastModified; 84 } 85 86 public ArrayList getCacheDepends() 87 { 88 return depends; 89 } 90 91 void addDepend(Path path) 92 { 93 if (depends != null) 94 depends.add(path); 95 } 96 } 97 98 99 | Popular Tags |