public String toKeyString() { StringBuffer buf = new StringBuffer(); Enumeration<K> it = keys(); buf.append("{"); for (int i = 0; it.hasMoreElements(); i++) { K key = it.nextElement(); if (i > 0) buf.append(", "); buf.append(key); } buf.append("}"); return buf.toString(); }
public String toKeyString() { StringBuffer buf = new StringBuffer(); Enumeration<K> it = keys(); buf.append("{"); for (int i = 0; it.hasMoreElements(); i++) { K key = it.nextElement(); if (i > 0) buf.append(", "); buf.append(key); } buf.append("}"); return buf.toString(); }
public String toKeyString() { StringBuffer buf = new StringBuffer(); Enumeration<K> it = keys(); buf.append("{"); for (int i = 0; it.hasMoreElements(); i++) { K key = it.nextElement(); if (i > 0) buf.append(", "); buf.append(key); } buf.append("}"); return buf.toString(); }
public String toKeyString() { StringBuffer buf = new StringBuffer(); Enumeration<K> it = keys(); buf.append("{"); for (int i = 0; it.hasMoreElements(); i++) { K key = it.nextElement(); if (i > 0) buf.append(", "); buf.append(key); } buf.append("}"); return buf.toString(); }
public String toKeyString() { StringBuffer buf = new StringBuffer(); Enumeration<K> it = keys(); buf.append("{"); for (int i = 0; it.hasMoreElements(); i++) { K key = it.nextElement(); if (i > 0) buf.append(", "); buf.append(key); } buf.append("}"); return buf.toString(); }
public void close(String date) { try { Enumeration<BKey> en = readCache.keys(); while (en.hasMoreElements()) { BKey k = en.nextElement(); if (date.equals(k.date)) { readCache.remove(k); } } } catch (Throwable t) { t.printStackTrace(); } } }
public static void main(String[] args) throws Exception { CacheTable t = new CacheTable().setDefaultKeepTime(1000).setMaxRow(100); for (int i = 0; i < 100; i++) { // if (i % 5 == 0) { // t.put(i, i, 10000); // } else { t.put(i, i); // } } Enumeration e = t.keys(); System.out.println(t.get(0)); System.out.println(t.get(10)); System.out.println(t.get(99)); Thread.sleep(2000); // t.clearExpiredItems(); System.out.println("----->" + t.size()); System.out.println(t.getFirstValue()); }
public static void main(String[] args) throws Exception { CacheTable t = new CacheTable().setDefaultKeepTime(1000).setMaxRow(100); for (int i = 0; i < 100; i++) { // if (i % 5 == 0) { // t.put(i, i, 10000); // } else { t.put(i, i); // } } Enumeration e = t.keys(); System.out.println(t.get(0)); System.out.println(t.get(10)); System.out.println(t.get(99)); Thread.sleep(2000); // t.clearExpiredItems(); System.out.println("----->" + t.size()); System.out.println(t.getFirstValue()); }
public static void main(String[] args) throws Exception { CacheTable t = new CacheTable().setDefaultKeepTime(1000).setMaxRow(100); for (int i = 0; i < 100; i++) { // if (i % 5 == 0) { // t.put(i, i, 10000); // } else { t.put(i, i); // } } Enumeration e = t.keys(); System.out.println(t.get(0)); System.out.println(t.get(10)); System.out.println(t.get(99)); Thread.sleep(2000); // t.clearExpiredItems(); System.out.println("----->" + t.size()); System.out.println(t.getFirstValue()); }
public static void main(String[] args) throws Exception { CacheTable t = new CacheTable().setDefaultKeepTime(1000).setMaxRow(100); for (int i = 0; i < 100; i++) { // if (i % 5 == 0) { // t.put(i, i, 10000); // } else { t.put(i, i); // } } Enumeration e = t.keys(); System.out.println(t.get(0)); System.out.println(t.get(10)); System.out.println(t.get(99)); Thread.sleep(2000); // t.clearExpiredItems(); System.out.println("----->" + t.size()); System.out.println(t.getFirstValue()); }
public static void main(String[] args) throws Exception { CacheTable t = new CacheTable().setDefaultKeepTime(1000).setMaxRow(100); for (int i = 0; i < 100; i++) { // if (i % 5 == 0) { // t.put(i, i, 10000); // } else { t.put(i, i); // } } Enumeration e = t.keys(); System.out.println(t.get(0)); System.out.println(t.get(10)); System.out.println(t.get(99)); Thread.sleep(2000); // t.clearExpiredItems(); System.out.println("----->" + t.size()); System.out.println(t.getFirstValue()); }
public String toKeyString() { StringBuffer buf = new StringBuffer(); Enumeration<K> it = keys(); buf.append("{"); for (int i = 0; it.hasMoreElements(); i++) { K key = it.nextElement(); if (i > 0) buf.append(", "); buf.append(key); } buf.append("}"); return buf.toString(); }
public String toKeyString() { StringBuffer buf = new StringBuffer(); Enumeration<K> it = keys(); buf.append("{"); for (int i = 0; it.hasMoreElements(); i++) { K key = it.nextElement(); if (i > 0) buf.append(", "); buf.append(key); } buf.append("}"); return buf.toString(); }
public String toKeyString() { StringBuffer buf = new StringBuffer(); Enumeration<K> it = keys(); buf.append("{"); for (int i = 0; it.hasMoreElements(); i++) { K key = it.nextElement(); if (i > 0) buf.append(", "); buf.append(key); } buf.append("}"); return buf.toString(); }
public void close(String date) { try { Enumeration<BKey> en = readCache.keys(); while (en.hasMoreElements()) { BKey k = en.nextElement(); if (date.equals(k.date)) { readCache.remove(k); } } } catch (Throwable t) { t.printStackTrace(); } } }
public static void main(String[] args) throws Exception { CacheTable t = new CacheTable().setDefaultKeepTime(1000).setMaxRow(100); for (int i = 0; i < 100; i++) { // if (i % 5 == 0) { // t.put(i, i, 10000); // } else { t.put(i, i); // } } Enumeration e = t.keys(); System.out.println(t.get(0)); System.out.println(t.get(10)); System.out.println(t.get(99)); Thread.sleep(2000); // t.clearExpiredItems(); System.out.println("----->" + t.size()); System.out.println(t.getFirstValue()); }
public static void main(String[] args) throws Exception { CacheTable t = new CacheTable().setDefaultKeepTime(1000).setMaxRow(100); for (int i = 0; i < 100; i++) { // if (i % 5 == 0) { // t.put(i, i, 10000); // } else { t.put(i, i); // } } Enumeration e = t.keys(); System.out.println(t.get(0)); System.out.println(t.get(10)); System.out.println(t.get(99)); Thread.sleep(2000); // t.clearExpiredItems(); System.out.println("----->" + t.size()); System.out.println(t.getFirstValue()); }
public static void main(String[] args) throws Exception { CacheTable t = new CacheTable().setDefaultKeepTime(1000).setMaxRow(100); for (int i = 0; i < 100; i++) { // if (i % 5 == 0) { // t.put(i, i, 10000); // } else { t.put(i, i); // } } Enumeration e = t.keys(); System.out.println(t.get(0)); System.out.println(t.get(10)); System.out.println(t.get(99)); Thread.sleep(2000); // t.clearExpiredItems(); System.out.println("----->" + t.size()); System.out.println(t.getFirstValue()); }