Skip to content

Commit

Permalink
1.7.4
Browse files Browse the repository at this point in the history
    Add `Stream.reduce(U identity, BiFunction<U, ? super T, U>
accumulator, BinaryOperator<U> combiner)`.

    Rename `JdbcUtil.RecordGetter/RecordConsumer/RecordPredicate` to
`RowMapper/RowConsumer/RowFilter`.

    Improvements and bug fix.
  • Loading branch information
landawn committed Jun 2, 2019
1 parent 3d66248 commit 6de04d7
Show file tree
Hide file tree
Showing 38 changed files with 1,432 additions and 995 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<classpathentry kind="src" path="schema"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="C:/Users/haiyangl/Landawn/AbacusUtil/trunk/lib/abacus-util-1.7.3.jar"/>
<classpathentry kind="lib" path="lib/abacus-util-1.7.4.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2-api-2.3.jar"/>
<classpathentry kind="lib" path="lib/log4j-api-2.3.jar"/>
<classpathentry kind="lib" path="lib/log4j-core-2.3.jar"/>
Expand Down
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### 1.7.4

* Add `Stream.reduce(U identity, BiFunction<U, ? super T, U> accumulator, BinaryOperator<U> combiner)`.

* Rename `JdbcUtil.RecordGetter/RecordConsumer/RecordPredicate` to `RowMapper/RowConsumer/RowFilter`.

* Improvements and bug fix.


### 1.7.3

