public final class StyleCache extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StyleCache.RangeViolatedError |
static class |
StyleCache.StyleList
List of Styles, immutable
|
Modifier and Type | Field and Description |
---|---|
private List<Double> |
bd |
private List<StyleCache.StyleList> |
data |
static StyleCache |
EMPTY_STYLECACHE |
private static Storage<StyleCache> |
internPool |
Modifier | Constructor and Description |
---|---|
private |
StyleCache() |
private |
StyleCache(StyleCache s) |
Modifier and Type | Method and Description |
---|---|
void |
consistencyTest() |
boolean |
equals(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
|
String |
toString() |
private final List<StyleCache.StyleList> data
private static final Storage<StyleCache> internPool
public static final StyleCache EMPTY_STYLECACHE
private StyleCache()
private StyleCache(StyleCache s)
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()