1 21 22 package org.apache.derbyTesting.unitTests.services; 23 24 import org.apache.derby.iapi.services.cache.*; 25 26 import org.apache.derby.iapi.error.StandardException; 27 28 31 public class T_CachedInteger extends T_Cacheable { 32 33 protected T_Key keyValue; 34 35 public T_CachedInteger() { 36 } 37 38 41 42 43 46 public Cacheable setIdentity(Object key) throws StandardException { 47 48 super.setIdentity(key); 49 50 T_Key tkey = (T_Key) key; 52 if (!(tkey.getValue() instanceof Integer )) { 53 54 return getCorrectObject(tkey.getValue()).setIdentity(key); 55 } 56 57 if (!dummySet(tkey)) 59 return null; 60 keyValue = tkey; 61 62 return this; 63 } 64 65 68 public Cacheable createIdentity(Object key, Object createParameter) throws StandardException { 69 super.createIdentity(key, createParameter); 70 71 T_Key tkey = (T_Key) key; 73 if (!(tkey.getValue() instanceof Integer )) { 74 75 return getCorrectObject(tkey.getValue()).createIdentity(key, createParameter); 76 } 77 78 79 if (!dummySet(tkey)) 81 return null; 82 83 keyValue = tkey; 84 85 return this; 86 } 87 88 89 90 97 public void clearIdentity() { 98 keyValue = null; 99 } 100 101 107 public Object getIdentity() { 108 return keyValue; 109 } 110 111 114 public void clean(boolean forRemove) throws StandardException { 115 super.clean(forRemove); 116 } 117 } 118 119 | Popular Tags |