52 lines
1.2 KiB
Java
52 lines
1.2 KiB
Java
package com.flaremicro.visualforecast.datamart;
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Collection;
|
|
import java.util.Collections;
|
|
import java.util.HashSet;
|
|
import java.util.Set;
|
|
|
|
public class TownInfo implements Comparable<TownInfo> {
|
|
public final String code;
|
|
public final String townName;
|
|
public final String province;
|
|
public final float northLat;
|
|
public final float westLong;
|
|
public final int priority;
|
|
private Set<String> displays = new HashSet<String>();
|
|
|
|
public TownInfo(String code, String townName, String province, float northLat, float westLong, int priority) {
|
|
this.code = code;
|
|
this.townName = townName;
|
|
this.province = province;
|
|
this.northLat = northLat;
|
|
this.westLong = westLong;
|
|
this.priority = priority;
|
|
}
|
|
|
|
@Override
|
|
public int compareTo(TownInfo o) {
|
|
return priority - o.priority;
|
|
}
|
|
|
|
public void addSupportedDisplay(String display)
|
|
{
|
|
this.displays.add(display);
|
|
}
|
|
|
|
public void setSupportedDisplays(String ... displays){
|
|
setSupportedDisplays(Arrays.asList(displays));
|
|
}
|
|
|
|
public void setSupportedDisplays(Collection<String> displays){
|
|
this.displays.clear();
|
|
this.displays.addAll(displays);
|
|
}
|
|
|
|
public Set<String> getSupportedDisplays()
|
|
{
|
|
return Collections.unmodifiableSet(displays);
|
|
}
|
|
|
|
}
|