/** * ************************************************************************* Public defined * constructor for the ComAcasCapability. */ public ComAcasCapability( int COMcapability, int flightStatus, boolean sSC, boolean aRC, boolean aIC) { m_transponderCOMCapability = TransponderCOMCapability.codeOf(COMcapability); m_flightStatus = FlightStatus.codeOf(flightStatus); m_hasSpecificServiceCapability = sSC; m_hasAltitudeReportingCapability = aRC; m_hasAircraftIdentificationCapability = aIC; }
/** * ************************************************************************* * * @param code * @return */ public static FlightStatus codeOf(int code) { if (code > 5) { throw new IllegalArgumentException("Unknown code " + code + "for TransponderCOMCapability"); } for (FlightStatus status : FlightStatus.values()) { if (status.m_code == code) { return status; } } throw new IllegalArgumentException("Unknown code " + code + "for FlightStatus"); }