Class LinkedCSSValueList
java.lang.Object
- All Implemented Interfaces:
CSSValue
,CSSValueList<StyleValue>
,Serializable
,Cloneable
,Iterable<StyleValue>
,Collection<StyleValue>
,Deque<StyleValue>
,List<StyleValue>
,Queue<StyleValue>
Linked-list implementation of
CSSValueList
, comma-separated.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.sf.carte.doc.style.css.CSSValue
CSSValue.CssType, CSSValue.Type
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(StyleValue value) Adds a value to the end of this list.void
clear()
Removes all the items from this list.clone()
Creates and returns a copy of this object.Get a parsable representation of this value.int
The number of values in this list.getMinifiedCssText
(String propertyName) Gives a minified version of the css text of the property.boolean
isEmpty()
Is this list empty ?item
(int index) Retrieve aCSSValue
by ordinal index.matches
(CSSValueSyntax syntax) Verify if this value matches the given grammar.set
(int index, StyleValue value) Replaces the value at the specified index with the supplied value.void
setCssText
(String cssText) Set this value according to the given parsable text.void
writeCssText
(io.sf.carte.util.SimpleWriter wri) Serialize this value to aSimpleWriter
.Methods inherited from class java.util.LinkedList
add, addAll, addAll, addFirst, addLast, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, size, spliterator, toArray, toArray
Methods inherited from class java.util.AbstractSequentialList
iterator
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface io.sf.carte.doc.style.css.CSSValueList
getCssValueType, getPrimitiveType, remove
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
Constructor Details
-
LinkedCSSValueList
public LinkedCSSValueList()
-
-
Method Details
-
add
Adds a value to the end of this list.- Specified by:
add
in interfaceCollection<StyleValue>
- Specified by:
add
in interfaceCSSValueList<StyleValue>
- Specified by:
add
in interfaceDeque<StyleValue>
- Specified by:
add
in interfaceList<StyleValue>
- Specified by:
add
in interfaceQueue<StyleValue>
- Overrides:
add
in classLinkedList<StyleValue>
- Parameters:
value
- the value to be added.- Returns:
true
(for consistency with Java collections).
-
clear
public void clear()Removes all the items from this list.- Specified by:
clear
in interfaceCollection<StyleValue>
- Specified by:
clear
in interfaceCSSValueList<StyleValue>
- Specified by:
clear
in interfaceList<StyleValue>
- Overrides:
clear
in classLinkedList<StyleValue>
-
isEmpty
public boolean isEmpty()Is this list empty ?- Specified by:
isEmpty
in interfaceCollection<StyleValue>
- Specified by:
isEmpty
in interfaceCSSValueList<StyleValue>
- Specified by:
isEmpty
in interfaceList<StyleValue>
- Overrides:
isEmpty
in classAbstractCollection<StyleValue>
- Returns:
true
if this list has no items,false
otherwise.
-
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.
-
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>
- Overrides:
clone
in classLinkedList<StyleValue>
- Returns:
- a clone of this instance.
-
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.
-
getCssText
Description copied from interface:CSSValue
Get a parsable representation of this value.- Specified by:
getCssText
in interfaceCSSValue
- Returns:
- the CSS serialization of this value.
-
getMinifiedCssText
Description copied from interface:CSSValue
Gives a minified version of the css text of the property.It may be customized for the given property name.
- Specified by:
getMinifiedCssText
in interfaceCSSValue
- Parameters:
propertyName
- the property name.- Returns:
- the minified css text.
-
set
Replaces the value at the specified index with the supplied value.- Specified by:
set
in interfaceCSSValueList<StyleValue>
- Specified by:
set
in interfaceList<StyleValue>
- Overrides:
set
in classLinkedList<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
.
-
writeCssText
Description copied from interface:CSSValue
Serialize this value to aSimpleWriter
.- Specified by:
writeCssText
in interfaceCSSValue
- Parameters:
wri
- the SimpleWriter.- Throws:
IOException
- if an error happened while writing.
-
setCssText
Description copied from interface:CSSValue
Set this value according to the given parsable text.- Specified by:
setCssText
in interfaceCSSValue
- Parameters:
cssText
- the text value.- Throws:
DOMException
- INVALID_MODIFICATION_ERR if the text value represents a different type or the value cannot be modified.
INVALID_CHARACTER_ERR if an invalid character was found.
SYNTAX_ERR if the string is invalid CSS.
-
matches
Description copied from interface:CSSValue
Verify if this value matches the given grammar.See also:
SyntaxParser
.
-