StationList

open class StationList : LinkedList<Station>

This is a simple linked list of Station objects, with some additional methods to assist with plucking stations from the list based on station metadata.

All the methods here revolve around the stationMatches and stationMatches calls, which work like the following:

A station matches if, for every (key, value) in the query, Station.getOption returns a value and the value either matches the value from the query or the value is an array that contains the value from the query map.

For example:

// assume we have a Station named 'station' with the following 'options' map:
// {
// "description": "first station"
// "bpm": 120,
// "arrayValue": [
// "one", "two",
// ]
// }
// ]
//

// the following are true:
StationList.stationMatches(station, "description", "first station");
StationList.stationMatches(station, "bpm", 120d);
StationList.stationMatches(station, "arrayValue", "one");
StationList.stationMatches(station, new HashMap<String></String>, Object>() {{
put("description", "first station");
put("bpm", 120d);
put("arrayValue", "one"):
}});

// the following are false:
StationList.stationMatches(station, "description", "random text");
StationList.stationMatches(station, "bpm", "120");
StationList.stationMatches(station, "arrayValue", "three");
StationList.stationMatches(station, new HashMap<String></String>, Object>() {{
put("description", "first station");
put("bpm", 130d); // <-- bad BPM value!
put("arrayValue", "one"):
}});

Constructors

StationList
Link copied to clipboard
fun StationList()

Types

Companion
Link copied to clipboard
object Companion

Functions

add
Link copied to clipboard
open override fun add(element: Station): Boolean
open override fun add(index: Int, element: Station)
addAll
Link copied to clipboard
open override fun addAll(elements: Collection<Station>): Boolean
open override fun addAll(index: Int, elements: Collection<Station>): Boolean
addFirst
Link copied to clipboard
open override fun addFirst(p0: Station)
addLast
Link copied to clipboard
open override fun addLast(p0: Station)
clear
Link copied to clipboard
open override fun clear()
clone
Link copied to clipboard
open override fun clone(): Any
contains
Link copied to clipboard
open operator override fun contains(element: Station): Boolean
containsAll
Link copied to clipboard
open override fun containsAll(elements: Collection<Station>): Boolean
descendingIterator
Link copied to clipboard
open override fun descendingIterator(): MutableIterator<Station>
element
Link copied to clipboard
open override fun element(): Station
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
forEach
Link copied to clipboard
open fun forEach(p0: Consumer<in Station>)
get
Link copied to clipboard
open operator override fun get(index: Int): Station
getAllStationsWithOption
Link copied to clipboard
fun getAllStationsWithOption(key: String): StationList

Return a list that contains all the station that have an option with the provided key

fun getAllStationsWithOption(key: String, value: Any): StationList

Return a list that contains all the stations with options that match the provided key and value pair.

getAllStationsWithOptions
Link copied to clipboard
fun getAllStationsWithOptions(options: Map<String, Any>): StationList

Retrieve a list that contains all the stations whose options match the given map query.

getFirst
Link copied to clipboard
open override fun getFirst(): Station
getLast
Link copied to clipboard
open override fun getLast(): Station
getStationWithName
Link copied to clipboard
fun getStationWithName(name: String): Station?

Retrieve the first station whose Station.name matches the provided name.

getStationWithOption
Link copied to clipboard
fun getStationWithOption(key: String): Station?

Retrieve the first station that has an option key with the given name.

fun getStationWithOption(key: String, value: Any): Station?

Retrieve the first station that has an option entry that matches the given key and value.

getStationWithOptions
Link copied to clipboard
fun getStationWithOptions(options: Map<String, Any>): Station?

Retrieve the first station that has options matching what is in the provided map.

hashCode
Link copied to clipboard
open override fun hashCode(): Int
indexOf
Link copied to clipboard
open override fun indexOf(element: Station): Int
isEmpty
Link copied to clipboard
open override fun isEmpty(): Boolean
iterator
Link copied to clipboard
open operator override fun iterator(): MutableIterator<Station>
lastIndexOf
Link copied to clipboard
open override fun lastIndexOf(element: Station): Int
listIterator
Link copied to clipboard
open override fun listIterator(): MutableListIterator<Station>
open override fun listIterator(index: Int): MutableListIterator<Station>
offer
Link copied to clipboard
open override fun offer(p0: Station): Boolean
offerFirst
Link copied to clipboard
open override fun offerFirst(p0: Station): Boolean
offerLast
Link copied to clipboard
open override fun offerLast(p0: Station): Boolean
parallelStream
Link copied to clipboard
open fun parallelStream(): Stream<Station>
peek
Link copied to clipboard
open override fun peek(): Station
peekFirst
Link copied to clipboard
open override fun peekFirst(): Station
peekLast
Link copied to clipboard
open override fun peekLast(): Station
poll
Link copied to clipboard
open override fun poll(): Station
pollFirst
Link copied to clipboard
open override fun pollFirst(): Station
pollLast
Link copied to clipboard
open override fun pollLast(): Station
pop
Link copied to clipboard
open override fun pop(): Station
push
Link copied to clipboard
open override fun push(p0: Station)
remove
Link copied to clipboard
open override fun remove(): Station
open override fun remove(element: Station): Boolean
removeAll
Link copied to clipboard
open override fun removeAll(elements: Collection<Station>): Boolean
removeAt
Link copied to clipboard
open override fun removeAt(p0: Int): Station
removeFirst
Link copied to clipboard
open override fun removeFirst(): Station
removeFirstOccurrence
Link copied to clipboard
open override fun removeFirstOccurrence(p0: Any): Boolean
removeIf
Link copied to clipboard
open fun removeIf(p0: Predicate<in Station>): Boolean
removeLast
Link copied to clipboard
open override fun removeLast(): Station
removeLastOccurrence
Link copied to clipboard
open override fun removeLastOccurrence(p0: Any): Boolean
removeRange
Link copied to clipboard
open fun removeRange(p0: Int, p1: Int)
replaceAll
Link copied to clipboard
open fun replaceAll(p0: UnaryOperator<Station>)
retainAll
Link copied to clipboard
open override fun retainAll(elements: Collection<Station>): Boolean
set
Link copied to clipboard
open operator override fun set(index: Int, element: Station): Station
sort
Link copied to clipboard
open fun sort(p0: Comparator<in Station>)
spliterator
Link copied to clipboard
open override fun spliterator(): Spliterator<Station>
stream
Link copied to clipboard
open fun stream(): Stream<Station>
subList
Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): MutableList<Station>
toArray
Link copied to clipboard
open override fun toArray(): Array<Any>
open override fun <T : Any> toArray(p0: Array<T>): Array<T>
toString
Link copied to clipboard
open override fun toString(): String

Properties

modCount
Link copied to clipboard
val modCount: Int
size
Link copied to clipboard
open override val size: Int