DistancesCIfc

A controlled interface for referencing distance models

Inheritors

Properties

Link copied to clipboard

The data associated with the schedule

Link copied to clipboard
abstract val isEmpty: Boolean

Checks if there are no items on the schedule

Link copied to clipboard
Link copied to clipboard
abstract val locationNames: Set<String>

The names of the locations.

Link copied to clipboard
abstract val locations: Set<LocationIfc>

The locations that have been added to the model.

Functions

Link copied to clipboard
abstract fun addDistance(distanceData: DistanceData): Pair<LocationIfc, LocationIfc>

Adds the distance data to the distances model.

Link copied to clipboard

Adds the distance data to the distances model.

Link copied to clipboard
abstract fun changeDistance(fromLocation: String, toLocation: String, distance: Double)
abstract fun changeDistance(fromLocation: LocationIfc, toLocation: LocationIfc, distance: Double)

Changes a distance value between the pair of locations, going from fromLocation to toLocation. The distance must be greater than or equal to 0.0. The pair must already be part of the model.

Link copied to clipboard
abstract fun clearDistances()

Clears all distances from the distance model

Link copied to clipboard
open override fun configureFromJson(json: String): DistancesData

Uses the supplied JSON string to configure the distances via DistancesData

Link copied to clipboard
abstract fun containsName(name: String): Boolean
Link copied to clipboard
open override fun currentSettings(): DistancesData

Returns the current settings in the form of the data type that can be serialized.

Link copied to clipboard
abstract fun location(name: String): LocationIfc?
Link copied to clipboard
open override fun settingsToJson(): String

Converts the configuration settings to JSON