Package org.htmlunit.cssparser.util
Class ParserUtils
- java.lang.Object
-
- org.htmlunit.cssparser.util.ParserUtils
-
public final class ParserUtils extends java.lang.ObjectUtil methods.
-
-
Field Summary
Fields Modifier and Type Field Description static intHASH_OFFSETHASH_OFFSET = 37.static intHASH_SEEDHASH_SEED = 17.
-
Constructor Summary
Constructors Modifier Constructor Description privateParserUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanequals(java.lang.Object obj1, java.lang.Object obj2)static inthashCode(int seed, boolean b)static inthashCode(int seed, int hashcode)static inthashCode(int seed, java.lang.Object obj)static java.lang.StringtrimBy(java.lang.StringBuilder s, int left, int right)Remove the given number of chars from start and end.static java.lang.StringtrimUrl(java.lang.StringBuilder s)Helper that removes the leading "url(", the trailing ")" and surrounding quotes from the given string builder.
-
-
-
Field Detail
-
HASH_SEED
public static final int HASH_SEED
HASH_SEED = 17.- See Also:
- Constant Field Values
-
HASH_OFFSET
public static final int HASH_OFFSET
HASH_OFFSET = 37.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public static int hashCode(int seed, java.lang.Object obj)- 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
public static boolean equals(java.lang.Object obj1, java.lang.Object obj2)- Parameters:
obj1- the first objectobj2- 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 StringBuilderleft- no of chars to be removed from startright- 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
-
-