java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<T>
io.sf.carte.doc.style.css.om.MarginRuleList
- All Implemented Interfaces:
ExtendedCSSRuleList<MarginRule>
,Serializable
,Cloneable
,Iterable<MarginRule>
,Collection<MarginRule>
,List<MarginRule>
,RandomAccess
,CSSRuleList
Stores a list of CSS margin rules, implementing CSSRuleList.
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionConstructs an empty rule list with an initial capacity of 16.MarginRuleList
(int initialCapacity) Constructs an empty rule list with the specified initial capacity. -
Method Summary
Modifier and TypeMethodDescriptionboolean
append
(MarginRule rule) Appends the rule to the end of the listint
Gives the number of rules in the list.item
(int index) Used to retrieve a CSS rule by ordinal index.toString()
void
writeCssText
(SimpleWriter wri, StyleFormattingContext context) Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface io.sf.carte.doc.style.css.ExtendedCSSRuleList
clear, iterator
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
MarginRuleList
public MarginRuleList(int initialCapacity) Constructs an empty rule list with the specified initial capacity.- Parameters:
initialCapacity
- the initial capacity.- Throws:
IllegalArgumentException
- if the specified initial capacity is negative.
-
MarginRuleList
public MarginRuleList()Constructs an empty rule list with an initial capacity of 16. -
MarginRuleList
-
-
Method Details
-
toString
-
writeCssText
- Specified by:
writeCssText
in interfaceExtendedCSSRuleList<MarginRule>
- Throws:
IOException
-
getLength
public int getLength()Gives the number of rules in the list.- Specified by:
getLength
in interfaceCSSRuleList
- Returns:
- the number of
CSSRules
in the list. The range of valid child rule indices is0
tolength-1
inclusive.
-
item
Used to retrieve a CSS rule by ordinal index. The order in this collection represents the order of the rules in the CSS style sheet. If index is greater than or equal to the number of rules in the list, this returnsnull
.- Specified by:
item
in interfaceCSSRuleList
- Specified by:
item
in interfaceExtendedCSSRuleList<T extends ExtendedCSSRule>
- Parameters:
index
- Index into the collection.- Returns:
- The style rule at the
index
position in theCSSRuleList
, ornull
if that is not a valid index.
-
append
Appends the rule to the end of the list- Parameters:
rule
- the rule to append.- Returns:
true
if the rule was appended successfully,false
otherwise.
-
toMinifiedString
- Specified by:
toMinifiedString
in interfaceExtendedCSSRuleList<T extends ExtendedCSSRule>
-