Lines Matching refs:weight

79      * @param lowerLimit A collation element weight; the ranges will be filled to cover
81 * @param upperLimit A collation element weight; the ranges will be filled to cover
138 * @return The next weight in the ranges, or 0xffffffff if there is none left.
144 /* get the next weight */
146 long weight = range.start;
151 /* increment the weight for the next value */
152 range.start = incWeight(weight, range.length);
156 return weight;
181 public static int lengthOfWeight(long weight) {
182 if((weight&0xffffff)==0) {
184 } else if((weight&0xffff)==0) {
186 } else if((weight&0xff)==0) {
193 private static int getWeightTrail(long weight, int length) {
194 return (int)(weight>>(8*(4-length)))&0xff;
197 private static long setWeightTrail(long weight, int length, int trail) {
199 return (weight&(0xffffff00L<<length))|((long)trail<<length);
202 private static int getWeightByte(long weight, int idx) {
203 return getWeightTrail(weight, idx); /* same calculation */
206 private static long setWeightByte(long weight, int idx, int b) {
226 return (weight&mask)|((long)b<<idx);
229 private static long truncateWeight(long weight, int length) {
230 return weight&(0xffffffffL<<(8*(4-length)));
233 private static long incWeightTrail(long weight, int length) {
234 return weight+(1L<<(8*(4-length)));
237 private static long decWeightTrail(long weight, int length) {
238 return weight-(1L<<(8*(4-length)));
246 private long incWeight(long weight, int length) {
248 int b=getWeightByte(weight, length);
250 return setWeightByte(weight, length, b+1);
253 weight=setWeightByte(weight, length, minBytes[length]);
260 private long incWeightByOffset(long weight, int length, int offset) {
262 offset += getWeightByte(weight, length);
264 return setWeightByte(weight, length, offset);
268 weight = setWeightByte(weight, length, minBytes[length] + offset % countBytes(length));
334 long weight=lowerLimit;
336 int trail=getWeightTrail(weight, length);
339 lower[length].start=incWeightTrail(weight, length);
340 lower[length].end=setWeightTrail(weight, length, maxBytes[length]);
344 weight=truncateWeight(weight, length-1);
346 if(weight<0xff000000L) {
347 middle.start=incWeightTrail(weight, middleLength);
354 weight=upperLimit;
356 int trail=getWeightTrail(weight, length);
359 upper[length].start=setWeightTrail(weight, length, minBytes[length]);
360 upper[length].end=decWeightTrail(weight, length);
364 weight=truncateWeight(weight, length-1);
366 middle.end=decWeightTrail(weight, middleLength);
476 /* sort the ranges by weight values */