An analysis of the durations of Swift gamma-ray bursts