Skip to content

Commit

Permalink
1.5.6
Browse files Browse the repository at this point in the history
Move f.copy(Class<T[][]>, Object[][] to N.

Remove Collectors.pairing, replaced by Collectors.combine.

Change the implementation of ParallelArrayStream/ParallelIteratorStream.collect(Collector): All Collector will be executed with multiple threads, regardless the Characteristics.

Improvements and bug fix.
  • Loading branch information
landawn committed Mar 8, 2019
1 parent a090233 commit af356b6
Show file tree
Hide file tree
Showing 11 changed files with 201 additions and 342 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<classpathentry kind="lib" path="lib/neo4j-ogm-core-2.0.0-M03.jar"/>
<classpathentry kind="lib" path="lib/neo4j-ogm-http-driver-2.0.0-M03.jar"/>
<classpathentry kind="lib" path="lib/javaee-api-7.0.jar"/>
<classpathentry kind="lib" path="lib/abacus-util-1.5.5.jar" sourcepath="C:/Users/haiyangl/AppData/Local/Temp/decompiler/source/abacus-util-1.3.29-sources.jar"/>
<classpathentry kind="lib" path="lib/abacus-util-1.5.6.jar" sourcepath="C:/Users/haiyangl/AppData/Local/Temp/decompiler/source/abacus-util-1.3.29-sources.jar"/>
<classpathentry kind="lib" path="lib/jackson-annotations-2.6.3.jar"/>
<classpathentry kind="lib" path="lib/okhttp-3.13.1.jar" sourcepath="C:/Users/haiyangl/AppData/Local/Temp/decompiler/source/okhttp-3.2.0-sources.jar"/>
<classpathentry kind="lib" path="lib/okhttp-urlconnection-3.2.0.jar"/>
Expand Down
11 changes: 11 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### 1.5.6

* Move `f.copy(Class<T[][]>, Object[][]` to `N`.

* Remove `Collectors.pairing`, replaced by `Collectors.combine`.

* Change the implementation of `ParallelArrayStream/ParallelIteratorStream.collect(Collector)`: All `Collector` will be executed with multiple threads, regardless the `Characteristics`.

* Improvements and bug fix.


### 1.5.5

* Add `Multimap.forEachKey/forEachValue/flatForEachValue`.
Expand Down
Binary file modified docs/EntryStream.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/f.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
42 changes: 42 additions & 0 deletions src/com/landawn/abacus/util/N.java
Original file line number Diff line number Diff line change
Expand Up @@ -11647,6 +11647,48 @@ public static <T> T[][][] clone(final T[][][] original) {
return cp;
}

public static <T> T[] copy(Class<T[]> newType, Object[] a) {
if (N.isNullOrEmpty(a)) {
return N.newArray(newType.getComponentType(), 0);
}

return N.copyOf(a, a.length, newType);
}

public static <T> T[][] copy(Class<T[][]> newType, Object[][] a) {
final Class<T[]> componentType = (Class<T[]>) newType.getComponentType();

if (N.isNullOrEmpty(a)) {
return N.newArray(componentType, 0);
}

final int len = N.len(a);
final T[][] result = N.newArray(componentType, len);

for (int i = 0; i < len; i++) {
result[i] = copy(componentType, a[i]);
}

return result;
}

public static <T> T[][][] copy(Class<T[][][]> newType, Object[][][] a) {
final Class<T[][]> componentType = (Class<T[][]>) newType.getComponentType();

if (N.isNullOrEmpty(a)) {
return N.newArray(componentType, 0);
}

final int len = N.len(a);
final T[][][] result = N.newArray(componentType, len);

for (int i = 0; i < len; i++) {
result[i] = copy(componentType, a[i]);
}

return result;
}

public static void sort(final boolean[] a) {
Array.sort(a);
}
Expand Down
Loading

0 comments on commit af356b6

Please sign in to comment.