Class ValueList

java.lang.Object
io.sf.carte.doc.style.css.property.StyleValue
io.sf.carte.doc.style.css.property.ValueList
All Implemented Interfaces:
ExtendedCSSValue, ExtendedCSSValueList<StyleValue>, Cloneable, Iterable<StyleValue>, CSSValue, CSSValueList

public abstract class ValueList extends StyleValue implements ExtendedCSSValueList<StyleValue>
Implementation of CSSValueList.
  • Field Details

  • Method Details

    • getLength

      public int getLength()
      Specified by:
      getLength in interface CSSValueList
    • item

      public StyleValue item(int index)
      Description copied from interface: ExtendedCSSValueList
      retrieve an ExtendedCSSValue by ordinal index.
      Specified by:
      item in interface CSSValueList
      Specified by:
      item in interface ExtendedCSSValueList<StyleValue>
      Parameters:
      index - the index in this list.
      Returns:
      the value at index, or null if index is less than zero, or greater or equal to the list length.
    • iterator

      public Iterator<StyleValue> iterator()
      Specified by:
      iterator in interface Iterable<StyleValue>
    • add

      public boolean add(StyleValue value)
      Adds a value to the end of this list.
      Specified by:
      add in interface ExtendedCSSValueList<StyleValue>
      Parameters:
      value - the value to be added.
      Returns:
      true
    • addAll

      public boolean addAll(ValueList list)
      Appends all of the elements in the given list to the end of this list.

      The appended list must be of the same type as this list.

      Parameters:
      list - the list to add.
      Returns:
      true if this list changed as a result of the call.
    • remove

      public StyleValue remove(int index)
      Removes the value at the specified index.
      Specified by:
      remove in interface ExtendedCSSValueList<StyleValue>
      Parameters:
      index - the index of the value to be removed.
      Returns:
      the list item that was removed.
    • set

      public StyleValue set(int index, StyleValue value)
      Replaces the value at the specified index with the supplied value.
      Specified by:
      set in interface ExtendedCSSValueList<StyleValue>
      Parameters:
      index - the index of the value to be replaced.
      value - the value to replace the item at index.
      Returns:
      the item previously at the specified position.
      Throws:
      IndexOutOfBoundsException - if the index is invalid.
      NullPointerException - if the value is null.
    • isEmpty

      public boolean isEmpty()
      Is this list empty ?
      Specified by:
      isEmpty in interface ExtendedCSSValueList<StyleValue>
      Returns:
      true if this list has no items, false otherwise.
    • clear

      public void clear()
      Removes all the items from this list.
      Specified by:
      clear in interface ExtendedCSSValueList<StyleValue>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class StyleValue
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class StyleValue
    • setSubproperty

      public void setSubproperty(boolean subp)
    • isSubproperty

      public boolean isSubproperty()
      Description copied from class: StyleValue
      Is this a subproperty that has been set by a shorthand?
      Overrides:
      isSubproperty in class StyleValue
      Returns:
      true if this a subproperty that has been set by a shorthand, false otherwise.
    • setCssText

      public void setCssText(String cssText) throws DOMException
      Description copied from class: StyleValue
      Attempts to change this value to match the supplied css text.

      In css4j, it is not recommended to set property values using this method.

      Specified by:
      setCssText in interface CSSValue
      Overrides:
      setCssText in class StyleValue
      Throws:
      DOMException - SYNTAX_ERR: Raised if the specified CSS string value has a syntax error (according to the attached property) or is unparsable.
      INVALID_MODIFICATION_ERR: Raised if the specified CSS string value represents a different type of values than the values allowed by the CSS property.
      NO_MODIFICATION_ALLOWED_ERR: Raised if this value is read-only.
    • isCommaSeparated

      public abstract boolean isCommaSeparated()
    • isBracketList

      public boolean isBracketList()
    • clone

      public abstract ValueList clone()
      Creates and returns a copy of this object.

      The list is cloned, but its contents are not.

      Specified by:
      clone in interface ExtendedCSSValue
      Specified by:
      clone in interface ExtendedCSSValueList<StyleValue>
      Specified by:
      clone in class StyleValue
      Returns:
      a clone of this instance.
    • createCSValueList

      public static ValueList createCSValueList()
    • createWSValueList

      public static ValueList createWSValueList()
    • createBracketValueList

      public static ValueList createBracketValueList()
    • wrap

      public abstract ValueList wrap(String oldHrefContext, String parentSheetHref)