/** * Return the keys in this cache. * <p> * @see org.apache.commons.jcs.auxiliary.AuxiliaryCache#getKeySet() */ @Override public Set<K> getKeySet() throws IOException { HashSet<K> allKeys = new HashSet<K>(); for ( int i = 0; i < noWaits.length; i++ ) { AuxiliaryCache<K, V> aux = noWaits[i]; if ( aux != null ) { Set<K> keys = aux.getKeySet(); if(keys != null) { allKeys.addAll( keys ); } } } return allKeys; }
/** * Return the keys in this cache. * <p> * @see org.apache.commons.jcs.auxiliary.AuxiliaryCache#getKeySet() */ @Override public Set<K> getKeySet() throws IOException { HashSet<K> allKeys = new HashSet<K>(); for ( int i = 0; i < noWaits.length; i++ ) { AuxiliaryCache<K, V> aux = noWaits[i]; if ( aux != null ) { Set<K> keys = aux.getKeySet(); if(keys != null) { allKeys.addAll( keys ); } } } return allKeys; }
/** * Return the keys in this cache. * <p> * @see org.apache.commons.jcs.auxiliary.AuxiliaryCache#getKeySet() */ @Override public Set<K> getKeySet() throws IOException { HashSet<K> allKeys = new HashSet<K>(); for ( int i = 0; i < noWaits.length; i++ ) { AuxiliaryCache<K, V> aux = noWaits[i]; if ( aux != null ) { Set<K> keys = aux.getKeySet(); if(keys != null) { allKeys.addAll( keys ); } } } return allKeys; }
allKeys.addAll( aux.getKeySet() );
/** * Get a set of the keys for all elements in the cache * <p> * @param localOnly true if only memory keys are requested * * @return A set of the key type */ public Set<K> getKeySet(boolean localOnly) { HashSet<K> allKeys = new HashSet<K>(); allKeys.addAll( memCache.getKeySet() ); for ( AuxiliaryCache<K, V> aux : auxCaches ) { if ( aux != null ) { if(!localOnly || aux.getCacheType() == CacheType.DISK_CACHE) { try { allKeys.addAll( aux.getKeySet() ); } catch ( IOException e ) { // ignore } } } } return allKeys; }