org.apache.batik.css
Class AbstractViewCSS.ComputedStyleCache

java.lang.Object
  |
  +--org.apache.batik.css.AbstractViewCSS.ComputedStyleCache
Enclosing class:
AbstractViewCSS

protected static class AbstractViewCSS.ComputedStyleCache
extends java.lang.Object

To cache the computed styles.


Inner Class Summary
protected static class AbstractViewCSS.ComputedStyleCache.Entry
          To manage collisions in the table.
protected static class AbstractViewCSS.ComputedStyleCache.StrongReference
          To store computed style with a strong reference.
 
Field Summary
protected  int count
          The number of entries
protected  AbstractViewCSS.ComputedStyleCache.Entry[] table
          The table used to store the style.
 
Constructor Summary
AbstractViewCSS.ComputedStyleCache()
          Creates a new ComputedStyleCache.
 
Method Summary
 void dispose()
          Removes the permanently cached style declarations.
 CSSOMReadOnlyStyleDeclaration get(Element elt, java.lang.String pe)
          Returns the computed style mapped with the given element and pseudo-element, if any.
protected  int hashCode(Element e, java.lang.String pe)
          Computes a hash code for the given element and pseudo-element.
 void put(Element elt, java.lang.String pe, CSSOMReadOnlyStyleDeclaration sd)
          Caches the given computed style.
 void putPermanent(Element elt, java.lang.String pe, CSSOMReadOnlyStyleDeclaration sd)
          Caches the given computed style without possibility of collection.
protected  void rehash()
          Rehash the table
protected  void update()
          Updates the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected AbstractViewCSS.ComputedStyleCache.Entry[] table
The table used to store the style.

count

protected int count
The number of entries
Constructor Detail

AbstractViewCSS.ComputedStyleCache

public AbstractViewCSS.ComputedStyleCache()
Creates a new ComputedStyleCache.
Method Detail

put

public void put(Element elt,
                java.lang.String pe,
                CSSOMReadOnlyStyleDeclaration sd)
Caches the given computed style.

putPermanent

public void putPermanent(Element elt,
                         java.lang.String pe,
                         CSSOMReadOnlyStyleDeclaration sd)
Caches the given computed style without possibility of collection.

get

public CSSOMReadOnlyStyleDeclaration get(Element elt,
                                         java.lang.String pe)
Returns the computed style mapped with the given element and pseudo-element, if any.

rehash

protected void rehash()
Rehash the table

update

protected void update()
Updates the table.

dispose

public void dispose()
Removes the permanently cached style declarations.

hashCode

protected int hashCode(Element e,
                       java.lang.String pe)
Computes a hash code for the given element and pseudo-element.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.