Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 6,864 for copyOf (0.19 sec)

  1. guava-tests/test/com/google/common/primitives/ImmutableIntArrayTest.java

         */
        assertThat(ImmutableIntArray.copyOf(new int[0])).isSameInstanceAs(ImmutableIntArray.of());
      }
    
      public void testCopyOf_array_nonempty() {
        int[] array = new int[] {0, 1, 3};
        ImmutableIntArray iia = ImmutableIntArray.copyOf(array);
        array[2] = 2;
        assertThat(iia.asList()).containsExactly(0, 1, 3).inOrder();
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Jun 01 09:32:35 GMT 2023
    - 20.2K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/primitives/ImmutableLongArrayTest.java

         */
        assertThat(ImmutableLongArray.copyOf(new long[0])).isSameInstanceAs(ImmutableLongArray.of());
      }
    
      public void testCopyOf_array_nonempty() {
        long[] array = new long[] {0, 1, 3};
        ImmutableLongArray iia = ImmutableLongArray.copyOf(array);
        array[2] = 2;
        assertThat(iia.asList()).containsExactly(0L, 1L, 3L).inOrder();
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Jun 01 09:32:35 GMT 2023
    - 19K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/collect/ImmutableListCopyOfConcurrentlyModifiedInputTest.java

      }
    
      private static ImmutableList<Integer> elements(Integer... elements) {
        return ImmutableList.copyOf(elements);
      }
    
      private static ImmutableList<ListFrobber> ops(ListFrobber... elements) {
        return ImmutableList.copyOf(elements);
      }
    
      public void testCopyOf_concurrentlyMutatedList() {
        runConcurrentlyMutatedTest(WrapWithIterable.NO_WRAP);
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 20:09:59 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/collect/ImmutableClassToInstanceMapTest.java

      public void testCopyOf_map_empty() {
        Map<Class<?>, Object> in = Collections.emptyMap();
        ClassToInstanceMap<Object> map = ImmutableClassToInstanceMap.copyOf(in);
        assertTrue(map.isEmpty());
        assertSame(map, ImmutableClassToInstanceMap.of());
        assertSame(map, ImmutableClassToInstanceMap.copyOf(map));
      }
    
      public void testOf_zero() {
        assertTrue(ImmutableClassToInstanceMap.of().isEmpty());
      }
    
      public void testOf_one() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 20:09:59 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/ImmutableMultisetTest.java

        String[] array = new String[0];
        Multiset<String> multiset = ImmutableMultiset.copyOf(array);
        assertTrue(multiset.isEmpty());
      }
    
      public void testCreation_arrayOfOneElement() {
        String[] array = new String[] {"a"};
        Multiset<String> multiset = ImmutableMultiset.copyOf(array);
        assertEquals(HashMultiset.create(asList("a")), multiset);
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 25.1K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/ImmutableSortedSet.java

       */
      public static <E> ImmutableSortedSet<E> copyOf(
          Comparator<? super E> comparator, Collection<? extends E> elements) {
        return copyOf(comparator, (Iterable<? extends E>) elements);
      }
    
      /**
       * Returns an immutable sorted set containing the elements of a sorted set, sorted by the same
       * {@code Comparator}. That behavior differs from {@link #copyOf(Iterable)}, which always uses the
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 38.5K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/collect/ImmutableSetMultimapTest.java

        input.put("foo", 3);
        input.put("foo", 1);
        ImmutableSetMultimap<Object, Object> copy = ImmutableSetMultimap.copyOf(input);
        assertEquals(3, copy.size());
      }
    
      public void testCopyOfEmpty() {
        HashMultimap<String, Integer> input = HashMultimap.create();
        Multimap<String, Integer> multimap = ImmutableSetMultimap.copyOf(input);
        assertEquals(multimap, input);
        assertEquals(input, multimap);
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 24.9K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/ImmutableSortedMultiset.java

       *     ImmutableSortedMultiset#copyOf(Comparable[])}.</b>
       */
      @DoNotCall("Elements must be Comparable. (Or, pass a Comparator to orderedBy or copyOf.)")
      @Deprecated
      // The usage of "Z" here works around bugs in Javadoc (JDK-8318093) and JDiff.
      public static <Z> ImmutableSortedMultiset<Z> copyOf(Z[] elements) {
        throw new UnsupportedOperationException();
      }
    
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 29.6K bytes
    - Viewed (0)
  9. guava/src/com/google/common/collect/ImmutableSet.java

       *
       * <p><b>Performance note:</b> This method will sometimes recognize that the actual copy operation
       * is unnecessary; for example, {@code copyOf(copyOf(anArrayList))} will copy the data only once.
       * This reduces the expense of habitually making defensive copies at API boundaries. However, the
       * precise conditions for skipping the copy operation are undefined.
       *
       * @throws NullPointerException if any of {@code elements} is null
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 35.4K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/RegularImmutableTable.java

        ImmutableList<Cell<R, C, V>> cellList = ImmutableList.copyOf(cells);
        for (Cell<R, C, V> cell : cells) {
          rowSpaceBuilder.add(cell.getRowKey());
          columnSpaceBuilder.add(cell.getColumnKey());
        }
    
        ImmutableSet<R> rowSpace =
            (rowComparator == null)
                ? ImmutableSet.copyOf(rowSpaceBuilder)
                : ImmutableSet.copyOf(ImmutableList.sortedCopyOf(rowComparator, rowSpaceBuilder));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Nov 30 21:54:06 GMT 2023
    - 7.1K bytes
    - Viewed (0)
Back to top