public class IncidentUtils extends Object
Constructor and Description |
---|
IncidentUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
applyFilters(List<T> items,
IFilter<T>... filters)
Filter the list with the user provided filter.
|
static Comparator<Incident> |
getAngleComparator(float currentHeading,
Location currentLocation)
Gets the angle based incidents comparator for sorting for alerts.
|
static <T extends Bearing> |
getAngleFilter(Location currentLocation,
float currentHeading,
float forwardConeAngle) |
static Comparator<Incident> |
getDefaultComparator()
Gets the default incidents comparator for sorting for alerts.
|
static IFilter<Incident> |
getDefaultFilter()
Gets the default filter.
|
static Comparator<Incident> |
getDefaultListComparator()
Get default incidents comparator for sorting for displaying incidents in a list.
|
static <T extends Bearing> |
getFilterAngle(T incident,
float currentHeading,
Location currentLocation) |
static IFilter<Incident> |
getIncidentTypeFilter(Set<Incident.IncidentType> incidentTypesAllowed)
Get a custom filter which can selectively allow incidents.
|
static double |
getLookAheadDistance(float speedFactor,
Location currentLocation,
int minDistance,
int maxDistance)
Get the distance we need to look ahead based on the speed factor and
current speed.
|
static double |
getLookAheadPreferedDistance(float speedFactor,
Location currentLocation,
int minDistance,
int maxDistance)
Get the distance we need to look ahead based on the speed factor and
current speed.
|
static double |
getLookAheadUnitDistance(float speedFactor,
Location currentLocation,
int minDistance,
int maxDistance)
Get the distance we need to look ahead based on the speed factor and
current speed.
|
static boolean |
isRoadClosure(Integer eventCode)
Returns whether an event code is a road closure, per ISO 14819-1:2003.
|
public static boolean isRoadClosure(Integer eventCode)
eventCode
- The event code.true
if the event code is a road closure; otherwise, false
.public static Comparator<Incident> getDefaultComparator()
public static Comparator<Incident> getAngleComparator(float currentHeading, Location currentLocation)
public static Comparator<Incident> getDefaultListComparator()
public static IFilter<Incident> getDefaultFilter()
Incident.IncidentType.CONSTRUCTION
and Incident.IncidentType.UNKNOWN
incidents.public static double getLookAheadUnitDistance(float speedFactor, Location currentLocation, int minDistance, int maxDistance)
public static double getLookAheadPreferedDistance(float speedFactor, Location currentLocation, int minDistance, int maxDistance)
public static double getLookAheadDistance(float speedFactor, Location currentLocation, int minDistance, int maxDistance)
public static IFilter<Incident> getIncidentTypeFilter(@NonNull Set<Incident.IncidentType> incidentTypesAllowed)
incidentTypesAllowed
- A set of Incident.IncidentType
s that should return
true
when IFilter.isItemAllowed(T)
is called.Incident
filter.public static <T extends Bearing> double getFilterAngle(T incident, float currentHeading, Location currentLocation)
public static <T extends Bearing> IFilter<T> getAngleFilter(@NonNull Location currentLocation, @NonNull float currentHeading, @NonNull float forwardConeAngle)
@NonNull public static <T> List<T> applyFilters(List<T> items, IFilter<T>... filters)
T
- Target list element type.items
- The list of items that needs to be filtered.filters
- The filters to apply to the list.Copyright © 2013-2018 INRIX, Inc. All Rights Reserved.