Skip to content

Commit

Permalink
Changed some protected to internal.
Browse files Browse the repository at this point in the history
Not sure if this is the right encapsulation, but we can go over these later.
  • Loading branch information
Mikael Vejdemo-Johansson committed Feb 20, 2024
1 parent a3d21f9 commit aca67f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/commonMain/kotlin/org/appliedtopology/tda4j/Sets.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.appliedtopology.tda4j

open class ArrayMutableSortedSetBaseWith<T>(capacity: Int = 8, val comparator: Comparator<T>) {
@Suppress("ktlint:standard:property-naming")
protected val _set: ArrayList<T> = ArrayList(capacity)
internal val _set: ArrayList<T> = ArrayList(capacity)

fun add(element: T): Boolean {
val index = _set.binarySearch(element, comparator)
Expand Down Expand Up @@ -79,7 +79,7 @@ open class ArrayMutableSortedMapWith<K, V>(
val defaultValue: V? = null,
) :
ArrayMutableSortedSetBaseWith<K>(capacity, comparator), MutableMap<K, V> {
protected val _values: ArrayList<V> = ArrayList(capacity)
internal val _values: ArrayList<V> = ArrayList(capacity)

override fun containsKey(key: K): Boolean = _set.binarySearch(key, comparator) >= 0

Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/org/appliedtopology/tda4j/Simplex.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import arrow.core.padZip

open class AbstractSimplexWith<VertexT>(val vertexComparator: Comparator<VertexT>) : Set<VertexT> {
@Suppress("ktlint:standard:property-naming")
protected val _simplex: MutableSortedSetWith<VertexT> = MutableSortedSetWith(comparator = vertexComparator)
internal val _simplex: MutableSortedSetWith<VertexT> = MutableSortedSetWith(comparator = vertexComparator)

constructor(vertexComparator: Comparator<VertexT>, elements: HashSet<VertexT>) : this(vertexComparator) {
_simplex.addAll(elements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract class SimplexStream<VertexT : Comparable<VertexT>, FiltrationT : Compar

open class ExplicitStream<VertexT : Comparable<VertexT>, FiltrationT : Comparable<FiltrationT>> :
SimplexStream<VertexT, FiltrationT>(), MutableMap<AbstractSimplex<VertexT>, FiltrationT> {
protected val filtrationValues: MutableMap<AbstractSimplex<VertexT>, FiltrationT> = HashMap()
internal val filtrationValues: MutableMap<AbstractSimplex<VertexT>, FiltrationT> = HashMap()

override fun filtrationValue(simplex: AbstractSimplex<VertexT>): FiltrationT? = filtrationValues[simplex]

Expand Down

0 comments on commit aca67f3

Please sign in to comment.