public class TLcdDAFIFTICAORegionFilter extends Object implements ILcdDAFIFTRecordFilter
ILcdDAFIFTRecordFilter
that allows to filter
DAFIFT records on a list of ICAO regions. An ICAO region is a two letter code
such as EB (Belgium), ... This code refers to the country or the region in
which an object is defined.Constructor and Description |
---|
TLcdDAFIFTICAORegionFilter(String[] aICAORegions)
Creates a new DAFIFT record filter which filters on the given ICAO regions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(String[] aRecord,
String aFileName)
Tests if a given record of type
String[] passes the filter or not. |
void |
addICAORegion(String aICAORegion)
Add an ICAO region which needs to be accepted by this filter instance.
|
static int |
findICAOCodeField(String aFileName)
Finds the index of the record field containing the ICAO region information for
the specified file name.
|
public TLcdDAFIFTICAORegionFilter(String[] aICAORegions)
aICAORegions
- An array of ICAO regions to filter on.IllegalArgumentException
- if the argument is null
.public boolean accept(String[] aRecord, String aFileName)
ILcdDAFIFTRecordFilter
String[]
passes the filter or not.
The actual test condition is specified by the implementation of this interface.accept
in interface ILcdDAFIFTRecordFilter
aRecord
- The String[] to be tested by the filter.aFileName
- The file name which contains the given record.true
if the String[]
passes the filter,
false
otherwise.public void addICAORegion(String aICAORegion)
aICAORegion
- The ICAO region to accept.public static int findICAOCodeField(String aFileName)
aFileName
- The file name to query.-1
if the file does not contain an ICAO region.