Class ValueList

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

public abstract class ValueList extends StyleValue implements CSSValueList<StyleValue>
Implementation of CSSValueList based on StyleValue.
See Also:
  • Field Details

  • Method Details

    • getLength

      public int getLength()
      Description copied from interface: CSSValueList
      The number of values in this list.
      Specified by:
      getLength in interface CSSValueList<StyleValue>
      Returns:
      the number of items in this list.
    • item

      public StyleValue item(int index)
      Description copied from interface: CSSValueList
      Retrieve a CSSValue by ordinal index.
      Specified by:
      item in interface CSSValueList<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 CSSValueList<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 CSSValueList<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 CSSValueList<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 CSSValueList<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 CSSValueList<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
      Parameters:
      cssText - the text value.
      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()
      Is this a bracket list?
      Returns:
      true if this is a bracket list.
    • matches

      public CSSValueSyntax.Match matches(CSSValueSyntax syntax)
      Description copied from class: StyleValue
      Verify if this value matches the given grammar.
      Specified by:
      matches in interface CSSValue
      Overrides:
      matches in class StyleValue
      Parameters:
      syntax - the syntax.
      Returns:
      the matching for the syntax.
    • 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 CSSValue
      Specified by:
      clone in interface CSSValueList<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)