-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5d2379
commit f8263b2
Showing
5 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
libraries/event/src/main/java/dev/yumi/commons/event/invoker/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2023 Yumi Project | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
/** | ||
* <h2>The Event Invoker APIs</h2> | ||
* <p> | ||
* To call its listeners, an {@link dev.yumi.commons.event.Event Event} object stores an invoker implementation of | ||
* its listener interface. This functional approach to the event invocation problem avoids the need of slow reflection | ||
* to call the listeners or the need to create a new event implementation for each kind of event. | ||
* To be able to generate such invoker implementation the event is given an invoker factory which takes the listeners as | ||
* input and returns the invoker implementation. | ||
* <p> | ||
* Usually invoker factories are simple {@link java.util.function.Function functions}, but this event API additionally offers | ||
* the {@link dev.yumi.commons.event.invoker.InvokerFactory InvokerFactory} interface which still has the factory function but | ||
* is also given the type of listener interface in its constructor. | ||
* <p> | ||
* As such, the event invoker APIs provide a {@link dev.yumi.commons.event.invoker.DefaultInvokerFactory default invoker factory} | ||
* which is able to generate at runtime invoker implementations for simple common cases that may be found in most invoker implementations. | ||
* Please refer to its documentation for more details about which cases are handled. | ||
* | ||
* @see dev.yumi.commons.event | ||
* @see dev.yumi.commons.event.invoker.InvokerFactory | ||
* @see dev.yumi.commons.event.invoker.DynamicInvokerFactory | ||
* @see dev.yumi.commons.event.invoker.DefaultInvokerFactory | ||
*/ | ||
|
||
package dev.yumi.commons.event.invoker; |
22 changes: 22 additions & 0 deletions
22
libraries/event/src/main/java/dev/yumi/commons/event/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright 2023 Yumi Project | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
/** | ||
* <h2>The Event APIs</h2> | ||
* <p> | ||
* Events are used to represents specific points in a program which may need other softwares to listen and call code when | ||
* those points are reached. | ||
* <p> | ||
* Said events are represented using the {@link dev.yumi.commons.event.Event Event} object which stores its listeners, | ||
* and events are created and managed with the help of an {@link dev.yumi.commons.event.EventManager event manager}. | ||
* | ||
* @see dev.yumi.commons.event.Event | ||
* @see dev.yumi.commons.event.EventManager | ||
*/ | ||
|
||
package dev.yumi.commons.event; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters