Package com.ibm.icu.impl.coll
Class CollationWeights
- java.lang.Object
-
- com.ibm.icu.impl.coll.CollationWeights
-
public final class CollationWeights extends Object
Allocates n collation element weights between two exclusive limits. Used only internally by the collation tailoring builder.
-
-
Constructor Summary
Constructors Constructor Description CollationWeights()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallocWeights(long lowerLimit, long upperLimit, int n)Determine heuristically what ranges to use for a given number of weights between (excluding) two limits.voidinitForPrimary(boolean compressible)voidinitForSecondary()voidinitForTertiary()static intlengthOfWeight(long weight)longnextWeight()Given a set of ranges calculated by allocWeights(), iterate through the weights.
-
-
-
Method Detail
-
initForPrimary
public void initForPrimary(boolean compressible)
-
initForSecondary
public void initForSecondary()
-
initForTertiary
public void initForTertiary()
-
allocWeights
public boolean allocWeights(long lowerLimit, long upperLimit, int n)Determine heuristically what ranges to use for a given number of weights between (excluding) two limits.- Parameters:
lowerLimit- A collation element weight; the ranges will be filled to cover weights greater than this one.upperLimit- A collation element weight; the ranges will be filled to cover weights less than this one.n- The number of collation element weights w necessary such that lowerLimit- Returns:
- true if it is possible to fit n elements between the limits
-
nextWeight
public long nextWeight()
Given a set of ranges calculated by allocWeights(), iterate through the weights. The ranges are modified to keep the current iteration state.- Returns:
- The next weight in the ranges, or 0xffffffff if there is none left.
-
lengthOfWeight
public static int lengthOfWeight(long weight)
-
-