Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 158 for charAt (0.18 sec)

  1. android/guava/src/com/google/common/hash/Murmur3_32HashFunction.java

            char c0 = input.charAt(i);
            char c1 = input.charAt(i + 1);
            char c2 = input.charAt(i + 2);
            char c3 = input.charAt(i + 3);
            if (c0 < 0x80 && c1 < 0x80 && c2 < 0x80 && c3 < 0x80) {
              int k1 = c0 | (c1 << 8) | (c2 << 16) | (c3 << 24);
              k1 = mixK1(k1);
              h1 = mixH1(h1, k1);
              i += 4;
              len += 4;
            } else {
              break;
            }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jun 15 20:59:00 GMT 2022
    - 11.9K bytes
    - Viewed (0)
  2. android/guava-tests/benchmark/com/google/common/base/AsciiBenchmark.java

          chars.add(randomAlpha());
        }
        for (int i = 0; i < nonAlpha; i++) {
          chars.add(randomNonAlpha());
        }
        Collections.shuffle(chars, random);
        char[] array = Chars.toArray(chars);
        this.testString = new String(array);
      }
    
      private char randomAlpha() {
        return ALPHA.charAt(random.nextInt(ALPHA.length()));
      }
    
      private char randomNonAlpha() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.8K bytes
    - Viewed (0)
  3. guava-tests/benchmark/com/google/common/base/WhitespaceMatcherBenchmark.java

        final String allMatchingChars = allMatchingChars(bitSet);
        final char[] result = new char[STRING_LENGTH];
        // Fill with matching chars.
        for (int i = 0; i < result.length; i++) {
          result[i] = allMatchingChars.charAt(random.nextInt(allMatchingChars.length()));
        }
        // Replace some of chars by non-matching.
        int remaining = (int) ((100 - percentMatching) * result.length / 100.0 + 0.5);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed May 16 22:49:59 GMT 2018
    - 3.9K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/escape/CharEscaper.java

       */
      private static char[] growBuffer(char[] dest, int index, int size) {
        if (size < 0) { // overflow - should be OutOfMemoryError but GWT/j2cl don't support it
          throw new AssertionError("Cannot increase internal buffer any further");
        }
        char[] copy = new char[size];
        if (index > 0) {
          System.arraycopy(dest, 0, copy, 0, index);
        }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jan 18 20:55:09 GMT 2022
    - 6.7K bytes
    - Viewed (0)
  5. guava/src/com/google/common/base/Strings.java

        checkNotNull(a);
        checkNotNull(b);
    
        int maxPrefixLength = Math.min(a.length(), b.length());
        int p = 0;
        while (p < maxPrefixLength && a.charAt(p) == b.charAt(p)) {
          p++;
        }
        if (validSurrogatePairAt(a, p - 1) || validSurrogatePairAt(b, p - 1)) {
          p--;
        }
        return a.subSequence(0, p).toString();
      }
    
      /**
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Fri Sep 17 20:47:03 GMT 2021
    - 12.6K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/base/Ascii.java

        if (chars instanceof String) {
          return toLowerCase((String) chars);
        }
        char[] newChars = new char[chars.length()];
        for (int i = 0; i < newChars.length; i++) {
          newChars[i] = toLowerCase(chars.charAt(i));
        }
        return String.valueOf(newChars);
      }
    
      /**
       * If the argument is an {@linkplain #isUpperCase(char) uppercase ASCII character}, returns the
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Jul 19 15:43:07 GMT 2021
    - 21.6K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/base/Utf8.java

        int utf8Length = utf16Length;
        int i = 0;
    
        // This loop optimizes for pure ASCII.
        while (i < utf16Length && sequence.charAt(i) < 0x80) {
          i++;
        }
    
        // This loop optimizes for chars less than 0x800.
        for (; i < utf16Length; i++) {
          char c = sequence.charAt(i);
          if (c < 0x800) {
            utf8Length += ((0x7f - c) >>> 31); // branch free!
          } else {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 10 14:11:51 GMT 2023
    - 7K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java

      }
    
      private static void assertPutString(char[] chars) {
        Hasher h1 = new NonStreamingVersion().newHasher();
        Hasher h2 = new NonStreamingVersion().newHasher();
        String s = new String(chars);
        // this is the correct implementation of the spec
        for (int i = 0; i < s.length(); i++) {
          h1.putChar(s.charAt(i));
        }
        h2.putUnencodedChars(s);
        assertEquals(h1.hash(), h2.hash());
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java

      }
    
      private static void assertPutString(char[] chars) {
        Hasher h1 = new NonStreamingVersion().newHasher();
        Hasher h2 = new NonStreamingVersion().newHasher();
        String s = new String(chars);
        // this is the correct implementation of the spec
        for (int i = 0; i < s.length(); i++) {
          h1.putChar(s.charAt(i));
        }
        h2.putUnencodedChars(s);
        assertEquals(h1.hash(), h2.hash());
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/escape/ArrayBasedUnicodeEscaper.java

       *
       * @return the replacement characters, or {@code null} if no escaping was required
       */
      @Override
      @CheckForNull
      protected final char[] escape(int cp) {
        if (cp < replacementsLength) {
          char[] chars = replacements[cp];
          if (chars != null) {
            return chars;
          }
        }
        if (cp >= safeMin && cp <= safeMax) {
          return null;
        }
        return escapeUnsafe(cp);
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 8.5K bytes
    - Viewed (0)
Back to top