Class MarginRuleList

All Implemented Interfaces:
CSSRuleList<MarginRule>, Serializable, Cloneable, Iterable<MarginRule>, Collection<MarginRule>, List<MarginRule>, RandomAccess, CSSRuleList

public class MarginRuleList extends ArrayList<T>
Stores a list of CSS margin rules, implementing CSSRuleList.
See Also:
  • Constructor Details

    • MarginRuleList

      public MarginRuleList(int initialCapacity)
      Constructs an empty rule list with the specified initial capacity.
      initialCapacity - the initial capacity.
      IllegalArgumentException - if the specified initial capacity is negative.
    • MarginRuleList

      public MarginRuleList()
      Constructs an empty rule list with an initial capacity of 16.
    • MarginRuleList

      public MarginRuleList(Collection<MarginRule> c)
  • Method Details

    • toString

      public String toString()
    • writeCssText

      public void writeCssText(SimpleWriter wri, StyleFormattingContext context) throws IOException
      Description copied from interface: CSSRuleList
      Write a serialization of this rule list to the given simple writer, according to the given context.
      Specified by:
      writeCssText in interface CSSRuleList<MarginRule>
      wri - the simple writer object.
      context - the formatting context.
      IOException - if an error happened while writing.
    • getLength

      public int getLength()
      Gives the number of rules in the list.
      Specified by:
      getLength in interface CSSRuleList
      the number of CSSRules in the list. The range of valid child rule indices is 0 to length-1 inclusive.
    • item

      public MarginRule item(int index)
      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 returns null.
      Specified by:
      item in interface CSSRuleList<T extends CSSRule>
      Specified by:
      item in interface CSSRuleList
      index - Index into the collection.
      The style rule at the index position in the CSSRuleList, or null if that is not a valid index.
    • append

      public boolean append(MarginRule rule)
      Appends the rule to the end of the list
      rule - the rule to append.
      true if the rule was appended successfully, false otherwise.
    • toMinifiedString

      public String toMinifiedString()
      Description copied from interface: CSSRuleList
      Gives a minified parsable representation of this rule list.
      Specified by:
      toMinifiedString in interface CSSRuleList<T extends CSSRule>
      the minified rule list.