KotlinTrader / com.doubleu.kotlintrader.data / Storage

Storage

sealed class Storage<T : Entity<T>>

Provides Storage for various Entitys

Properties

loading val loading: SimpleBooleanProperty

Indicates whether the items are currently being loaded

retrieveOnLoad open val retrieveOnLoad: Boolean

Whether loaded Entities should be retrieved eagerly after loading. Recommended when Entities are being loaded directly from the database

supplier val supplier: () -> List<T>

Functions

asSequence fun asSequence(): Sequence<T>

Creates a Sequence instance that wraps the original collection returning its elements when being iterated.

clear fun clear(): Unit

Clears all items

filter fun filter(predicate: (T) -> Boolean): List<T>

Returns a list containing only elements matching the given predicate.

find fun find(predicate: (T) -> Boolean): T?

Returns the first element matching the given predicate, or null if element was not found.

findAll fun findAll(predicate: (T) -> Boolean): List<T>

Return all elements matching the given predicate

forEach fun forEach(action: (T) -> Unit): Unit

Performs the given action on each element.

get fun get(): ObservableList<T>

Retrieves the stored items

load open fun load(): Unit

Reloads the contained items

onLoadFinish fun onLoadFinish(op: (Storage<T>) -> Unit): Unit

Executes the given op when load finishes

Companion Object Properties

anyLoading val anyLoading: BooleanBinding

Indicates whether any Storage is currently being loaded. (Implicates an open database operation)

Companion Object Functions

all fun all(): List<Storage<*>>

Returns all storages that are in use

Extension Functions

valueOf fun Any?.valueOf(): String

Inheritors

Angebote object Angebote : Storage<Ort_has_Ware>

Holding all Ort_has_Ware objects that were loaded from the database

OrtWaren object OrtWaren : Storage<Ort_has_Ware>

Holding Ort_has_Ware objects that were loaded from the database. They always depend on the current ort

Orte object Orte : Storage<Ort>

Holding all Ort objects that were loaded from the database

SchiffWaren object SchiffWaren : Storage<Schiff_has_Ware>

Holding Schiff_has_Ware objects that were loaded from the database. They always depend on the current schiff

Schiffe object Schiffe : Storage<Schiff>

Holding all Schiff objects that were loaded from the database

Users object Users : Storage<Trader>

Holding all Trader objects that were loaded from the database