Package org.apache.lucene.util
Class StringHelper
- java.lang.Object
-
- org.apache.lucene.util.StringHelper
-
public abstract class StringHelper extends Object
Methods for manipulating strings.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description static StringInterner
interner
Expert: The StringInterner implementation used by Lucene.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
bytesDifference(byte[] bytes1, int len1, byte[] bytes2, int len2)
Compares two byte[] arrays, element by element, and returns the number of elements common to both arrays.static Comparator<String>
getVersionComparator()
static String
intern(String s)
Return the same string object for all equal strings
-
-
-
Field Detail
-
interner
public static StringInterner interner
Expert: The StringInterner implementation used by Lucene. This shouldn't be changed to an incompatible implementation after other Lucene APIs have been used.
-
-
Method Detail
-
bytesDifference
public static final int bytesDifference(byte[] bytes1, int len1, byte[] bytes2, int len2)
Compares two byte[] arrays, element by element, and returns the number of elements common to both arrays.- Parameters:
bytes1
- The first byte[] to comparebytes2
- The second byte[] to compare- Returns:
- The number of common elements.
-
getVersionComparator
public static Comparator<String> getVersionComparator()
- Returns:
- a Comparator over versioned strings such as X.YY.Z
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-