|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.mappaint.StyleCache
public class StyleCache
Caches styles for a single primitive. Splits the range of possible scale values (0 < scale < +Infinity) into multiple subranges, for each scale range it keeps a list of styles. Immutable class, equals & hashCode is required (the same for StyleList, ElemStyle and its subclasses).
Nested Class Summary | |
---|---|
static class |
StyleCache.StyleList
List of Styles, immutable |
Field Summary | |
---|---|
(package private) java.util.ArrayList<java.lang.Double> |
bd
|
(package private) java.util.ArrayList<StyleCache.StyleList> |
data
|
static StyleCache |
EMPTY_STYLECACHE
|
private static Storage<StyleCache> |
internPool
|
Constructor Summary | |
---|---|
private |
StyleCache()
|
private |
StyleCache(StyleCache s)
|
Method Summary | |
---|---|
void |
consistencyTest()
|
boolean |
equals(java.lang.Object obj)
|
StyleCache.StyleList |
get(double scale)
looks up styles for a certain scale value |
Pair<StyleCache.StyleList,Range> |
getWithRange(double scale)
looks up styles for a certain scale value and additionally returns the scale range for the returned styles |
int |
hashCode()
|
StyleCache |
intern()
Like String.intern() (reduce memory consumption). |
StyleCache |
put(StyleCache.StyleList sl,
double lower,
double upper)
add a new styles to the cache. |
StyleCache |
put(StyleCache.StyleList sl,
Range r)
|
private void |
putImpl(StyleCache.StyleList sl,
double lower,
double upper)
ASCII-art explanation: data[i] --|-------|---------|-- bd[i-1] bd[i] bd[i+1] (--------] lower upper |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
java.util.ArrayList<java.lang.Double> bd
java.util.ArrayList<StyleCache.StyleList> data
private static final Storage<StyleCache> internPool
public static final StyleCache EMPTY_STYLECACHE
Constructor Detail |
---|
private StyleCache()
private StyleCache(StyleCache s)
Method Detail |
---|
public StyleCache.StyleList get(double scale)
public Pair<StyleCache.StyleList,Range> getWithRange(double scale)
public StyleCache put(StyleCache.StyleList sl, Range r)
public StyleCache put(StyleCache.StyleList sl, double lower, double upper)
private void putImpl(StyleCache.StyleList sl, double lower, double upper)
public void consistencyTest()
public StyleCache intern()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |