Lines Matching defs:node
315 int64_t node = nodes.elementAti(index);
316 // If the index is for a "weaker" tailored node,
318 while(strengthFromNode(node) > strength) {
319 index = previousIndexFromNode(node);
320 node = nodes.elementAti(index);
323 // Find or insert a node whose index we will put into a temporary CE.
324 if(strengthFromNode(node) == strength && isTailoredNode(node)) {
325 // Reset to just before this same-strength tailored node.
326 index = previousIndexFromNode(node);
328 // root primary node (has no previous index)
329 uint32_t p = weight32FromNode(node);
349 // Go to the last node in this list:
350 // Tailor after the last node between adjacent root nodes.
352 node = nodes.elementAti(index);
353 int32_t nextIndex = nextIndexFromNode(node);
363 node = nodes.elementAti(index);
364 if(strengthFromNode(node) == strength) {
365 // Found a same-strength node with an explicit weight.
366 uint32_t weight16 = weight16FromNode(node);
377 int32_t previousIndex = previousIndexFromNode(node);
379 // Reset to just before this same-strength common-weight node.
391 i = previousIndexFromNode(node);
392 node = nodes.elementAti(i);
393 if(strengthFromNode(node) == UCOL_SECONDARY && !isTailoredNode(node) &&
396 previousWeight16 = weight16FromNode(node);
398 } while(strengthFromNode(node) > UCOL_PRIMARY);
399 U_ASSERT(!isTailoredNode(node));
400 p = weight32FromNode(node);
405 i = previousIndexFromNode(node);
406 node
407 if(strengthFromNode(node) == UCOL_TERTIARY && !isTailoredNode(node) &&
410 previousWeight16 = weight16FromNode(node);
412 } while(strengthFromNode(node) > UCOL_SECONDARY);
413 U_ASSERT(!isTailoredNode(node));
414 if(strengthFromNode(node) == UCOL_SECONDARY) {
415 s = weight16FromNode(node);
417 i = previousIndexFromNode(node);
418 node = nodes.elementAti(i);
419 } while(strengthFromNode(node) > UCOL_PRIMARY);
420 U_ASSERT(!isTailoredNode(node));
422 U_ASSERT(!nodeHasBefore2(node));
425 p = weight32FromNode(node);
431 // Tailor after the last node between adjacent root nodes.
434 node = nodeFromWeight16(weight16) | nodeFromStrength(strength);
435 index = insertNodeBetween(previousIndex, index, node, errorCode);
439 // Found a stronger node with implied strength-common weight.
442 U_ASSERT(!nodeHasBefore2(node));
443 // Move the HAS_BEFORE3 flag from the parent node
444 // to the new secondary common node.
445 hasBefore3 = node & HAS_BEFORE3;
446 node = (node & ~(int64_t)HAS_BEFORE3) | HAS_BEFORE2;
448 U_ASSERT(!nodeHasBefore3(node));
449 node |= HAS_BEFORE3;
451 nodes.setElementAt(node, index);
452 int32_t nextIndex = nextIndexFromNode(node);
453 // Insert default nodes with weights 02 and 05, reset to the 02 node.
454 node = nodeFromWeight16(BEFORE_WEIGHT16) | nodeFromStrength(strength);
455 index = insertNodeBetween(index, nextIndex, node, errorCode);
456 node = nodeFromWeight16(Collation::COMMON_WEIGHT16) | hasBefore3 |
458 insertNodeBetween(index, nextIndex, node, errorCode);
488 // Look for a tailored tertiary node after [0, 0, 0].
491 int64_t node = nodes.elementAti(index);
492 if((index = nextIndexFromNode(node)) != 0) {
493 node = nodes.elementAti(index);
494 U_ASSERT(strengthFromNode(node) <= UCOL_TERTIARY);
495 if(isTailoredNode(node) && strengthFromNode(node) == UCOL_TERTIARY) {
500 // No need to look for nodeHasAnyBefore() on a tertiary node.
507 // Look for a tailored secondary node after [0, 0, *].
510 int64_t node = nodes.elementAti(index);
511 while((index = nextIndexFromNode(node)) != 0) {
512 node = nodes.elementAti(index);
513 strength = strengthFromNode(node);
516 if(isTailoredNode(node)) {
517 if(nodeHasBefore3(node)) {
518 index = nextIndexFromNode(nodes.elementAti(nextIndexFromNode(node)));
579 int64_t node = nodes.elementAti(index);
582 if(!nodeHasAnyBefore(node) && isBoundary) {
587 if((index = nextIndexFromNode(node)) != 0) {
588 // If there is a following node, then it must be tailored
591 node = nodes.elementAti(index);
592 U_ASSERT(isTailoredNode(node));
603 node = nodes.elementAti(index);
606 if(nodeHasAnyBefore(node)) {
607 // Get the first node that was tailored before this one at a weaker strength.
608 if(nodeHasBefore2(node)) {
609 index = nextIndexFromNode(nodes.elementAti(nextIndexFromNode(node)));
610 node = nodes.elementAti(index);
612 if(nodeHasBefore3(node)) {
613 index = nextIndexFromNode(nodes.elementAti(nextIndexFromNode(node)));
620 // Find the last node that was tailored after the [last xyz]
623 int32_t nextIndex = nextIndexFromNode(node);
628 node = nextNode;
630 // Do not make a temporary CE for a root node.
631 // This last node might be the node for the root CE itself,
632 // or a node with a common secondary or tertiary weight.
633 if(isTailoredNode(node)) {
691 // Find the node index after which we insert the new tailored node.
708 // Insert the new tailored node.
795 // Find or insert the node for each of the root CE's weights,
828 int64_t node = nodes[rootPrimaryIndexes[i]];
829 uint32_t nodePrimary = (uint32_t)(node >> 32); // weight32FromNode(node)
877 // Insert the new root node before the next stronger node,
878 // or before the next root node with the same strength and a larger weight.
879 int64_t node = nodes.elementAti(index);
881 while((nextIndex = nextIndexFromNode(node)) != 0) {
882 node = nodes.elementAti(nextIndex);
883 int32_t nextStrength = strengthFromNode(node);
885 // Insert before a stronger node.
888 if(!isTailoredNode(node)) {
889 uint32_t nextWeight16 = weight16FromNode(node);
891 // Found the node for the root CE up to this level.
894 // Insert before a node with a larger same-strength weight.
898 // Skip the next node.
901 node = nodeFromWeight16(weight16) | nodeFromStrength(level);
902 return insertNodeBetween(index, nextIndex, node, errorCode);
916 // Insert the new node before the next one with a strength at least as strong.
917 int64_t node = nodes.elementAti(index);
919 while((nextIndex = nextIndexFromNode(node)) != 0) {
920 node = nodes.elementAti(nextIndex);
921 if(strengthFromNode(node) <= strength) { break; }
922 // Skip the next node which has a weaker (larger) strength than the new one.
925 node = IS_TAILORED | nodeFromStrength(strength);
926 return insertNodeBetween(index, nextIndex, node, errorCode);
930 CollationBuilder::insertNodeBetween(int32_t index, int32_t nextIndex, int64_t node,
933 U_ASSERT(previousIndexFromNode(node) == 0);
934 U_ASSERT(nextIndexFromNode(node) == 0);
936 // Append the new node and link it to the existing nodes.
938 node |= nodeFromPreviousIndex(index) | nodeFromNextIndex(nextIndex);
939 nodes.addElement(node, errorCode);
942 node = nodes.elementAti(index);
943 nodes.setElementAt(changeNodeNextIndex(node, newIndex), index);
946 node = nodes.elementAti(nextIndex);
947 nodes.setElementAt(changeNodePreviousIndex(node, newIndex), nextIndex);
955 int64_t node = nodes.elementAti(index);
956 if(strengthFromNode(node) >= strength) {
957 // The current node is no stronger.
960 if(strength == UCOL_SECONDARY ? !nodeHasBefore2(node) : !nodeHasBefore3(node)) {
961 // The current node implies the strength-common weight.
964 index = nextIndexFromNode(node);
965 node = nodes.elementAti(index);
966 U_ASSERT(!isTailoredNode(node) && strengthFromNode(node) == strength &&
967 weight16FromNode(node) == BEFORE_WEIGHT16);
968 // Skip to the explicit common node.
970 index = nextIndexFromNode(node);
971 node = nodes.elementAti(index);
972 U_ASSERT(strengthFromNode(node) >= strength);
973 } while(isTailoredNode(node) || strengthFromNode(node) > strength);
974 U_ASSERT(weight16FromNode(node) == Collation::COMMON_WEIGHT16);
1360 int64_t node = nodesArray[i];
1361 uint32_t p = weight32FromNode(node);
1372 int32_t nextIndex = nextIndexFromNode(node);
1375 node = nodesArray[i];
1376 nextIndex = nextIndexFromNode(node);
1377 int32_t strength = strengthFromNode(node);
1379 U_ASSERT(isTailoredNode(node));
1391 if(isTailoredNode(node)) {
1396 // First tailored tertiary node for [p, s].
1426 t = weight16FromNode(node);
1434 if(isTailoredNode(node)) {
1439 // First tailored secondary node for p.
1473 s = weight16FromNode(node);
1480 U_ASSERT(isTailoredNode(node));
1485 // First tailored primary node in this list.
1509 if(isTailoredNode(node)) {
1524 int64_t node = nodesArray[i];
1525 if(strengthFromNode(node) < strength) { break; }
1526 if(strengthFromNode(node) == strength) {
1527 if(isTailoredNode(node)) {
1533 i = nextIndexFromNode(node);