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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(StyleValue value) Adds a value to the end of this list.voidclear()Removes all the items from this list.clone()Creates and returns a copy of this object.Get a parsable representation of this value.intThe number of values in this list.getMinifiedCssText(String propertyName) Gives a minified version of the css text of the property.booleanisEmpty()Is this list empty ?item(int index) Retrieve aCSSValueby 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.voidsetCssText(String cssText) Set this value according to the given parsable text.voidwriteCssText(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, toArrayMethods inherited from class java.util.AbstractSequentialList
iteratorMethods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface io.sf.carte.doc.style.css.CSSValueList
getCssValueType, getPrimitiveType, removeMethods 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:
addin interfaceCollection<StyleValue>- Specified by:
addin interfaceCSSValueList<StyleValue>- Specified by:
addin interfaceDeque<StyleValue>- Specified by:
addin interfaceList<StyleValue>- Specified by:
addin interfaceQueue<StyleValue>- Overrides:
addin 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:
clearin interfaceCollection<StyleValue>- Specified by:
clearin interfaceCSSValueList<StyleValue>- Specified by:
clearin interfaceList<StyleValue>- Overrides:
clearin classLinkedList<StyleValue>
-
isEmpty
public boolean isEmpty()Is this list empty ?- Specified by:
isEmptyin interfaceCollection<StyleValue>- Specified by:
isEmptyin interfaceCSSValueList<StyleValue>- Specified by:
isEmptyin interfaceList<StyleValue>- Overrides:
isEmptyin classAbstractCollection<StyleValue>- Returns:
trueif this list has no items,falseotherwise.
-
item
Description copied from interface:CSSValueListRetrieve aCSSValueby ordinal index.- Specified by:
itemin interfaceCSSValueList<StyleValue>- Parameters:
index- the index in this list.- Returns:
- the value at
index, ornullifindexis 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:
clonein interfaceCSSValue- Specified by:
clonein interfaceCSSValueList<StyleValue>- Overrides:
clonein classLinkedList<StyleValue>- Returns:
- a clone of this instance.
-
getLength
public int getLength()Description copied from interface:CSSValueListThe number of values in this list.- Specified by:
getLengthin interfaceCSSValueList<StyleValue>- Returns:
- the number of items in this list.
-
getCssText
Description copied from interface:CSSValueGet a parsable representation of this value.- Specified by:
getCssTextin interfaceCSSValue- Returns:
- the CSS serialization of this value.
-
getMinifiedCssText
Description copied from interface:CSSValueGives a minified version of the css text of the property.It may be customized for the given property name.
- Specified by:
getMinifiedCssTextin 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:
setin interfaceCSSValueList<StyleValue>- Specified by:
setin interfaceList<StyleValue>- Overrides:
setin 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:CSSValueSerialize this value to aSimpleWriter.- Specified by:
writeCssTextin interfaceCSSValue- Parameters:
wri- the SimpleWriter.- Throws:
IOException- if an error happened while writing.
-
setCssText
Description copied from interface:CSSValueSet this value according to the given parsable text.- Specified by:
setCssTextin 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:CSSValueVerify if this value matches the given grammar.See also:
SyntaxParser.
-