Interface CSSValueList<E extends CSSValue>

Type Parameters:
E - the value type.
All Superinterfaces:
Cloneable, CSSValue, Iterable<E>
All Known Implementing Classes:
LinkedCSSValueList, ValueList

public interface CSSValueList<E extends CSSValue> extends CSSValue, Iterable<E>
Based on W3C's CSSValueList interface.
  • Method Details

    • getLength

      int getLength()
      The number of values in this list.
      Returns:
      the number of items in this list.
    • add

      boolean add(E value)
      Adds a value to the end of this list.
      Parameters:
      value - the value to be added.
      Returns:
      true (for consistency with Java collections).
    • clear

      void clear()
      Removes all the items from this list.
    • isEmpty

      boolean isEmpty()
      Is this list empty ?
      Returns:
      true if this list has no items, false otherwise.
    • item

      E item(int index)
      Retrieve a CSSValue by ordinal index.
      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.
    • remove

      E remove(int index)
      Removes the value at the specified index.
      Parameters:
      index - the index of the value to be removed.
      Returns:
      the list item that was removed.
      Throws:
      IndexOutOfBoundsException - if the index is invalid.
    • set

      E set(int index, E value)
      Replaces the value at the specified index with the supplied value.
      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.
    • clone

      CSSValueList<E> clone()
      Creates and returns a copy of this object.

      The list is cloned, but its contents are not.

      Specified by:
      clone in interface CSSValue
      Returns:
      a clone of this instance.
    • getCssValueType

      default CSSValue.CssType getCssValueType()
      Description copied from interface: CSSValue
      Get the general category to which this value belongs.
      Specified by:
      getCssValueType in interface CSSValue
      Returns:
      the general value type.
    • getPrimitiveType

      default CSSValue.Type getPrimitiveType()
      Description copied from interface: CSSValue
      Get the primitive type.
      Specified by:
      getPrimitiveType in interface CSSValue
      Returns:
      the primitive type.