Package org.htmlunit.cssparser.util
Class ParserUtils
java.lang.Object
org.htmlunit.cssparser.util.ParserUtils
Util methods.
- Author:
- Ronald Brill
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
HASH_OFFSET = 37.static final int
HASH_SEED = 17. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static int
hashCode
(int seed, boolean b) static int
hashCode
(int seed, int hashcode) static int
static String
trimBy
(StringBuilder s, int left, int right) Remove the given number of chars from start and end.static String
Helper that removes the leading "url(", the trailing ")" and surrounding quotes from the given string builder.
-
Field Details
-
HASH_SEED
public static final int HASH_SEEDHASH_SEED = 17.- See Also:
-
HASH_OFFSET
public static final int HASH_OFFSETHASH_OFFSET = 37.- See Also:
-
-
Method Details
-
hashCode
public static int hashCode(int seed, int hashcode) - Parameters:
seed
- the seed to be usedhashcode
- 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 usedb
- the boolean to be used as input- Returns:
- a hash code calculated based on a given boolean.
-
hashCode
- Parameters:
seed
- the seed to be usedobj
- the object to be used as input- Returns:
- a hash code calculated based on a given object.
-
equals
- Parameters:
obj1
- the first objectobj2
- the second object- Returns:
- true if the both objects are equals
-
trimBy
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 StringBuilderleft
- no of chars to be removed from startright
- no of chars to be removed from end- Returns:
- the trimmed string
-
trimUrl
Helper that removes the leading "url(", the trailing ")" and surrounding quotes from the given string builder.- Parameters:
s
- the StringBuilder- Returns:
- the trimmed string
-