コード例 #1
0
  protected Object createArrays() {
    ItemArrays itemArrays = new ItemArrays();
    itemArrays._typedPrimitiveArray = new short[data.length];
    System.arraycopy(data, 0, itemArrays._typedPrimitiveArray, 0, data.length);

    Short[] dataWrapper = new Short[data.length];
    for (int i = 0; i < data.length; i++) {
      dataWrapper[i] = new Short(data[i]);
    }

    itemArrays._typedWrapperArray = new Short[data.length + 1];
    System.arraycopy(dataWrapper, 0, itemArrays._typedWrapperArray, 0, dataWrapper.length);

    initializeUntypedObjectArray(itemArrays, dataWrapper);

    short[] primitiveArray = new short[data.length];
    System.arraycopy(data, 0, primitiveArray, 0, data.length);
    itemArrays._primitiveArrayInObject = primitiveArray;

    Short[] wrapperArray = new Short[data.length + 1];
    System.arraycopy(dataWrapper, 0, wrapperArray, 0, dataWrapper.length);
    itemArrays._wrapperArrayInObject = wrapperArray;
    return itemArrays;
  }
コード例 #2
0
 /** @sharpen.remove Cannot convert 'Short[]' to 'object[]' */
 private void initializeUntypedObjectArray(ItemArrays itemArrays, Short[] dataWrapper) {
   itemArrays._untypedObjectArray = new Short[data.length + 1];
   System.arraycopy(dataWrapper, 0, itemArrays._untypedObjectArray, 0, dataWrapper.length);
 }