public final class StyleCache extends java.lang.Object
This object is immutable.
Modifier and Type | Field and Description |
---|---|
static StyleCache |
EMPTY_STYLECACHE
An empty style cache entry
|
private static Storage<StyleCache> |
internPool |
private static int |
PLAIN |
private static int |
SELECTED |
private DividedScale<StyleElementList>[] |
states |
Modifier | Constructor and Description |
---|---|
private |
StyleCache() |
private |
StyleCache(StyleCache sc) |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
clearStyleCachePool()
Clears the style cache.
|
boolean |
equals(java.lang.Object obj) |
private static int |
getIndex(boolean selected) |
static int |
getInternPoolSize()
Get the size of the intern pool.
|
Pair<StyleElementList,Range> |
getWithRange(double scale,
boolean selected)
Get the style for a specific style.
|
int |
hashCode() |
private StyleCache |
intern()
Like String.intern() (reduce memory consumption).
|
StyleCache |
put(StyleElementList o,
Range r,
boolean selected)
Creates a new copy of this style cache with a new entry added.
|
java.lang.String |
toString() |
private static final Storage<StyleCache> internPool
public static final StyleCache EMPTY_STYLECACHE
private static final int PLAIN
private static final int SELECTED
private final DividedScale<StyleElementList>[] states
private StyleCache(StyleCache sc)
private StyleCache()
public StyleCache put(StyleElementList o, Range r, boolean selected)
o
- The style to cache.r
- The range the style is for.selected
- The style list we should use (selected/unselected)public Pair<StyleElementList,Range> getWithRange(double scale, boolean selected)
scale
- The current scaleselected
- true to get the state for a selected element,private static int getIndex(boolean selected)
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
private StyleCache intern()
static void clearStyleCachePool()
public static int getInternPoolSize()