com.gargoylesoftware.htmlunit.javascript.host.css
Class CSSStyleDeclaration.StyleElement

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleDeclaration.StyleElement
All Implemented Interfaces:
Comparable<CSSStyleDeclaration.StyleElement>
Enclosing class:
CSSStyleDeclaration

protected static class CSSStyleDeclaration.StyleElement
extends Object
implements Comparable<CSSStyleDeclaration.StyleElement>

Contains information about a single style element, including its name, its value, and an index which can be compared against other indices in order to determine precedence.


Constructor Summary
protected CSSStyleDeclaration.StyleElement(String name, String value)
          Creates a new default instance.
protected CSSStyleDeclaration.StyleElement(String name, String value, long index)
          Creates a new instance.
protected CSSStyleDeclaration.StyleElement(String name, String value, String priority, com.gargoylesoftware.htmlunit.javascript.host.css.SelectorSpecificity specificity, long index)
          Creates a new instance.
 
Method Summary
 int compareTo(CSSStyleDeclaration.StyleElement e)
          
 long getIndex()
          Returns the style element's index.
 String getName()
          Returns the style element's name.
 String getPriority()
          Returns the style element's priority.
 com.gargoylesoftware.htmlunit.javascript.host.css.SelectorSpecificity getSpecificity()
          Returns the specificity of the rule specifying this element.
 String getValue()
          Returns the style element's value.
 boolean isDefault()
          Returns true if this style element contains a default value.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CSSStyleDeclaration.StyleElement

protected CSSStyleDeclaration.StyleElement(String name,
                                           String value,
                                           String priority,
                                           com.gargoylesoftware.htmlunit.javascript.host.css.SelectorSpecificity specificity,
                                           long index)
Creates a new instance.

Parameters:
name - the style element's name
value - the style element's value
priority - the style element's priority like "important"
specificity - the specificity of the rule providing this style information
index - the style element's index

CSSStyleDeclaration.StyleElement

protected CSSStyleDeclaration.StyleElement(String name,
                                           String value,
                                           long index)
Creates a new instance.

Parameters:
name - the style element's name
value - the style element's value
index - the style element's index

CSSStyleDeclaration.StyleElement

protected CSSStyleDeclaration.StyleElement(String name,
                                           String value)
Creates a new default instance.

Parameters:
name - the style element's name
value - the style element's value
Method Detail

getName

public String getName()
Returns the style element's name.

Returns:
the style element's name

getValue

public String getValue()
Returns the style element's value.

Returns:
the style element's value

getPriority

public String getPriority()
Returns the style element's priority.

Returns:
the style element's priority

getSpecificity

public com.gargoylesoftware.htmlunit.javascript.host.css.SelectorSpecificity getSpecificity()
Returns the specificity of the rule specifying this element.

Returns:
the specificity

getIndex

public long getIndex()
Returns the style element's index.

Returns:
the style element's index

isDefault

public boolean isDefault()
Returns true if this style element contains a default value. This method isn't currently used anywhere because default style elements are applied before non-default style elements, so the natural ordering results in correct precedence rules being applied (i.e. default style elements don't override non-default style elements) without the need for special checks.

Returns:
true if this style element contains a default value

toString

public String toString()

Overrides:
toString in class Object

compareTo

public int compareTo(CSSStyleDeclaration.StyleElement e)

Specified by:
compareTo in interface Comparable<CSSStyleDeclaration.StyleElement>


Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.