public interface CollectionState
Holds any stateful information that a collection may need for selecting its next track.
This holds an index that is incremented when a track is chosen, used for when a collection is being selected from sequentially. This allows the first song to be chosen, then the second, third, etc.
This holds an index that is incremented when a track is chosen, used for when a collection is being selected from sequentially. This allows the first song to be chosen, then the second, third, etc.
-
Method Summary
Modifier and TypeMethodDescriptionintGets the index to choose a song by, and then increments it.Retrieves the current collection associated with this state.intGets the current index that is incremented bygetAndIncrementSequentialIndex(), used for getting tracks in order.Gets all the tracks the collection contains.Returns a Qilletni-user-friendly string to display this state.
-
Method Details
-
getCollection
CollectionType getCollection()Retrieves the current collection associated with this state.- Returns:
- The
CollectionTyperepresenting the current collection
-
getTracks
-
getSequentialIndex
int getSequentialIndex()Gets the current index that is incremented bygetAndIncrementSequentialIndex(), used for getting tracks in order. This is essentially a "peek" ofgetAndIncrementSequentialIndex().- Returns:
- Gets the index of the current track that should be chosen
-
getAndIncrementSequentialIndex
int getAndIncrementSequentialIndex()Gets the index to choose a song by, and then increments it. If the new index goes past the length of the collection, it wraps back to0.- Returns:
- The index of the current track that should be chosen
-
stringValue
String stringValue()Returns a Qilletni-user-friendly string to display this state.- Returns:
- A string representation of this state
-