code: private byte directionFromFlags() {
          /* if the text contains AN and neutrals, then some neutrals may become RTL */
          if (!((flags & MASK_RTL) != 0 ||
                ((flags & DirPropFlag(AN)) != 0 &&
                 (flags & MASK_POSSIBLE_N) != 0))) {
              return LTR;
          } else if ((flags & MASK_LTR) == 0) {
              return RTL;
          } else {
              return MIXED;
          }
      }
docs: /* determine if the text is mixed-directional or single-directional