Class ParserUtils
java.lang.Object
org.htmlunit.cssparser.util.ParserUtils
Util methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intHASH_OFFSET = 37.static final intHASH_SEED = 17. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic inthashCode(int seed, boolean b) static inthashCode(int seed, int hashcode) static intstatic StringtrimBy(StringBuilder s, int left, int right) Remove the given number of chars from start and end.static StringHelper 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:
-
-
Constructor Details
-
ParserUtils
private ParserUtils()
-
-
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
-
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
-