-
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
ekwong
committed
Apr 6, 2020
1 parent
603b4c9
commit 9eebc3d
Showing
5 changed files
with
38 additions
and
14 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
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
2 changes: 1 addition & 1 deletion
2
...java/com/ekwong/lib/BackInterruption.java → ...kwong/lib/interrupt/BackInterruption.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.ekwong.lib; | ||
package com.ekwong.lib.interrupt; | ||
|
||
/** | ||
* @author ekwong | ||
|
27 changes: 27 additions & 0 deletions
27
ekpopwindowlib/src/main/java/com/ekwong/lib/interrupt/Interruption.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,27 @@ | ||
package com.ekwong.lib.interrupt; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author ekwong | ||
*/ | ||
public class Interruption { | ||
|
||
private Set<BackInterruption> backInterruptions = new HashSet<>(); | ||
|
||
public boolean addBackInterruption(BackInterruption interruption) { | ||
return backInterruptions.add(interruption); | ||
} | ||
|
||
public boolean isEnable() { | ||
return !backInterruptions.isEmpty(); | ||
} | ||
|
||
public void exec() { | ||
for (BackInterruption interruption : backInterruptions) { | ||
interruption.interrupt(); | ||
} | ||
backInterruptions.clear(); | ||
} | ||
} |