Lines Matching refs:node
322 int64_t node = nodes.elementAti(index);
323 // If the index is for a "weaker" node,
325 while(strengthFromNode(node) > strength) {
326 index = previousIndexFromNode(node);
327 node = nodes.elementAti(index);
330 // Find or insert a node whose index we will put into a temporary CE.
331 if(strengthFromNode(node) == strength && isTailoredNode(node)) {
332 // Reset to just before this same-strength tailored node.
333 index = previousIndexFromNode(node);
335 // root primary node (has no previous index)
336 uint32_t p = weight32FromNode(node);
356 // Go to the last node in this list:
357 // Tailor after the last node between adjacent root nodes.
359 node = nodes.elementAti(index);
360 int32_t nextIndex = nextIndexFromNode(node);
370 // findCommonNode() stayed on the stronger node or moved to
371 // an explicit common-weight node of the reset-before strength.
372 node = nodes.elementAti(index);
373 if(strengthFromNode(node) == strength) {
374 // Found a same-strength node with an explicit weight.
375 uint32_t weight16 = weight16FromNode(node);
386 // Reset to just before this node.
389 weight16 = getWeight16Before(index, node, strength);
390 // Does this preceding weight have a node?
392 int32_t previousIndex = previousIndexFromNode(node);
393 for(int32_t i = previousIndex;; i = previousIndexFromNode(node)) {
394 node = nodes.elementAti(i);
395 int32_t previousStrength = strengthFromNode(node);
399 // the parent node provides the implied common weight,
400 // or the reset element has a weight<=common in the node
404 } else if(previousStrength == strength && !isTailoredNode(node)) {
405 previousWeight16 = weight16FromNode(node);
411 // The preceding weight has a node,
416 // Insert a node with the preceding weight, reset to that.
417 node = nodeFromWeight16(weight16) | nodeFromStrength(strength);
418 index = insertNodeBetween(previousIndex, index, node, errorCode);
421 // Found a stronger node with implied strength-common weight.
422 uint32_t weight16 = getWeight16Before(index, node, strength);
437 CollationBuilder::getWeight16Before(int32_t index, int64_t node, int32_t level) {
438 U_ASSERT(strengthFromNode(node) < level || !isTailoredNode(node));
439 // Collect the root CE weights if this node is for a root CE.
442 if(strengthFromNode(node) == UCOL_TERTIARY) {
443 t = weight16FromNode(node);
445 t = Collation::COMMON_WEIGHT16; // Stronger node with implied common weight.
447 while(strengthFromNode(node) > UCOL_SECONDARY) {
448 index = previousIndexFromNode(node);
449 node = nodes.elementAti(index);
451 if(isTailoredNode(node)) {
455 if(strengthFromNode(node) == UCOL_SECONDARY) {
456 s = weight16FromNode(node);
458 s = Collation::COMMON_WEIGHT16; // Stronger node with implied common weight.
460 while(strengthFromNode(node) > UCOL_PRIMARY) {
461 index = previousIndexFromNode(node);
462 node = nodes.elementAti(index);
464 if(isTailoredNode(node)) {
468 uint32_t p = weight32FromNode(node);
496 // Look for a tailored tertiary node after [0, 0, 0].
499 int64_t node = nodes.elementAti(index);
500 if((index = nextIndexFromNode(node)) != 0) {
501 node = nodes.elementAti(index);
502 U_ASSERT(strengthFromNode(node) <= UCOL_TERTIARY);
503 if(isTailoredNode(node) && strengthFromNode(node) == UCOL_TERTIARY) {
508 // No need to look for nodeHasAnyBefore() on a tertiary node.
515 // Look for a tailored secondary node after [0, 0, *].
518 int64_t node = nodes.elementAti(index);
519 while((index = nextIndexFromNode(node)) != 0) {
520 node = nodes.elementAti(index);
521 strength = strengthFromNode(node);
524 if(isTailoredNode(node)) {
525 if(nodeHasBefore3(node)) {
526 index = nextIndexFromNode(nodes.elementAti(nextIndexFromNode(node)));
584 int64_t node = nodes.elementAti(index);
587 if(!nodeHasAnyBefore(node) && isBoundary) {
592 if((index = nextIndexFromNode(node)) != 0) {
593 // If there is a following node, then it must be tailored
596 node = nodes.elementAti(index);
597 U_ASSERT(isTailoredNode(node));
608 node = nodes.elementAti(index);
611 if(nodeHasAnyBefore(node)) {
612 // Get the first node that was tailored before this one at a weaker strength.
613 if(nodeHasBefore2(node)) {
614 index = nextIndexFromNode(nodes.elementAti(nextIndexFromNode(node)));
615 node = nodes.elementAti(index);
617 if(nodeHasBefore3(node)) {
618 index = nextIndexFromNode(nodes.elementAti(nextIndexFromNode(node)));
625 // Find the last node that was tailored after the [last xyz]
628 int32_t nextIndex = nextIndexFromNode(node);
633 node = nextNode;
635 // Do not make a temporary CE for a root node.
636 // This last node might be the node for the root CE itself,
637 // or a node with a common secondary or tertiary weight.
638 if(isTailoredNode(node)) {
696 // Find the node index after which we insert the new tailored node.
713 // Insert the new tailored node.
800 // Find or insert the node for each of the root CE's weights,
833 int64_t node = nodes[rootPrimaryIndexes[i]];
834 uint32_t nodePrimary = (uint32_t)(node >> 32); // weight32FromNode(node)
880 // If this will be the first below-common weight for the parent node,
882 int64_t node = nodes.elementAti(index);
883 U_ASSERT(strengthFromNode(node) < level); // parent node is stronger
886 if((node & hasThisLevelBefore) == 0) {
887 // The parent node has an implied level-common weight.
891 // Move the HAS_BEFORE3 flag from the parent node
892 // to the new secondary common node.
893 commonNode |= node & HAS_BEFORE3;
894 node &= ~(int64_t)HAS_BEFORE3;
896 nodes.setElementAt(node | hasThisLevelBefore, index);
897 // Insert below-common-weight node.
898 int32_t nextIndex = nextIndexFromNode(node);
899 node = nodeFromWeight16(weight16) | nodeFromStrength(level);
900 index = insertNodeBetween(index, nextIndex, node, errorCode);
901 // Insert common-weight node.
903 // Return index of below-common-weight node.
910 // Insert the new root node before the next stronger node,
911 // or before the next root node with the same strength and a larger weight.
913 while((nextIndex = nextIndexFromNode(node)) != 0) {
914 node = nodes.elementAti(nextIndex);
915 int32_t nextStrength = strengthFromNode(node);
917 // Insert before a stronger node.
920 if(!isTailoredNode(node)) {
921 uint32_t nextWeight16 = weight16FromNode(node);
923 // Found the node for the root CE up to this level.
926 // Insert before a node with a larger same-strength weight.
930 // Skip the next node.
933 node = nodeFromWeight16(weight16) | nodeFromStrength(level);
934 return insertNodeBetween(index, nextIndex, node, errorCode);
948 // Insert the new node before the next one with a strength at least as strong.
949 int64_t node = nodes.elementAti(index);
951 while((nextIndex = nextIndexFromNode(node)) != 0) {
952 node = nodes.elementAti(nextIndex);
953 if(strengthFromNode(node) <= strength) { break; }
954 // Skip the next node which has a weaker (larger) strength than the new one.
957 node = IS_TAILORED | nodeFromStrength(strength);
958 return insertNodeBetween(index, nextIndex, node, errorCode);
962 CollationBuilder::insertNodeBetween(int32_t index, int32_t nextIndex, int64_t node,
965 U_ASSERT(previousIndexFromNode(node) == 0);
966 U_ASSERT(nextIndexFromNode(node) == 0);
968 // Append the new node and link it to the existing nodes.
970 node |= nodeFromPreviousIndex(index) | nodeFromNextIndex(nextIndex);
971 nodes.addElement(node, errorCode);
974 node = nodes.elementAti(index);
975 nodes.setElementAt(changeNodeNextIndex(node, newIndex), index);
978 node = nodes.elementAti(nextIndex);
979 nodes.setElementAt(changeNodePreviousIndex(node, newIndex), nextIndex);
987 int64_t node = nodes.elementAti(index);
988 if(strengthFromNode(node) >= strength) {
989 // The current node is no stronger.
992 if(strength == UCOL_SECONDARY ? !nodeHasBefore2(node) : !nodeHasBefore3(node)) {
993 // The current node implies the strength-common weight.
996 index = nextIndexFromNode(node);
997 node = nodes.elementAti(index);
998 U_ASSERT(!isTailoredNode(node) && strengthFromNode(node) == strength &&
999 weight16FromNode(node) < Collation::COMMON_WEIGHT16);
1000 // Skip to the explicit common node.
1002 index = nextIndexFromNode(node);
1003 node = nodes.elementAti(index);
1004 U_ASSERT(strengthFromNode(node) >= strength);
1005 } while(isTailoredNode(node) || strengthFromNode(node) > strength ||
1006 weight16FromNode(node) < Collation::COMMON_WEIGHT16);
1007 U_ASSERT(weight16FromNode(node) == Collation::COMMON_WEIGHT16);
1396 int64_t node = nodesArray[i];
1397 uint32_t p = weight32FromNode(node);
1408 int32_t nextIndex = nextIndexFromNode(node);
1411 node = nodesArray[i];
1412 nextIndex = nextIndexFromNode(node);
1413 int32_t strength = strengthFromNode(node);
1415 U_ASSERT(isTailoredNode(node));
1427 if(isTailoredNode(node)) {
1432 // First tailored tertiary node for [p, s].
1462 t = weight16FromNode(node);
1470 if(isTailoredNode(node)) {
1475 // First tailored secondary node for p.
1514 s = weight16FromNode(node);
1521 U_ASSERT(isTailoredNode(node));
1526 // First tailored primary node in this list.
1550 if(isTailoredNode(node)) {
1565 int64_t node = nodesArray[i];
1566 if(strengthFromNode(node) < strength) { break; }
1567 if(strengthFromNode(node) == strength) {
1568 if(isTailoredNode(node)) {
1574 i = nextIndexFromNode(node);