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>
Implementation of ValueList.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.sf.carte.doc.style.css.CSSValue
CSSValue.CssType, CSSValue.Type
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(StyleValue value) Adds a value to the end of this list.boolean
Appends all of the elements in the given list to the end of this list.void
clear()
Removes all the items from this list.abstract ValueList
clone()
Creates and returns a copy of this object.static ValueList
static ValueList
static ValueList
boolean
int
The number of values in this list.int
hashCode()
boolean
Is this a bracket list?abstract boolean
boolean
isEmpty()
Is this list empty ?boolean
Is this a subproperty that has been set by a shorthand?item
(int index) Retrieve aCSSValue
by ordinal index.iterator()
matches
(CSSValueSyntax syntax) Verify if this value matches the given grammar.remove
(int index) Removes the value at the specified index.set
(int index, StyleValue value) Replaces the value at the specified index with the supplied value.void
setCssText
(String cssText) Attempts to change this value to match the supplied css text.void
setSubproperty
(boolean subp) abstract ValueList
Methods inherited from class io.sf.carte.doc.style.css.property.StyleValue
getCssText, getMinifiedCssText, isPrimitiveValue, isSystemDefault, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.sf.carte.doc.style.css.CSSValue
getCssText, getMinifiedCssText, writeCssText
Methods inherited from interface io.sf.carte.doc.style.css.CSSValueList
getCssValueType, getPrimitiveType
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
valueList
-
-
Method Details
-
getLength
public int getLength()Description copied from interface:CSSValueList
The number of values in this list.- Specified by:
getLength
in interfaceCSSValueList<StyleValue>
- Returns:
- the number of items in this list.
-
item
Description copied from interface:CSSValueList
Retrieve aCSSValue
by ordinal index.- Specified by:
item
in interfaceCSSValueList<StyleValue>
- Parameters:
index
- the index in this list.- Returns:
- the value at
index
, ornull
ifindex
is less than zero, or greater or equal to the list length.
-
iterator
- Specified by:
iterator
in interfaceIterable<StyleValue>
-
add
Adds a value to the end of this list.- Specified by:
add
in interfaceCSSValueList<StyleValue>
- Parameters:
value
- the value to be added.- Returns:
- true
-
addAll
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
Removes the value at the specified index.- Specified by:
remove
in interfaceCSSValueList<StyleValue>
- Parameters:
index
- the index of the value to be removed.- Returns:
- the list item that was removed.
-
set
Replaces the value at the specified index with the supplied value.- Specified by:
set
in interfaceCSSValueList<StyleValue>
- Parameters:
index
- the index of the value to be replaced.value
- the value to replace the item atindex
.- Returns:
- the item previously at the specified position.
- Throws:
IndexOutOfBoundsException
- if the index is invalid.NullPointerException
- if the value isnull
.
-
isEmpty
public boolean isEmpty()Is this list empty ?- Specified by:
isEmpty
in interfaceCSSValueList<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 interfaceCSSValueList<StyleValue>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classStyleValue
-
equals
- Overrides:
equals
in classStyleValue
-
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 classStyleValue
- Returns:
true
if this a subproperty that has been set by a shorthand,false
otherwise.
-
setCssText
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 interfaceCSSValue
- Overrides:
setCssText
in classStyleValue
- 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
Description copied from class:StyleValue
Verify if this value matches the given grammar.- Specified by:
matches
in interfaceCSSValue
- Overrides:
matches
in classStyleValue
- Parameters:
syntax
- the syntax.- Returns:
- the matching for the syntax.
-
clone
Creates and returns a copy of this object.The list is cloned, but its contents are not.
- Specified by:
clone
in interfaceCSSValue
- Specified by:
clone
in interfaceCSSValueList<StyleValue>
- Specified by:
clone
in classStyleValue
- Returns:
- a clone of this instance.
-
createCSValueList
-
createWSValueList
-
createBracketValueList
-
wrap
-