mirror of https://git.sr.ht/~oppen/ariane
26 lines
465 B
Kotlin
26 lines
465 B
Kotlin
package oppen.tva.io.history
|
|
|
|
import java.net.URI
|
|
|
|
class Tab(val index: Int) {
|
|
val history = mutableListOf<URI>()
|
|
|
|
fun add(uri: URI){
|
|
history.add(uri)
|
|
}
|
|
|
|
fun add(address: String){
|
|
history.add(URI.create(address))
|
|
}
|
|
|
|
fun getPrevious(): URI? {
|
|
return when {
|
|
history.size > 1 -> {
|
|
history[history.size-2]
|
|
}
|
|
else -> {
|
|
null
|
|
}
|
|
}
|
|
}
|
|
} |