Skip to content

Commit

Permalink
5.6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
haiyangl committed Dec 19, 2024
1 parent aa481e0 commit 9f07195
Show file tree
Hide file tree
Showing 15 changed files with 1,865 additions and 737 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 5.6.9

* Improve javaDoc
* Improvements and bug fixes.

### 5.6.8

* Improve javaDoc
Expand Down
68 changes: 34 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# abacus-common
[![Maven Central](https://img.shields.io/maven-central/v/com.landawn/abacus-common.svg)](https://maven-badges.herokuapp.com/maven-central/com.landawn/abacus-common/)
[![Javadocs](https://img.shields.io/badge/javadoc-5.6.8-brightgreen.svg)](https://www.javadoc.io/doc/com.landawn/abacus-common/5.6.8/index.html)
[![Javadocs](https://img.shields.io/badge/javadoc-5.6.9-brightgreen.svg)](https://www.javadoc.io/doc/com.landawn/abacus-common/5.6.9/index.html)

A general programming library in Java. It's easy to learn and simple to use with concise and powerful APIs.

Expand Down Expand Up @@ -132,7 +132,7 @@ more [Collectors](https://htmlpreview.github.io/?https://github.com/landawn/abac
[HttpClient](https://htmlpreview.github.io/?https://github.com/landawn/abacus-common/master/docs/HttpClient_view.html),
[HttpRequest](https://htmlpreview.github.io/?https://github.com/landawn/abacus-common/master/docs/HttpRequest_view.html),
[OkHttpRequest](https://htmlpreview.github.io/?https://github.com/landawn/abacus-common/master/docs/OkHttpRequest_view.html),
and [More](https://www.javadoc.io/static/com.landawn/abacus-common/5.6.8/com/landawn/abacus/http/package-summary.html) ...
and [More](https://www.javadoc.io/static/com.landawn/abacus-common/5.6.9/com/landawn/abacus/http/package-summary.html) ...

* Pool:
[Pool](https://htmlpreview.github.io/?https://github.com/landawn/abacus-common/master/docs/Pool_view.html),
Expand All @@ -142,36 +142,36 @@ and [More](https://www.javadoc.io/static/com.landawn/abacus-common/5.6.8/com/lan


* More:
[CodeGenerationUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/CodeGenerationUtil.html),
[JsonMappers](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/JsonMappers.html),
[XmlMappers](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/XmlMappers.html),
[Charsets](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/Charsets.html),
[Ascii](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/Ascii.html),
[CalendarField](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/CalendarField.html),
[NamingPolicy](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/NamingPolicy.html),
[Properties](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/Properties.html),
[PropertiesUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/PropertiesUtil.html),
[Configuration](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/Configuration.html),
[XmlUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/XmlUtil.html),
[Wrapper](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/Wrapper.html),
[ClassUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/ClassUtil.html),
[CSVUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/CSVUtil.html),
[EscapeUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/EscapeUtil.html),
[RegExUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/RegExUtil.html),
[FilenameUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/FilenameUtil.html),
[AddrUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/AddrUtil.html),
[WSSecurityUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/WSSecurityUtil.html),
[EmailUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/EmailUtil.html),
[IEEE754rUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/IEEE754rUtil.html),
[Timed](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/Timed.html),
[IndexedKeyed](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/IndexedKeyed.html),
[Median](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/Median.html),
[Stopwatch](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/Stopwatch.html),
[RateLimiter](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/RateLimiter.html),
[TypeReference](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/util/TypeReference.html),
[WebUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/http/WebUtil.html),
[Files](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/guava/Files.html),
[Traverser](https://static.javadoc.io/com.landawn/abacus-common/5.6.8/com/landawn/abacus/guava/Traverser.html)(copied from Apache commons, Google Guava...under Apache License v2) ...
[CodeGenerationUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/CodeGenerationUtil.html),
[JsonMappers](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/JsonMappers.html),
[XmlMappers](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/XmlMappers.html),
[Charsets](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/Charsets.html),
[Ascii](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/Ascii.html),
[CalendarField](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/CalendarField.html),
[NamingPolicy](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/NamingPolicy.html),
[Properties](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/Properties.html),
[PropertiesUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/PropertiesUtil.html),
[Configuration](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/Configuration.html),
[XmlUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/XmlUtil.html),
[Wrapper](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/Wrapper.html),
[ClassUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/ClassUtil.html),
[CSVUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/CSVUtil.html),
[EscapeUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/EscapeUtil.html),
[RegExUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/RegExUtil.html),
[FilenameUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/FilenameUtil.html),
[AddrUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/AddrUtil.html),
[WSSecurityUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/WSSecurityUtil.html),
[EmailUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/EmailUtil.html),
[IEEE754rUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/IEEE754rUtil.html),
[Timed](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/Timed.html),
[IndexedKeyed](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/IndexedKeyed.html),
[Median](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/Median.html),
[Stopwatch](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/Stopwatch.html),
[RateLimiter](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/RateLimiter.html),
[TypeReference](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/util/TypeReference.html),
[WebUtil](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/http/WebUtil.html),
[Files](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/guava/Files.html),
[Traverser](https://static.javadoc.io/com.landawn/abacus-common/5.6.9/com/landawn/abacus/guava/Traverser.html)(copied from Apache commons, Google Guava...under Apache License v2) ...


## Download/Installation & [Changes](https://github.com/landawn/abacus-common/blob/master/CHANGES.md):
Expand All @@ -182,15 +182,15 @@ and [More](https://www.javadoc.io/static/com.landawn/abacus-common/5.6.8/com/lan
<dependency>
<groupId>com.landawn</groupId>
<artifactId>abacus-common</artifactId>
<version>5.6.8</version>
<version>5.6.9</version>
<dependency>
```

* Gradle:

```gradle
// JDK 17 or above:
compile 'com.landawn:abacus-common:5.6.8'
compile 'com.landawn:abacus-common:5.6.9'
```


Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.landawn</groupId>
<artifactId>abacus-common</artifactId>
<version>5.6.9</version>
<version>5.6.10</version>
<packaging>jar</packaging>

<name>abacus-common</name>
Expand Down Expand Up @@ -33,7 +33,7 @@
<dependency>
<groupId>com.landawn</groupId>
<artifactId>abacus-common</artifactId>
<version>5.6.8</version>
<version>5.6.9</version>
<scope>provided</scope>
</dependency>

Expand Down
94 changes: 43 additions & 51 deletions src/main/java/com/landawn/abacus/util/BooleanList.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
import com.landawn.abacus.annotation.Beta;
import com.landawn.abacus.annotation.SuppressFBWarnings;
import com.landawn.abacus.util.u.OptionalBoolean;
import com.landawn.abacus.util.function.BooleanConsumer;
import com.landawn.abacus.util.function.BooleanPredicate;
import com.landawn.abacus.util.function.BooleanUnaryOperator;
import com.landawn.abacus.util.stream.Stream;

/**
Expand Down Expand Up @@ -443,12 +446,10 @@ public boolean removeAll(final boolean[] a) {
/**
* Removes the elements which match the given predicate.
*
* @param <E>
* @param p
* @return
* @throws E the e
*/
public <E extends Exception> boolean removeIf(final Throwables.BooleanPredicate<E> p) throws E {
public boolean removeIf(final BooleanPredicate p) {
final BooleanList tmp = new BooleanList(size());

for (int i = 0; i < size; i++) {
Expand Down Expand Up @@ -734,25 +735,21 @@ public int replaceAll(final boolean oldVal, final boolean newVal) {

/**
*
* @param <E>
* @param operator
* @throws E the e
*/
public <E extends Exception> void replaceAll(final Throwables.BooleanUnaryOperator<E> operator) throws E {
public void replaceAll(final BooleanUnaryOperator operator) {
for (int i = 0, len = size(); i < len; i++) {
elementData[i] = operator.applyAsBoolean(elementData[i]);
}
}

/**
*
* @param <E>
* @param predicate
* @param newValue
* @return
* @throws E the e
*/
public <E extends Exception> boolean replaceIf(final Throwables.BooleanPredicate<E> predicate, final boolean newValue) throws E {
public boolean replaceIf(final BooleanPredicate predicate, final boolean newValue) {
boolean result = false;

for (int i = 0, len = size(); i < len; i++) {
Expand Down Expand Up @@ -1134,25 +1131,20 @@ public int lastIndexOf(final boolean valueToFind, final int startIndexFromBack)

/**
*
* @param <E>
* @param action
* @throws E the e
*/
public <E extends Exception> void forEach(final Throwables.BooleanConsumer<E> action) throws E {
public void forEach(final BooleanConsumer action) {
forEach(0, size, action);
}

/**
*
* @param <E>
* @param fromIndex
* @param toIndex
* @param action
* @throws IndexOutOfBoundsException
* @throws E the e
*/
public <E extends Exception> void forEach(final int fromIndex, final int toIndex, final Throwables.BooleanConsumer<E> action)
throws IndexOutOfBoundsException, E {
public void forEach(final int fromIndex, final int toIndex, final BooleanConsumer action) throws IndexOutOfBoundsException {
N.checkFromToIndex(fromIndex < toIndex ? fromIndex : (toIndex == -1 ? 0 : toIndex), Math.max(fromIndex, toIndex), size);

if (size > 0) {
Expand All @@ -1168,41 +1160,41 @@ public <E extends Exception> void forEach(final int fromIndex, final int toIndex
}
}

/**
*
* @param <E>
* @param action
* @throws E the e
*/
public <E extends Exception> void forEachIndexed(final Throwables.IntBooleanConsumer<E> action) throws E {
forEachIndexed(0, size, action);
}

/**
*
* @param <E>
* @param fromIndex
* @param toIndex
* @param action
* @throws IndexOutOfBoundsException
* @throws E the e
*/
public <E extends Exception> void forEachIndexed(final int fromIndex, final int toIndex, final Throwables.IntBooleanConsumer<E> action)
throws IndexOutOfBoundsException, E {
N.checkFromToIndex(fromIndex < toIndex ? fromIndex : (toIndex == -1 ? 0 : toIndex), Math.max(fromIndex, toIndex), size);

if (size > 0) {
if (fromIndex <= toIndex) {
for (int i = fromIndex; i < toIndex; i++) {
action.accept(i, elementData[i]);
}
} else {
for (int i = N.min(size - 1, fromIndex); i > toIndex; i--) {
action.accept(i, elementData[i]);
}
}
}
}
// /**
// *
// * @param <E>
// * @param action
// * @throws E the e
// */
// public <E extends Exception> void forEachIndexed(final Throwables.IntBooleanConsumer<E> action) throws E {
// forEachIndexed(0, size, action);
// }
//
// /**
// *
// * @param <E>
// * @param fromIndex
// * @param toIndex
// * @param action
// * @throws IndexOutOfBoundsException
// * @throws E the e
// */
// public <E extends Exception> void forEachIndexed(final int fromIndex, final int toIndex, final Throwables.IntBooleanConsumer<E> action)
// throws IndexOutOfBoundsException, E {
// N.checkFromToIndex(fromIndex < toIndex ? fromIndex : (toIndex == -1 ? 0 : toIndex), Math.max(fromIndex, toIndex), size);
//
// if (size > 0) {
// if (fromIndex <= toIndex) {
// for (int i = fromIndex; i < toIndex; i++) {
// action.accept(i, elementData[i]);
// }
// } else {
// for (int i = N.min(size - 1, fromIndex); i > toIndex; i--) {
// action.accept(i, elementData[i]);
// }
// }
// }
// }

public OptionalBoolean first() {
return size() == 0 ? OptionalBoolean.empty() : OptionalBoolean.of(elementData[0]);
Expand Down
Loading

0 comments on commit 9f07195

Please sign in to comment.