我有一个包含大约 10 种预定方法的模型。现在我对控制他们的执行有点困惑。我希望这些预定的方法以一定的顺序执行。
我怎样才能拥有 ScheduleParameters.FIRST_PRIORITY、ScheduleParameters.Second_PRIORITY、ScheduleParameters.THIRD_PRIORITY、...和 ScheduleParameters.LAST_PRIORITY。
我有一个包含大约 10 种预定方法的模型。现在我对控制他们的执行有点困惑。我希望这些预定的方法以一定的顺序执行。
我怎样才能拥有 ScheduleParameters.FIRST_PRIORITY、ScheduleParameters.Second_PRIORITY、ScheduleParameters.THIRD_PRIORITY、...和 ScheduleParameters.LAST_PRIORITY。
各种ScheduleParameters.createX
方法都采用指定优先级的双精度值。例如,如果您有
ScheduleParameters sp1 = ScheduleParameters.createRepeating(1, 1, 0);
ScheduleParameters sp2 = ScheduleParameters.createRepeating(1, 1, 10);
sp1 的优先级为 0,sp2 的优先级为 10。使用 sp1 和 sp2 安排的操作将在第 1 次滴答时发生,然后在之后的每个滴答中发生。但是 sp2 动作将在 sp1 动作之前发生在同一滴答声中。
还有两个特殊的优先级值ScheduleParameters.FIRST_PRIORITY
,ScheduleParameters.LAST_PRIORITY
可用于确保一个动作在同一滴答的任何其他动作计划之前或之后执行。