1st version that works

This commit is contained in:
2022-03-14 11:53:00 +02:00
parent ee2884b2ff
commit 3806d2c80d
617 changed files with 17293 additions and 4470 deletions

View File

@ -0,0 +1,51 @@
package com.safemobile.lib.radio;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
public class Zone {
public int dbID;
public int id;
public String ZoneName="";
public ArrayList<Channel> channelList = new ArrayList<Channel>();
public Zone()
{
channelList = new ArrayList<Channel>();
}
public String toString()
{
return "zoneDbID: " + id +" |zoneID: " + dbID + " | ZoneName: " + ZoneName ;
}
/**
* sort the list of channels based on their names
*/
public void sortChannelListByName() {
//Sorting
Collections.sort(channelList, new Comparator<Channel>() {
@Override
public int compare(Channel channel1, Channel channel2)
{
return channel1.chName.compareTo(channel2.chName);
}
});
}
/**
* sort the list of channels based on their ids
*/
public void sortChannelListByChannelID() {
//Sorting
Collections.sort(channelList, new Comparator<Channel>() {
@Override
public int compare(Channel channel1, Channel channel2)
{
return (channel1.id < channel2.id ? 1 : 0);
}
});
}
}