Lines Matching refs:weight

77      * @param lowerLimit A collation element weight; the ranges will be filled to cover
79 * @param upperLimit A collation element weight; the ranges will be filled to cover
136 * @return The next weight in the ranges, or 0xffffffff if there is none left.
142 /* get the next weight */
144 long weight = range.start;
149 /* increment the weight for the next value */
150 range.start = incWeight(weight, range.length);
154 return weight;
179 public static int lengthOfWeight(long weight) {
180 if((weight&0xffffff)==0) {
182 } else if((weight&0xffff)==0) {
184 } else if((weight&0xff)==0) {
191 private static int getWeightTrail(long weight, int length) {
192 return (int)(weight>>(8*(4-length)))&0xff;
195 private static long setWeightTrail(long weight, int length, int trail) {
197 return (weight&(0xffffff00L<<length))|((long)trail<<length);
200 private static int getWeightByte(long weight, int idx) {
201 return getWeightTrail(weight, idx); /* same calculation */
204 private static long setWeightByte(long weight, int idx, int b) {
224 return (weight&mask)|((long)b<<idx);
227 private static long truncateWeight(long weight, int length) {
228 return weight&(0xffffffffL<<(8*(4-length)));
231 private static long incWeightTrail(long weight, int length) {
232 return weight+(1L<<(8*(4-length)));
235 private static long decWeightTrail(long weight, int length) {
236 return weight-(1L<<(8*(4-length)));
244 private long incWeight(long weight, int length) {
246 int b=getWeightByte(weight, length);
248 return setWeightByte(weight, length, b+1);
251 weight=setWeightByte(weight, length, minBytes[length]);
258 private long incWeightByOffset(long weight, int length, int offset) {
260 offset += getWeightByte(weight, length);
262 return setWeightByte(weight, length, offset);
266 weight = setWeightByte(weight, length, minBytes[length] + offset % countBytes(length));
332 long weight=lowerLimit;
334 int trail=getWeightTrail(weight, length);
337 lower[length].start=incWeightTrail(weight, length);
338 lower[length].end=setWeightTrail(weight, length, maxBytes[length]);
342 weight=truncateWeight(weight, length-1);
344 if(weight<0xff000000L) {
345 middle.start=incWeightTrail(weight, middleLength);
352 weight=upperLimit;
354 int trail=getWeightTrail(weight, length);
357 upper[length].start=setWeightTrail(weight, length, minBytes[length]);
358 upper[length].end=decWeightTrail(weight, length);
362 weight=truncateWeight(weight, length-1);
364 middle.end=decWeightTrail(weight, middleLength);
474 /* sort the ranges by weight values */