Skip to content

//Ankea/fi.jyu.ohj2.sourander.ankea.model/Deck

Deck

[JVM]\ open class Deck

Represents a flashcard deck with metadata, cards, and practice statistics.

Constructors

Deck [JVM]
constructor()
Creates an empty deck.
constructor(header: String)
Creates a deck with a header.
constructor(header: String, description: String)
Creates a deck with a header and description.

Properties

Name Summary
DEFAULT_HEADER [JVM]
val DEFAULT_HEADER: String = "This one has no name"
Default header used when a deck is created without a user-provided name.

Functions

Name Summary
addFlashcard [JVM]
open fun addFlashcard(flashcard: Flashcard)
Adds a flashcard to the deck.
clearFlashcards [JVM]
open fun clearFlashcards()
Removes all flashcards from the deck.
descriptionProperty [JVM]
open fun descriptionProperty(): StringProperty
Returns the deck description property.
flashcardsProperty [JVM]
open fun flashcardsProperty(): ListProperty<Flashcard>
Returns the flashcards list property.
getDescription [JVM]
open fun getDescription(): String
Returns the deck description.
getFlashcardCount [JVM]
open fun getFlashcardCount(): Int
Returns the number of flashcards in the deck.
getFlashcards [JVM]
open fun getFlashcards(): ObservableList<Flashcard>
Returns the observable list of flashcards.
getHeader [JVM]
open fun getHeader(): String
Returns the deck header.
getPracticeCardCount [JVM]
open fun getPracticeCardCount(): Int
Returns the number of cards available in the current practice session.
getPracticeCount [JVM]
open fun getPracticeCount(): Int
Returns the practice count.
getPracticeFlashcard [JVM]
open fun getPracticeFlashcard(practiceIndex: Int): Flashcard
Returns the flashcard shown at the given practice-session position.
headerProperty [JVM]
open fun headerProperty(): StringProperty
Returns the deck header property.
incrementPracticeCount [JVM]
open fun incrementPracticeCount()
Increments the practice count by one.
practiceCountProperty [JVM]
open fun practiceCountProperty(): IntegerProperty
Returns the practice count property.
removeFlashcard [JVM]
open fun removeFlashcard(flashcard: Flashcard): Boolean
Removes a flashcard from the deck.
setDescription [JVM]
open fun setDescription(description: String)
Updates the deck description.
setFlashcards [JVM]
open fun setFlashcards(flashcards: ObservableList<Flashcard>)
Replaces the flashcards list content.
setHeader [JVM]
open fun setHeader(header: String)
Updates the deck header.
setPracticeCount [JVM]
open fun setPracticeCount(practiceCount: Int)
Updates the practice count.
startPracticeSession [JVM]
open fun startPracticeSession()
Starts a new practice session by shuffling the display order of the cards.
toString [JVM]
open fun toString(): String