01 /*
02 * Java Genetic Algorithm Library (jenetics-2.0.2).
03 * Copyright (c) 2007-2014 Franz Wilhelmstötter
04 *
05 * Licensed under the Apache License, Version 2.0 (the "License");
06 * you may not use this file except in compliance with the License.
07 * You may obtain a copy of the License at
08 *
09 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * Author:
18 * Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at)
19 */
20 package org.jenetics.internal.util;
21
22 import java.util.List;
23
24 /**
25 * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
26 * @version 2.0 — <em>$Date: 2014-04-16 $</em>
27 * @since 2.0
28 */
29 final class RunnablesRunnable implements Runnable {
30
31 private final List<? extends Runnable> _runnables;
32 private final int _start;
33 private final int _end;
34
35 RunnablesRunnable(
36 final List<? extends Runnable> runnables,
37 final int start,
38 final int end
39 ) {
40 _runnables = runnables;
41 _start = start;
42 _end = end;
43 }
44
45 @Override
46 public void run() {
47 for (int i = _start; i < _end; ++i) {
48 _runnables.get(i).run();
49 }
50 }
51
52 }
|