Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for newArray (0.47 sec)

  1. guava-tests/test/com/google/common/collect/ObjectArraysTest.java

      }
    
      @GwtIncompatible // ObjectArrays.newArray(Class, int)
      public void testNewArray_fromClass_Empty() {
        String[] empty = ObjectArrays.newArray(String.class, 0);
        assertEquals(String[].class, empty.getClass());
        assertThat(empty).isEmpty();
      }
    
      @GwtIncompatible // ObjectArrays.newArray(Class, int)
      public void testNewArray_fromClass_Nonempty() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/ObjectArrays.java

       * @param length the length of the new array
       */
      public static <T extends @Nullable Object> T[] newArray(T[] reference, int length) {
        return Platform.newArray(reference, length);
      }
    
      /**
       * Returns a new array that contains the concatenated contents of two arrays.
       *
       * @param first the first array of elements to concatenate
       * @param second the second array of elements to concatenate
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Jun 12 15:59:22 GMT 2023
    - 9K bytes
    - Viewed (0)
  3. src/main/java/org/codelibs/fess/mylasta/direction/sponsor/FessMultipartRequestHandler.java

            final String[] newArray;
            if (oldArray != null) {
                newArray = new String[oldArray.length + 1];
                System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);
                newArray[oldArray.length] = value;
            } else {
                newArray = new String[] { value };
            }
            elementsText.put(name, newArray);
            elementsAll.put(name, newArray);
        }
    Java
    - Registered: Mon Apr 22 08:04:10 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 16.4K bytes
    - Viewed (0)
  4. src/test/java/org/codelibs/core/collection/ArrayUtilTest.java

            final String[] newArray = ArrayUtil.remove(array, "333");
            assertThat(newArray.length, is(2));
            assertThat(newArray[0], is("111"));
            assertThat(newArray[1], is("222"));
        }
    
        /**
         * @throws Exception
         */
        @Test
        public void testRemoveNothing() throws Exception {
            final String[] array = new String[] { "111", "222", "333" };
    Java
    - Registered: Fri Apr 26 20:58:09 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/collect/ObjectArraysTest.java

      }
    
      @GwtIncompatible // ObjectArrays.newArray(Class, int)
      public void testNewArray_fromClass_Empty() {
        String[] empty = ObjectArrays.newArray(String.class, 0);
        assertEquals(String[].class, empty.getClass());
        assertThat(empty).isEmpty();
      }
    
      @GwtIncompatible // ObjectArrays.newArray(Class, int)
      public void testNewArray_fromClass_Nonempty() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 8.8K bytes
    - Viewed (0)
  6. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/Platform.java

      }
    
      static <T> T[] newArray(T[] reference, int length) {
        T[] empty = reference.length == 0 ? reference : Arrays.copyOf(reference, 0);
        return Arrays.copyOf(empty, length);
      }
    
      /** Equivalent to Arrays.copyOfRange(source, from, to, arrayOfType.getClass()). */
      static <T> T[] copy(Object[] source, int from, int to, T[] arrayOfType) {
        T[] result = newArray(arrayOfType, to - from);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Jun 29 18:16:45 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  7. src/main/java/org/codelibs/core/collection/ArrayUtil.java

            final T[] newArray = (T[]) Array.newInstance(array.getClass().getComponentType(), array.length - 1);
            if (index > 0) {
                System.arraycopy(array, 0, newArray, 0, index);
            }
            if (index < array.length - 1) {
                System.arraycopy(array, index + 1, newArray, index, newArray.length - index);
            }
            return newArray;
        }
    
        /**
    Java
    - Registered: Fri Apr 26 20:58:09 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 42.6K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/primitives/BytesTest.java

        byte[] array = {(byte) 0, (byte) 1, (byte) 2};
        List<Byte> list = Bytes.asList(array);
        byte[] newArray = Bytes.toArray(list);
    
        // Make sure it returned a copy
        list.set(0, (byte) 4);
        assertThat(newArray).isEqualTo(new byte[] {(byte) 0, (byte) 1, (byte) 2});
        newArray[1] = (byte) 5;
        assertThat((byte) list.get(1)).isEqualTo((byte) 1);
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 16:10:08 GMT 2024
    - 16.4K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/ForwardingCollection.java

       * this implementation.
       *
       * @since 7.0
       */
      protected @Nullable Object[] standardToArray() {
        @Nullable Object[] newArray = new @Nullable Object[size()];
        return toArray(newArray);
      }
    
      /**
       * A sensible definition of {@link #toArray(Object[])} in terms of {@link #size} and {@link
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jun 29 19:42:21 GMT 2021
    - 8.2K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/primitives/FloatsTest.java

        float[] array = {(float) 0, (float) 1, (float) 2};
        List<Float> list = Floats.asList(array);
        float[] newArray = Floats.toArray(list);
    
        // Make sure it returned a copy
        list.set(0, (float) 4);
        assertThat(newArray).isEqualTo(new float[] {(float) 0, (float) 1, (float) 2});
        newArray[1] = (float) 5;
        assertThat((float) list.get(1)).isEqualTo((float) 1);
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Feb 29 15:43:06 GMT 2024
    - 29.5K bytes
    - Viewed (0)
Back to top