* @return javax.media.Time object representing the
* maximum startup latency across all the input
* Controllers.
*/
public static Time getMaximumLatency(Controller[] controllers) {
Time maxLatency = new Time(0.0);
Time thisTime;
double maxSeconds = 0.0;
for (int i = 0; i < controllers.length; i++) {
if (controllers[i].getState() < Controller.Realized ||
(thisTime = controllers[i].getStartLatency())
== Controller.LATENCY_UNKNOWN)
{
continue;
}
double thisSeconds = thisTime.getSeconds();
if (thisSeconds > maxSeconds)
maxLatency = thisTime;
}
return maxLatency;
}