public abstract class GenericRecycleBin extends Thread implements Map<Object,Object>, RecycleBin
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
protected Vector<Object> |
active |
protected Map<Object,Object> |
map |
protected int |
MAXITEMS |
protected Stack<Recyclable> |
spares |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
GenericRecycleBin() |
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(Object key,
Recyclable r)
add a Recyclable to the
bin
|
void |
addItem(Recyclable r)
add an item
|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
void |
empty()
empty the current contents of the bin
|
Set |
entrySet() |
boolean |
equals(Object o) |
Object |
get(Object key) |
List<Object> |
getAll()
get all of the items in this bin
|
Recyclable |
getItem()
returns a new or recycled item from the spares pool
|
Map |
getMap() |
int |
getMaxItems() |
int |
getNumItems()
returns number of items in cache
|
int |
getSpareCount() |
int |
hashCode() |
boolean |
isEmpty() |
Set<Object> |
keySet() |
Object |
put(Object arg0,
Object arg1) |
void |
putAll(Map<?,?> arg0) |
void |
recycle()
iterate all active items and try to recycle
|
Object |
remove(Object key) |
void |
setMap(HashMap _map) |
void |
setMaxItems(int i)
max number of items to be put in this bin.
|
int |
size() |
String |
toString() |
Collection<Object> |
values() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yieldfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllprotected Stack<Recyclable> spares
protected int MAXITEMS
public void addItem(Recyclable r) throws RecycleBinFullException
addItem in interface RecycleBinRecycleBinFullExceptionpublic int getNumItems()
public void addItem(Object key, Recyclable r) throws RecycleBinFullException
RecycleBinaddItem in interface RecycleBinRecycleBinFullExceptionpublic void recycle()
public void empty()
RecycleBinempty in interface RecycleBinpublic List<Object> getAll()
RecycleBingetAll in interface RecycleBinpublic Recyclable getItem() throws RecycleBinFullException
getItem in interface RecycleBinRecycleBinFullExceptionRecycleBin.getItem()public void setMaxItems(int i)
setMaxItems in interface RecycleBinpublic int getMaxItems()
public int getSpareCount()
public boolean containsKey(Object key)
containsKey in interface Map<Object,Object>public boolean containsValue(Object value)
containsValue in interface Map<Object,Object>public boolean equals(Object o)
public int hashCode()
public Map getMap()
public void setMap(HashMap _map)
Copyright © 2002–2019 Starter Inc.. All rights reserved.