Package org.htmlunit.html
Class HtmlPage.ComputedStylesCache
- java.lang.Object
-
- org.htmlunit.html.HtmlPage.ComputedStylesCache
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- HtmlPage
private static final class HtmlPage.ComputedStylesCache extends java.lang.Object implements java.io.SerializableCache computed styles when possible, because their calculation is very expensive. We use a weak hash map because we don't want this cache to be the only reason nodes are kept around in the JVM, if all other references to them are gone.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.WeakHashMap<DomElement,java.util.Map<java.lang.String,ComputedCssStyleDeclaration>>computedStyles_
-
Constructor Summary
Constructors Constructor Description ComputedStylesCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()ComputedCssStyleDeclarationget(DomElement element, java.lang.String normalizedPseudo)voidnodeChanged(DomNode changed, boolean clearParents)voidput(DomElement element, java.lang.String normalizedPseudo, ComputedCssStyleDeclaration style)private voidreadObject(java.io.ObjectInputStream in)java.util.Map<java.lang.String,ComputedCssStyleDeclaration>remove(DomNode element)
-
-
-
Field Detail
-
computedStyles_
private transient java.util.WeakHashMap<DomElement,java.util.Map<java.lang.String,ComputedCssStyleDeclaration>> computedStyles_
-
-
Method Detail
-
get
public ComputedCssStyleDeclaration get(DomElement element, java.lang.String normalizedPseudo)
-
put
public void put(DomElement element, java.lang.String normalizedPseudo, ComputedCssStyleDeclaration style)
-
nodeChanged
public void nodeChanged(DomNode changed, boolean clearParents)
-
clear
public void clear()
-
remove
public java.util.Map<java.lang.String,ComputedCssStyleDeclaration> remove(DomNode element)
-
readObject
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
-