code: private void determineParagraphEmbeddingLevel() {
          byte strongType = -1; // unknown
          
          // Rule P2.
          for (int i = 0; i < textLength; ++i) {
              byte t = resultTypes[i];
              if (t == L || t == AL || t == R) {
                  strongType = t;
                  break;
              }
          }
          
          // Rule P3.
          if (strongType == -1) { // none found
              // default embedding level when no strong types found is 0.
              paragraphEmbeddingLevel = 0;
          } else if (strongType == L) {
              paragraphEmbeddingLevel = 0;
          } else { // AL, R
              paragraphEmbeddingLevel = 1;
          }
      }
docs: 1) determining the paragraph level.
  <p>
  Rules P2, P3.
  <p>
  At the end of this function, the member variable paragraphEmbeddingLevel is set to either 0 or 1.