Class CSSSourceArea

java.lang.Object
com.helger.css.CSSSourceArea

@Immutable public class CSSSourceArea extends Object
Defines the source location of a single token when reading CSS from a stream. It consists of the start position (getTokenBegin*) and the end position (getTokenEnd*).
Author:
Philip Helger
  • Constructor Details

    • CSSSourceArea

      public CSSSourceArea(int nBeginLineNumber, int nBeginColumnNumber, int nEndLineNumber, int nEndColumnNumber)
      Constructor
      Parameters:
      nBeginLineNumber - Line number of the beginning. May be -1 if not such token is available.
      nBeginColumnNumber - Column number of the beginning. May be -1 if not such token is available.
      nEndLineNumber - Line number of the end. May be -1 if not such token is available.
      nEndColumnNumber - Column number of the end. May be -1 if not such token is available.
  • Method Details

    • getTokenBeginLineNumber

      @CheckForSigned public int getTokenBeginLineNumber()
      Returns:
      The line number where the token begins (incl.). May be -1 if not such token is available.
    • getTokenBeginColumnNumber

      @CheckForSigned public int getTokenBeginColumnNumber()
      Returns:
      The column number where the token begins (incl.). May be -1 if not such token is available.
    • getTokenEndLineNumber

      @CheckForSigned public int getTokenEndLineNumber()
      Returns:
      The line number where the token ends (incl.). May be -1 if not such token is available.
    • getTokenEndColumnNumber

      @CheckForSigned public int getTokenEndColumnNumber()
      Returns:
      The column number where the token ends (incl.). May be -1 if not such token is available.
    • getTokenLocationAsString

      @Nonnull @Nonempty public String getTokenLocationAsString()
      Returns:
      The location of the token as a simple string. Never null. Example: (1:2/3:4). If begin and end are identical, only one line/column value is printed: (1:2).
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object