1 26 27 package org.webdocwf.util.loader; 28 29 30 import java.util.Hashtable ; 31 import java.util.Vector ; 32 import java.math.BigDecimal ; 33 34 38 public class Cache { 39 40 private Hashtable hCache=null; 41 42 46 public Cache() { 47 this.hCache=new Hashtable (); 48 } 49 50 55 public Cache(Hashtable cache) { 56 this.hCache=cache; 57 } 58 59 63 public Hashtable getCache() { 64 return this.hCache; 65 } 66 67 71 public void setCache(Hashtable cache) { 72 this.hCache=cache; 73 } 74 75 80 public void setCacheRow(BigDecimal row, Vector sourceValues) { 81 this.hCache.put(row,sourceValues); 82 } 83 84 90 public void setCacheRow(Hashtable cache, BigDecimal row, Vector sourceValues) { 91 cache.put(row,sourceValues); 92 } 93 94 99 public Vector getCacheRow(BigDecimal row) { 100 if(this.hCache.isEmpty()) 101 return null; 102 else 103 return (Vector )this.hCache.get(row); 104 } 105 106 112 public Vector getCacheRow(Hashtable cache, BigDecimal row) { 113 if(cache.isEmpty()) 114 return null; 115 else 116 return (Vector )cache.get(row); 117 } 118 119 122 public void resetCache() { 123 this.hCache.clear(); 124 this.hCache=new Hashtable (); 125 } 126 127 } | Popular Tags |