|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectabsurdist.LinkSimCacheArray
LinkSimCache implemented as a rectangular array. Only rows and columns representing actual non-empty links, plus the EMPTY constant, are stored; this is designed to save on the overhead, as compared to LinkSimCacheHash. Access may not be as fast as with LinkSimCacheHash, though.
LinkSimCache,
LinkSimCacheHash| Constructor Summary | |
(package private) |
LinkSimCacheArray()
|
| Method Summary | |
double |
get(Link lo,
Link ln)
Retrieves the value representing Sim(lo,ln), or NaN if none was stored) |
double |
put(Link lo,
Link ln,
double val)
Stores the value representing Sim(lo,ln). |
void |
setSizes(int loCnt,
int lnCnt)
Allocates the arrays based on the sizes specified. |
int |
size()
Returns the number of values stored |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
LinkSimCacheArray()
| Method Detail |
public void setSizes(int loCnt,
int lnCnt)
setSizes in interface LinkSimCacheloCnt - How many distinct values for the first argument
to put() are expected.lnCnt - How many distinct values for the second argument
to put() are expected.
public double put(Link lo,
Link ln,
double val)
put in interface LinkSimCache
public double get(Link lo,
Link ln)
get in interface LinkSimCachepublic int size()
LinkSimCache
size in interface LinkSimCache
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||