Skip to content

Commit

Permalink
1.5.7
Browse files Browse the repository at this point in the history
Add Stream/IntStream/.../DoubleStream.scan(seed, accumulator, seedIncluded).

Add ByteStream/IntStream/.../DoubleStream.flatMappToObj(ByteFunction<T[]> mapper).

Add JdbcUtil.batchUpdate/batchInsert(PreparedQuery...).

Improvements and bug fix.
  • Loading branch information
landawn committed Mar 12, 2019
1 parent 84f2ec5 commit 4fc238d
Show file tree
Hide file tree
Showing 66 changed files with 4,740 additions and 1,990 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
### 1.5.7

* Add `Stream.split/splitAt/splitBy/sliding(..., Collector<? super T, A, R> collector)`.

* Add `Stream/IntStream/.../DoubleStream.scan(seed, accumulator, seedIncluded)`.

* Add `ByteStream/IntStream/.../DoubleStream.flatMappToObj(ByteFunction<T[]> mapper)`.

* Add `JdbcUtil.batchUpdate/batchInsert(PreparedQuery...)`.

* Improvements and bug fix.


Expand Down
Binary file modified lib/abacus-util-1.5.7.jar
Binary file not shown.
Binary file modified lib/abacus-util-jdk7-1.5.7.jar
Binary file not shown.
6 changes: 4 additions & 2 deletions src/com/landawn/abacus/android/util/Observer.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,15 @@ public Observer<Timed<T>> timestamp() {

@Override
public O skip(final long n) {
N.checkArgNotNegative(n, "n");

return (O) super.skip(n);

}

@Override
public O limit(final long n) {
return (O) super.limit(n);
public O limit(final long maxSize) {
return (O) super.limit(maxSize);
}

/*
Expand Down
4 changes: 4 additions & 0 deletions src/com/landawn/abacus/core/RowDataSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -8468,6 +8468,8 @@ public long count() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

checkForComodification();

cursor = n > toRowIndex - cursor ? toRowIndex : (int) n + cursor;
Expand Down Expand Up @@ -8558,6 +8560,8 @@ public long count() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

checkForComodification();

cursor = n > toRowIndex - cursor ? toRowIndex : (int) n + cursor;
Expand Down
8 changes: 4 additions & 4 deletions src/com/landawn/abacus/spring/DBUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ public PreparedCallableQuery prepareCallableQuery(final Try.Function<Connection,
return result;
}

private Try.Runnable<SQLException> createCloseHandler(final Connection conn) {
return new Try.Runnable<SQLException>() {
private Runnable createCloseHandler(final Connection conn) {
return new Runnable() {
@Override
public void run() throws SQLException {
DataSourceUtils.doReleaseConnection(conn, ds);
public void run() {
DataSourceUtils.releaseConnection(conn, ds);
}
};
}
Expand Down
6 changes: 3 additions & 3 deletions src/com/landawn/abacus/util/Array.java
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ static <T> void sort(final List<? extends T> c, final int fromIndex, final int t

try {
array = (T[]) N.listElementDataField.get(c);
} catch (Exception e) {
} catch (Throwable e) {
// ignore;
N.isListElementDataFieldGettable = false;
}
Expand Down Expand Up @@ -2561,7 +2561,7 @@ static <T> void parallelSort(final List<? extends T> c, final int fromIndex, fin

try {
array = (T[]) N.listElementDataField.get(c);
} catch (Exception e) {
} catch (Throwable e) {
// ignore;
N.isListElementDataFieldGettable = false;
}
Expand Down Expand Up @@ -3281,7 +3281,7 @@ static <T> int binarySearch(final List<? extends T> list, final int fromIndex, f

try {
array = (T[]) N.listElementDataField.get(list);
} catch (Exception e) {
} catch (Throwable e) {
// ignore;
N.isListElementDataFieldGettable = false;
}
Expand Down
14 changes: 14 additions & 0 deletions src/com/landawn/abacus/util/BooleanMatrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,8 @@ public Boolean next() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1094,6 +1096,8 @@ public Boolean next() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1159,6 +1163,8 @@ public Boolean next() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

if (n >= (toRowIndex - i) * cols * 1L - j) {
i = toRowIndex;
j = 0;
Expand Down Expand Up @@ -1252,6 +1258,8 @@ public Boolean next() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

if (n >= (toColumnIndex - j) * BooleanMatrix.this.rows * 1L - i) {
i = 0;
j = toColumnIndex;
Expand Down Expand Up @@ -1331,6 +1339,8 @@ public Stream<Boolean> next() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1402,6 +1412,8 @@ public Boolean next() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor2 = n < toIndex2 - cursor2 ? cursor2 + (int) n : toIndex2;
}

Expand All @@ -1414,6 +1426,8 @@ public long count() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down
14 changes: 14 additions & 0 deletions src/com/landawn/abacus/util/ByteMatrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,8 @@ public byte nextByte() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1431,6 +1433,8 @@ public byte nextByte() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1496,6 +1500,8 @@ public byte nextByte() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

if (n >= (toRowIndex - i) * cols * 1L - j) {
i = toRowIndex;
j = 0;
Expand Down Expand Up @@ -1585,6 +1591,8 @@ public byte nextByte() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

if (n >= (toColumnIndex - j) * ByteMatrix.this.rows * 1L - i) {
i = 0;
j = toColumnIndex;
Expand Down Expand Up @@ -1661,6 +1669,8 @@ public ByteStream next() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1732,6 +1742,8 @@ public byte nextByte() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor2 = n < toIndex2 - cursor2 ? cursor2 + (int) n : toIndex2;
}

Expand All @@ -1744,6 +1756,8 @@ public long count() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down
14 changes: 14 additions & 0 deletions src/com/landawn/abacus/util/CharMatrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,8 @@ public char nextChar() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1397,6 +1399,8 @@ public char nextChar() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1462,6 +1466,8 @@ public char nextChar() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

if (n >= (toRowIndex - i) * cols * 1L - j) {
i = toRowIndex;
j = 0;
Expand Down Expand Up @@ -1552,6 +1558,8 @@ public char nextChar() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

if (n >= (toColumnIndex - j) * CharMatrix.this.rows * 1L - i) {
i = 0;
j = toColumnIndex;
Expand Down Expand Up @@ -1628,6 +1636,8 @@ public CharStream next() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1699,6 +1709,8 @@ public char nextChar() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor2 = n < toIndex2 - cursor2 ? cursor2 + (int) n : toIndex2;
}

Expand All @@ -1711,6 +1723,8 @@ public long count() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down
14 changes: 14 additions & 0 deletions src/com/landawn/abacus/util/DoubleMatrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,8 @@ public double nextDouble() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1377,6 +1379,8 @@ public double nextDouble() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1433,6 +1437,8 @@ public double nextDouble() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

if (n >= (toRowIndex - i) * cols * 1L - j) {
i = toRowIndex;
j = 0;
Expand Down Expand Up @@ -1523,6 +1529,8 @@ public double nextDouble() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

if (n >= (toColumnIndex - j) * DoubleMatrix.this.rows * 1L - i) {
i = 0;
j = toColumnIndex;
Expand Down Expand Up @@ -1599,6 +1607,8 @@ public DoubleStream next() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down Expand Up @@ -1670,6 +1680,8 @@ public double nextDouble() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor2 = n < toIndex2 - cursor2 ? cursor2 + (int) n : toIndex2;
}

Expand All @@ -1682,6 +1694,8 @@ public long count() {

@Override
public void skip(long n) {
N.checkArgNotNegative(n, "n");

cursor = n < toIndex - cursor ? cursor + (int) n : toIndex;
}

Expand Down
Loading

0 comments on commit 4fc238d

Please sign in to comment.