Class PseudoNthSpecifier

java.lang.Object
org.joox.selector.PseudoNthSpecifier
All Implemented Interfaces:
Specifier

class PseudoNthSpecifier extends Object implements Specifier
An implementation of Specifier for nth-* pseudo-classes.
See Also:
  • Field Details

    • value

      private final String value
      The nth-* pseudo-class value (i.e. nth-child etc).
    • argument

      private final String argument
      The nth-* pseudo-class argument (i.e. 2n+1 etc).
    • a

      private int a
      The parsed a value.
    • b

      private int b
      The parsed b value.
  • Constructor Details

    • PseudoNthSpecifier

      public PseudoNthSpecifier(String value, String argument)
      Create a new nth-* pseudo-class instance with the specified value and argument.
      Parameters:
      value - The nth-* pseudo-class value (i.e. nth-child etc).
      argument - The nth-* pseudo-class argument (i.e. odd etc).
  • Method Details

    • getArgument

      public String getArgument()
      Get the nth-* pseudo-class argument.
      Returns:
      The argument.
    • getValue

      public String getValue()
      Get the nth-* pseudo-class value.
      Returns:
      The value.
    • getType

      public Specifier.Type getType()
      Get the specifier type.
      Specified by:
      getType in interface Specifier
      Returns:
      The specifier type.
    • isMatch

      public boolean isMatch(int count)
      Check if the node count matches this specifier.
      Parameters:
      count - The node count.
      Returns:
      true or false.
    • parseNth

      private void parseNth()
      Parse the nth-* pseudo-class argument.