- All Implemented Interfaces:
- CSSRuleList<MarginRule>,- Serializable,- Cloneable,- Iterable<MarginRule>,- Collection<MarginRule>,- List<MarginRule>,- RandomAccess,- SequencedCollection<MarginRule>,- CSSRuleList
Stores a list of CSS margin rules, implementing CSSRuleList.
- See Also:
- 
Field SummaryFields inherited from class java.util.AbstractListmodCount
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs an empty rule list with an initial capacity of 16.MarginRuleList(int initialCapacity) Constructs an empty rule list with the specified initial capacity.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanappend(MarginRule rule) Appends the rule to the end of the listintGives the number of rules in the list.item(int index) Used to retrieve a CSS rule by ordinal index.Gives a minified parsable representation of this rule list.toString()voidwriteCssText(SimpleWriter wri, StyleFormattingContext context) Write a serialization of this rule list to the given simple writer, according to the given context.Methods inherited from class java.util.ArrayListadd, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollectioncontainsAllMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, stream, toArrayMethods inherited from interface io.sf.carte.doc.style.css.CSSRuleListclear, iteratorMethods inherited from interface java.util.ListcontainsAll, reversed
- 
Constructor Details- 
MarginRuleListpublic 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.
 
- 
MarginRuleListpublic MarginRuleList()Constructs an empty rule list with an initial capacity of 16.
- 
MarginRuleList
 
- 
- 
Method Details- 
toString
- 
writeCssTextDescription copied from interface:CSSRuleListWrite a serialization of this rule list to the given simple writer, according to the given context.- Specified by:
- writeCssTextin interface- CSSRuleList<MarginRule>
- Parameters:
- wri- the simple writer object.
- context- the formatting context.
- Throws:
- IOException- if an error happened while writing.
 
- 
getLengthpublic int getLength()Gives the number of rules in the list.- Specified by:
- getLengthin interface- CSSRuleList
- Returns:
- the number of CSSRulesin the list. The range of valid child rule indices is0tolength-1inclusive.
 
- 
itemUsed 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:
- itemin interface- CSSRuleList<T extends CSSRule>
- Specified by:
- itemin interface- CSSRuleList
- Parameters:
- index- Index into the collection.
- Returns:
- The style rule at the indexposition in theCSSRuleList, ornullif that is not a valid index.
 
- 
appendAppends the rule to the end of the list- Parameters:
- rule- the rule to append.
- Returns:
- trueif the rule was appended successfully,- falseotherwise.
 
- 
toMinifiedStringDescription copied from interface:CSSRuleListGives a minified parsable representation of this rule list.- Specified by:
- toMinifiedStringin interface- CSSRuleList<T extends CSSRule>
- Returns:
- the minified rule list.
 
 
-