public class CacheSimulator
extends java.lang.Object
Constructor and Description |
---|
CacheSimulator()
Construct a cache simulator.
|
CacheSimulator(int cacheSize)
Construct a cache simulator with a specified capacity
|
Modifier and Type | Method and Description |
---|---|
void |
makeReport(java.io.Writer wtr)
Produce a report to the specified Writer about the state of the cache
after running the simulation.
|
void |
simulate(java.io.Reader rdr)
Simulate caching a stream of URL's provided on
the given Reader.
|
public CacheSimulator()
public CacheSimulator(int cacheSize)
cacheSize
- the desired maximum size of the cachepublic void simulate(java.io.Reader rdr)
rdr
- a Reader from which to read a stream of URL's,
one per line (may include leading or trailing blanks)public void makeReport(java.io.Writer wtr)
wtr
- a Writer to which to display the output.simulate()
has been called.