* Add `ContinuableFuture.map`.
Expand Down
64 changes: 32 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,32 +183,32 @@ A general programming library in Java/Android. It's easy to learn and simple to
[RemoteExecutor](https://cdn.rawgit.com/landawn/AbacusUtil/master/docs/RemoteExecutor_view.html).

* More:
[Charsets](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/Charsets.html),
[Ascii](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/Ascii.html),
[CalendarUnit](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/CalendarUnit.html),
[NamingPolicy](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/NamingPolicy.html),
[Properties](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/Properties.html),
[PropertiesUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/PropertiesUtil.html),
[Wrapper](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/Wrapper.html),
[ArrayHashSet](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/ArrayHashSet.html),
[ArrayHashMap](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/ArrayHashMap.html),
[ClassUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/ClassUtil.html),
[EscapeUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/EscapeUtil.html),
[RegExUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/RegExUtil.html),
[FilenameUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/FilenameUtil.html),
[AWSJSONUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/AWSJSONUtil.html),
[AddrUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/AddrUtil.html),
[WSSecurityUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/WSSecurityUtil.html),
[EmailUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/EmailUtil.html),
[IEEE754rUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/IEEE754rUtil.html),
[Index](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/Index.html),
[Median](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/Median.html),
[f](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/f.html),
[Matth](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/Matth.html),
[SafeInitializer](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/SafeInitializer.html),
[Stopwatch](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/Stopwatch.html),
[RateLimiter](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/RateLimiter.html),
[Traverser](https://static.javadoc.io/com.landawn/abacus-util/1.7.3/com/landawn/abacus/util/Traverser.html)(from Apache commons, Google Guava...) ...
[Charsets](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/Charsets.html),
[Ascii](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/Ascii.html),
[CalendarUnit](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/CalendarUnit.html),
[NamingPolicy](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/NamingPolicy.html),
[Properties](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/Properties.html),
[PropertiesUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/PropertiesUtil.html),
[Wrapper](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/Wrapper.html),
[ArrayHashSet](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/ArrayHashSet.html),
[ArrayHashMap](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/ArrayHashMap.html),
[ClassUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/ClassUtil.html),
[EscapeUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/EscapeUtil.html),
[RegExUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/RegExUtil.html),
[FilenameUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/FilenameUtil.html),
[AWSJSONUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/AWSJSONUtil.html),
[AddrUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/AddrUtil.html),
[WSSecurityUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/WSSecurityUtil.html),
[EmailUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/EmailUtil.html),
[IEEE754rUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/IEEE754rUtil.html),
[Index](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/Index.html),
[Median](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/Median.html),
[f](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/f.html),
[Matth](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/Matth.html),
[SafeInitializer](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/SafeInitializer.html),
[Stopwatch](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/Stopwatch.html),
[RateLimiter](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/RateLimiter.html),
[Traverser](https://static.javadoc.io/com.landawn/abacus-util/1.7.4/com/landawn/abacus/util/Traverser.html)(from Apache commons, Google Guava...) ...


## Download/Installation & [Changes](https://github.com/landawn/AbacusUtil/blob/master/CHANGES.md):
Expand All @@ -218,22 +218,22 @@ A general programming library in Java/Android. It's easy to learn and simple to
* Gradle:
```gradle
// JDK 1.8 or above:
compile 'com.landawn:abacus-util:1.7.3'
compile 'com.landawn:abacus-util:1.7.4'
// JDK 1.7:
compile 'com.landawn:abacus-util-jdk7:1.7.3'
compile 'com.landawn:abacus-util-jdk7:1.7.4'
// Android (Java 1.7):
compile 'abacus-android-jdk7:1.7.3'
compile 'abacus-android-jdk7:1.7.4'
// Android-SE (Java 1.7) - small edition without Stream/Matrix/Sheet/...:
compile 'abacus-android-se-jdk7:1.7.3'
compile 'abacus-android-se-jdk7:1.7.4'
// Android (Java 1.8 or above):
compile 'com.landawn:abacus-android:1.7.3'
compile 'com.landawn:abacus-android:1.7.4'
// Android-SE (Java 1.8 or above) - small edition without Stream/Matrix/Sheet/...:
compile 'com.landawn:abacus-android-se:1.7.3'
compile 'com.landawn:abacus-android-se:1.7.4'
```
### Functional Programming:
(It's very important to learn Lambdas and Stream APIs in Java 8 to get the best user experiences with the APIs provided in AbacusUtil)
Expand Down
Binary file modified docs/ExceptionalStream.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/Seq.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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
98 changes: 86 additions & 12 deletions src/com/landawn/abacus/DataSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
* @author Haiyang Li
*
* @see com.landawn.abacus.util.DataSetUtil
* @see com.landawn.abacus.util.Build.DataSetBuilder
* @see com.landawn.abacus.util.JdbcUtil
* @see com.landawn.abacus.util.CSVUtil
* @see com.landawn.abacus.util.function.IntFunction
Expand Down Expand Up @@ -186,6 +187,8 @@ public interface DataSet {
void swapRows(int rowIndexA, int rowIndexB);

/**
* There is NO underline auto-conversion from column value to target type: {@code T}.
* So the column values must be the type which is assignable to target type.
*
* @param rowIndex
* @param columnIndex
Expand All @@ -194,12 +197,17 @@ public interface DataSet {
<T> T get(int rowIndex, int columnIndex);

/**
* @param targetClass
* There is NO underline auto-conversion from column value to target type: {@code T}.
* So the column values must be the type which is assignable to target type.
*
* @param targetType
* @param rowIndex
* @param columnIndex
* @return
* @deprecated may be misused because it implies there is an underline auto-conversion from column values to target return type but actually there is not.
*/
<T> T get(Class<T> targetClass, int rowIndex, int columnIndex);
@Deprecated
<T> T get(Class<T> targetType, int rowIndex, int columnIndex);

/**
*
Expand All @@ -217,39 +225,54 @@ public interface DataSet {
*/
boolean isNull(int rowIndex, int columnIndex);

/**
/**
* There is NO underline auto-conversion from column value to target type: {@code T}.
* So the column values must be the type which is assignable to target type.
*
* @param columnIndex
* @return
*/
<T> T get(int columnIndex);

/**
/**
* There is NO underline auto-conversion from column value to target type: {@code T}.
* So the column values must be the type which is assignable to target type.
*
* @param targetClass
* @param columnIndex
* @param columnName
* @return
*/
<T> T get(Class<T> targetClass, int columnIndex);
<T> T get(String columnName);

/**
* There is NO underline auto-conversion from column value to target type: {@code T}.
* So the column values must be the type which is assignable to target type.
*
* @param columnName
* @param targetType
* @param columnIndex
* @return
* @deprecated may be misused because it implies there is an underline auto-conversion from column values to target return type but actually there is not.
*/
<T> T get(String columnName);
@Deprecated
<T> T get(Class<T> targetType, int columnIndex);

/**
/**
* There is NO underline auto-conversion from column value to target type: {@code T}.
* So the column values must be the type which is assignable to target type.
*
* @param targetClass
* @param targetType
* @param columnName
* @return
* @deprecated may be misused because it implies there is an underline auto-conversion from column values to target return type but actually there is not.
*/
<T> T get(Class<T> targetClass, String columnName);
@Deprecated
<T> T get(Class<T> targetType, String columnName);

/**
* Returns the value from the current row and specified column if the specified {@code columnIndex} is equal or bigger than zero,
* or the specified {@code defaultValue} otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code T}.
* So the column values must be the type which is assignable to target type.
*
* @param columnIndex
* @param defaultValue
Expand All @@ -262,6 +285,9 @@ public interface DataSet {
/**
* Returns the value from the current row and specified column if the specified {@code columnName} exists,
* or the specified {@code defaultValue} otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code T}.
* So the column values must be the type which is assignable to target type.
*
* @param columnName
* @param defaultValue
Expand All @@ -273,6 +299,9 @@ public interface DataSet {

/**
* Return default value (false) if the property is null.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Boolean}.
* So the column values must be the type which is assignable to target type.
*
* @param columnIndex
* @return
Expand All @@ -281,6 +310,9 @@ public interface DataSet {

/**
* Return default value (false) if the property is null.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Boolean}.
* So the column values must be the type which is assignable to target type.
*
* @param columnName
* @return
Expand All @@ -289,6 +321,9 @@ public interface DataSet {

/**
* Return default value (0) if the property is null.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Character}.
* So the column values must be the type which is assignable to target type.
*
* @param columnIndex
* @return
Expand All @@ -297,6 +332,9 @@ public interface DataSet {

/**
* Return default value (0) if the property is null.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Character}.
* So the column values must be the type which is assignable to target type.
*
* @param columnName
* @return
Expand All @@ -305,6 +343,9 @@ public interface DataSet {

/**
* Return default value (0) if the property is null. Return Number.byteValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Byte}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnIndex
* @return
Expand All @@ -313,6 +354,9 @@ public interface DataSet {

/**
* Return default value (0) if the property is null. Return Number.byteValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Byte}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnName
* @return
Expand All @@ -321,6 +365,9 @@ public interface DataSet {

/**
* Return default value (0) if the property is null. Return Number.shortValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Short}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnIndex
* @return
Expand All @@ -329,6 +376,9 @@ public interface DataSet {

/**
* Return default value (0) if the property is null. Return Number.shortValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Short}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnName
* @return
Expand All @@ -337,6 +387,9 @@ public interface DataSet {

/**
* Return default value (0) if the property is null. Return Number.intValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Integer}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnIndex
* @return
Expand All @@ -345,6 +398,9 @@ public interface DataSet {

/**
* Return default value (0) if the property is null. Return Number.intValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Integer}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnName
* @return
Expand All @@ -353,6 +409,9 @@ public interface DataSet {

/**
* Return default value (0) if the property is null. Return Number.longValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Long}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnIndex
* @return
Expand All @@ -361,6 +420,9 @@ public interface DataSet {

/**
* Return default value (0) if the property is null. Return Number.longValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Long}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnName
* @return
Expand All @@ -369,6 +431,9 @@ public interface DataSet {

/**
* Return default value (0f) if the property is null. Return Number.floatValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Float}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnIndex
* @return
Expand All @@ -377,6 +442,9 @@ public interface DataSet {

/**
* Return default value (0f) if the property is null. Return Number.floatValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Float}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnName
* @return
Expand All @@ -385,6 +453,9 @@ public interface DataSet {

/**
* Return default value (0d) if the property is null. Return Number.doubleValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Double}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnIndex
* @return
Expand All @@ -393,6 +464,9 @@ public interface DataSet {

/**
* Return default value (0d) if the property is null. Return Number.doubleValue() otherwise.
* <br />
* There is NO underline auto-conversion from column value to target type: {@code Double}.
* So the column values must be the type which is assignable to target type, or {@code Number}.
*
* @param columnName
* @return
Expand Down
Loading

0 comments on commit 6de04d7

Please sign in to comment.