public final class StyleCache extends java.lang.Object
This object is immutable.
| Modifier and Type | Field and Description |
|---|---|
static StyleCache |
EMPTY_STYLECACHE |
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 |
|---|---|
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) |
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.
|
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)
private static int getIndex(boolean selected)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectprivate StyleCache intern()
public static int getInternPoolSize()