-
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.
refactor: 💡 re-define certain interfaces of models
- Loading branch information
1 parent
f656319
commit 6787677
Showing
3 changed files
with
45 additions
and
19 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
27 changes: 27 additions & 0 deletions
27
core/src/main/kotlin/tw/xcc/gumtree/api/tree/TreeMappingStorage.kt
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 tw.xcc.gumtree.api.tree | ||
|
||
internal interface TreeMappingStorage<in T : Tree> { | ||
fun addMappingOf(mapping: Pair<T, T>) | ||
|
||
fun addMappingRecursivelyOf(mapping: Pair<T, T>) | ||
|
||
fun removeMappingOf(mapping: Pair<T, T>) | ||
|
||
fun getMappingOfLeft(left: T): Tree? | ||
|
||
fun getMappingOfRight(right: T): Tree? | ||
|
||
fun isLeftMapped(left: T): Boolean | ||
|
||
fun isAnyOfLeftsUnMapped(lefts: Iterable<T>): Boolean | ||
|
||
fun isRightMapped(right: T): Boolean | ||
|
||
fun isAnyOfRightsUnMapped(rights: Iterable<T>): Boolean | ||
|
||
fun areBothUnMapped(mapping: Pair<T, T>): Boolean | ||
|
||
fun hasUnMappedDescendentOfLeft(left: T): Boolean | ||
|
||
fun hasUnMappedDescendentOfRight(right: T): Boolean | ||
} |
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