Skip to content

Commit

Permalink
refactor: 💡 make internal members become internal
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanonymous-GitHub committed Aug 4, 2024
1 parent e735a0f commit db22013
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package tw.xcc.gumtree.matchers
import tw.xcc.gumtree.model.GumTree

private typealias PairOfIsomorphicSetInternal = Pair<MutableSet<GumTree>, MutableSet<GumTree>>
typealias PairOfIsomorphicSet = Pair<Set<GumTree>, Set<GumTree>>
typealias PairsOfMappedTree = List<Pair<GumTree, GumTree>>
internal typealias PairOfIsomorphicSet = Pair<Set<GumTree>, Set<GumTree>>
internal typealias PairsOfMappedTree = List<Pair<GumTree, GumTree>>

class HashSimilarityOrganizer(
internal class HashSimilarityOrganizer(
memo1: Map<String, Long>,
memo2: Map<String, Long>,
mappings: PairsOfMappedTree
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tw.xcc.gumtree.matchers.comparator
import tw.xcc.gumtree.model.GumTree
import kotlin.math.abs

class AbsolutePositionDistanceComparator : Comparator<Pair<GumTree, GumTree>> {
internal class AbsolutePositionDistanceComparator : Comparator<Pair<GumTree, GumTree>> {
private fun calculateDistanceOf(
t1: GumTree,
t2: GumTree
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tw.xcc.gumtree.matchers.comparator
import tw.xcc.gumtree.algorithms.lcsBaseOnlySize
import tw.xcc.gumtree.model.GumTree

class AncestorsSimilarityComparator : Comparator<Pair<GumTree, GumTree>> {
internal class AncestorsSimilarityComparator : Comparator<Pair<GumTree, GumTree>> {
private fun findLCSOfTreeLists(
trees1: List<GumTree>,
trees2: List<GumTree>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tw.xcc.gumtree.matchers.comparator
import tw.xcc.gumtree.model.GumTree
import kotlin.math.sqrt

class PositionOfAncestorsSimilarityComparator : Comparator<Pair<GumTree, GumTree>> {
internal class PositionOfAncestorsSimilarityComparator : Comparator<Pair<GumTree, GumTree>> {
private fun collectPositionsOfAncestorsFrom(tree: GumTree): List<Int> {
val positions = mutableListOf<Int>()
positions.add(tree.positionOfParent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import kotlin.math.max
* And if both [left] and [right] are 0, the function returns 1.
* Because the two sets are the same (empty).
* */
fun calculateDiceValue(
internal fun calculateDiceValue(
common: Long,
left: Long,
right: Long
Expand All @@ -40,7 +40,7 @@ fun calculateDiceValue(
/**
* @see [calculateDiceValue]
* */
fun calculateDiceValue(
internal fun calculateDiceValue(
common: Int,
left: Int,
right: Int
Expand All @@ -51,7 +51,7 @@ fun calculateDiceValue(
* When the first elements of the pairs have the same parent and the second elements of the pairs have the same parent,
* the function returns true.
* */
inline fun <reified T : Tree> hasSameParent(
internal inline fun <reified T : Tree> hasSameParent(
m1: Pair<T, T>,
m2: Pair<T, T>
): Boolean = (m1.first.getParent() == m2.first.getParent()) && (m1.second.getParent() == m2.second.getParent())
Expand All @@ -60,7 +60,7 @@ inline fun <reified T : Tree> hasSameParent(
* To calculate the number of mapped descendents in [tree1] and [tree2].
* The descendents of [tree1] should be saved in the Left part of [storage].
* */
inline fun <reified T : BasicTree<T>> numOfMappedDescendents(
internal inline fun <reified T : BasicTree<T>> numOfMappedDescendents(
tree1: T,
tree2: T,
storage: TreeMappingStorage<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tw.xcc.gumtree.matchers.comparator
import tw.xcc.gumtree.api.tree.TreeMappingStorage
import tw.xcc.gumtree.model.GumTree

class SiblingsSimilarityComparator(
internal class SiblingsSimilarityComparator(
private val storage: TreeMappingStorage<GumTree>
) : Comparator<Pair<GumTree, GumTree>> {
private fun sizeOfCommonDescendentsOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package tw.xcc.gumtree.matchers.comparator

import tw.xcc.gumtree.matchers.PairOfIsomorphicSet

class SubtreeSizeComparator : Comparator<PairOfIsomorphicSet> {
internal class SubtreeSizeComparator : Comparator<PairOfIsomorphicSet> {
override fun compare(
pairOfSet1: PairOfIsomorphicSet,
pairOfSet2: PairOfIsomorphicSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tw.xcc.gumtree.matchers.comparator
import tw.xcc.gumtree.model.GumTree
import kotlin.math.abs

class TextualPositionDistanceComparator : Comparator<Pair<GumTree, GumTree>> {
internal class TextualPositionDistanceComparator : Comparator<Pair<GumTree, GumTree>> {
private fun calculateTexturalPositionDistanceOf(
t1: GumTree,
t2: GumTree
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package tw.xcc.gumtree.model

import tw.xcc.gumtree.api.tree.PriorityTreeList

class HeightPriorityList(private val minHeight: Int = 1) : PriorityTreeList<GumTree> {
internal class HeightPriorityList(private val minHeight: Int = 1) : PriorityTreeList<GumTree> {
private val trees = sortedMapOf<Int, MutableList<GumTree>>()

override fun push(tree: GumTree) {
Expand Down

0 comments on commit db22013

Please sign in to comment.