Station List
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
Types
Functions
Return a list that contains all the station that have an option with the provided key
Return a list that contains all the stations with options that match the provided key and value pair.
Retrieve a list that contains all the stations whose options match the given map query.
Retrieve the first station whose Station.name matches the provided name.
Retrieve the first station that has an option key with the given name.
Retrieve the first station that has an option entry that matches the given key and value.
Retrieve the first station that has options matching what is in the provided map.