Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 57 for clone (0.13 sec)

  1. guava/src/com/google/common/collect/ImmutableEnumSet.java

        }
      }
    
      /*
       * Notes on EnumSet and <E extends Enum<E>>:
       *
       * This class isn't an arbitrary ForwardingImmutableSet because we need to
       * know that calling {@code clone()} during deserialization will return an
       * object that no one else has a reference to, allowing us to guarantee
       * immutability. Hence, we support only {@link EnumSet}.
       */
      private final transient EnumSet<E> delegate;
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 4.5K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java

          oos.writeObject(o);
          oos.flush();
          oos.close();
          ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray()));
          T clone = (T) ois.readObject();
          assertSame(o.getClass(), clone.getClass());
          return clone;
        } catch (Throwable t) {
          threadUnexpectedException(t);
          return null;
        }
      }
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 37.7K bytes
    - Viewed (0)
  3. guava-testlib/src/com/google/common/collect/testing/MinimalCollection.java

      MinimalCollection(Class<? super @NonNull E> type, boolean allowNulls, E... contents) {
        // TODO: consider making it shuffle the contents to test iteration order.
        this.contents = Platform.clone(contents);
        this.type = type;
        this.allowNulls = allowNulls;
    
        if (!allowNulls) {
          for (Object element : contents) {
            if (element == null) {
              throw new NullPointerException();
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  4. guava-testlib/src/com/google/common/collect/testing/Helpers.java

    @GwtCompatible(emulated = true)
    @ElementTypesAreNonnullByDefault
    public class Helpers {
      // Clone of Objects.equal
      static boolean equal(@Nullable Object a, @Nullable Object b) {
        return a == b || (a != null && a.equals(b));
      }
    
      // Clone of Lists.newArrayList
      public static <E extends @Nullable Object> List<E> copyToList(Iterable<? extends E> elements) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Feb 26 19:46:10 GMT 2024
    - 17.7K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java

          oos.writeObject(o);
          oos.flush();
          oos.close();
          ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray()));
          T clone = (T) ois.readObject();
          assertSame(o.getClass(), clone.getClass());
          return clone;
        } catch (Throwable t) {
          threadUnexpectedException(t);
          return null;
        }
      }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 37.2K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/ImmutableSortedSet.java

       * @since 3.0
       */
      public static <E extends Comparable<? super E>> ImmutableSortedSet<E> copyOf(E[] elements) {
        return construct(Ordering.natural(), elements.length, elements.clone());
      }
    
      /**
       * Returns an immutable sorted set containing the given elements sorted by their natural ordering.
       * When multiple elements are equivalent according to {@code compareTo()}, only the first one
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed May 01 18:44:57 GMT 2024
    - 36.9K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/reflect/TypesTest.java

            .asList()
            .containsExactlyElementsIn(asList(expected.getBounds()))
            .inOrder();
      }
    
      /**
       * Working with arrays requires defensive code. Verify that we clone the type array for both input
       * and output.
       */
      public void testNewParameterizedTypeImmutability() {
        Type[] typesIn = {String.class, Integer.class};
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 14.8K bytes
    - Viewed (0)
  8. android/guava-testlib/src/com/google/common/collect/testing/MinimalCollection.java

      MinimalCollection(Class<? super @NonNull E> type, boolean allowNulls, E... contents) {
        // TODO: consider making it shuffle the contents to test iteration order.
        this.contents = Platform.clone(contents);
        this.type = type;
        this.allowNulls = allowNulls;
    
        if (!allowNulls) {
          for (Object element : contents) {
            if (element == null) {
              throw new NullPointerException();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/primitives/UnsignedBytesTest.java

                UnsignedBytes.lexicographicalComparatorJavaImpl())) {
          for (int trials = 10; trials-- > 0; ) {
            byte[] left = new byte[1 + rnd.nextInt(32)];
            rnd.nextBytes(left);
            byte[] right = left.clone();
            assertThat(comparator.compare(left, right)).isEqualTo(0);
            int i = rnd.nextInt(left.length);
            left[i] ^= (byte) (1 + rnd.nextInt(255));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 13.4K bytes
    - Viewed (0)
  10. guava/src/com/google/common/collect/ImmutableList.java

        switch (elements.length) {
          case 0:
            return of();
          case 1:
            return of(elements[0]);
          default:
            return construct(elements.clone());
        }
      }
    
      /**
       * Returns an immutable list containing the given elements, sorted according to their natural
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 30K bytes
    - Viewed (1)
Back to top