Skip to content

Commit

Permalink
增加新示例
Browse files Browse the repository at this point in the history
  • Loading branch information
diguage committed May 22, 2023
1 parent 2819d8d commit 95319c6
Show file tree
Hide file tree
Showing 15 changed files with 595 additions and 35 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ target
.factorypath
.asciidoctor/
*.ttf
*.otf
/cfg/gems
fonts.ttf.tgz

*.icloud


12 changes: 0 additions & 12 deletions cfg/fonts/download-fonts.sh

This file was deleted.

Empty file added cfg/gems/.gitkeep
Empty file.
20 changes: 11 additions & 9 deletions cfg/theme/Source-theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ font:
catalog:
merge: true
Source Han Serif SC:
normal: SourceHanSerifSC-Regular.ttf
bold: SourceHanSerifSC-Bold.ttf
italic: SourceHanSerifSC-Medium.ttf
bold_italic: SourceHanSerifSC-SemiBold.ttf
normal: SourceHanSerifSC-Regular.otf
bold: SourceHanSerifSC-Bold.otf
italic: SourceHanSerifSC-Medium.otf
bold_italic: SourceHanSerifSC-SemiBold.otf
#SourceHanSerifSC-Heavy.otf
#SourceHanSerifSC-ExtraLight.otf
#SourceHanSerifSC-Light.otf
Source Code Pro:
normal: SourceCodePro-Regular.ttf
bold: SourceCodePro-Semibold.ttf
italic: SourceCodePro-It.ttf
bold_italic: SourceCodePro-BoldIt.ttf
Emoji: Symbola.ttf
normal: SourceCodePro-Regular.otf
bold: SourceCodePro-Semibold.otf
italic: SourceCodePro-It.otf
bold_italic: SourceCodePro-BoldIt.otf
# Emoji: NotoColorEmoji.ttf
Emoji: NotoEmoji-Regular.ttf
# Emoji: Symbola.ttf
#SourceCodePro-Black.ttf
#SourceCodePro-BlackIt.ttf
#SourceCodePro-ExtraLight.ttf
Expand Down
4 changes: 4 additions & 0 deletions docs/diagram/ack.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@startuml


@enduml
6 changes: 6 additions & 0 deletions docs/java.lang.String.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ include::{sourcedir}/StringUtils.java[]
----
include::{sourcedir}/StringUtilTest.java[]
----


[{java_src_attr}]
----
include::{sourcedir}/StringTest.java[]
----
6 changes: 5 additions & 1 deletion docs/java.util.Iterator.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ ____
....
@startuml
'skinparam nodesep 70
skinparam titleFontSize 30
skinparam defaultFontName Hiragino Sans GB
title <b>迭代器模式</b>
title **迭代器模式**
abstract class Iterator {
+ {abstract} first() :Object
Expand Down Expand Up @@ -64,6 +65,9 @@ Iterator <|-- ConcreteIterator
ConcreteIterator -left-> ConcreteAggregate
ConcreteIterator <.. ConcreteAggregate
skinparam footerFontSize 20
footer D瓜哥 · https://www.diguage.com · 出品
@enduml
....

Expand Down
7 changes: 7 additions & 0 deletions docs/java.util.concurrent.CompletableFuture.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ Java 中的 Promise。
include::{sourcedir}/concurrent/CompletableFutureTest.java[]
----

`CompletableFuture` 实现了 `Future``CompletionStage` 两个接口。

`CompletionStage` 接口声明了大量方法, `thenApply*` 接受 `Function` 对象,可以实现将任务的结果转化成另外一个对象,类似 Java Stream API 中的 `map` 操作; `thenAccept` 接受 `Consumer` 对象,见文知意,就是“消费”异步任务的结果值,类似 Java Stream API 的“终止操作”。



== 参考资料

. https://www.baeldung.com/java-completablefuture[Guide To CompletableFuture | Baeldung]
. https://xie.infoq.cn/article/12fb1f7f825bb27795679ad13[Java 8 的异步利器:CompletableFuture源码解析^]
Loading

0 comments on commit 95319c6

Please sign in to comment.