Class ParserUtils


  • public final class ParserUtils
    extends java.lang.Object
    Util methods.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int HASH_OFFSET
      HASH_OFFSET = 37.
      static int HASH_SEED
      HASH_SEED = 17.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ParserUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean equals​(java.lang.Object obj1, java.lang.Object obj2)  
      static int hashCode​(int seed, boolean b)  
      static int hashCode​(int seed, int hashcode)  
      static int hashCode​(int seed, java.lang.Object obj)  
      static java.lang.String trimBy​(java.lang.StringBuilder s, int left, int right)
      Remove the given number of chars from start and end.
      static java.lang.String trimUrl​(java.lang.StringBuilder s)
      Helper that removes the leading "url(", the trailing ")" and surrounding quotes from the given string builder.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParserUtils

        private ParserUtils()
    • Method Detail

      • hashCode

        public static int hashCode​(int seed,
                                   int hashcode)
        Parameters:
        seed - the seed to be used
        hashcode - the hashcode to be used as input
        Returns:
        a hash code calculated based on a given one.
      • hashCode

        public static int hashCode​(int seed,
                                   boolean b)
        Parameters:
        seed - the seed to be used
        b - the boolean to be used as input
        Returns:
        a hash code calculated based on a given boolean.
      • hashCode

        public static int hashCode​(int seed,
                                   java.lang.Object obj)
        Parameters:
        seed - the seed to be used
        obj - the object to be used as input
        Returns:
        a hash code calculated based on a given object.
      • equals

        public static boolean equals​(java.lang.Object obj1,
                                     java.lang.Object obj2)
        Parameters:
        obj1 - the first object
        obj2 - the second object
        Returns:
        true if the both objects are equals
      • trimBy

        public static java.lang.String trimBy​(java.lang.StringBuilder s,
                                              int left,
                                              int right)
        Remove the given number of chars from start and end. There is no parameter checking, the caller has to take care of this.
        Parameters:
        s - the StringBuilder
        left - no of chars to be removed from start
        right - no of chars to be removed from end
        Returns:
        the trimmed string
      • trimUrl

        public static java.lang.String trimUrl​(java.lang.StringBuilder s)
        Helper that removes the leading "url(", the trailing ")" and surrounding quotes from the given string builder.
        Parameters:
        s - the StringBuilder
        Returns:
        the trimmed string