annotate test/mergertest/TestMerger2.java @ 420:5c95a9020e31

Modify ServerMainLoop
author one
date Fri, 13 Feb 2009 19:13:50 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
420
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
1 package test.mergertest;
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
2
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
3 import java.util.LinkedList;
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
4
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
5 public class TestMerger2 {
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
6
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
7 private LinkedList<EditorSimulator> editorList;
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
8
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
9 public TestMerger2(int en, int cn) {
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
10 editorList = new LinkedList<EditorSimulator>();
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
11 for(int i = 0; i < en; i++){
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
12 editorList.add(new EditorSimulatorImpl(0, i));
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
13 try{
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
14 editorList.get(i-1).setNext(editorList.get(i));
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
15 }catch(IndexOutOfBoundsException e){
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
16
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
17 }
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
18 }
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
19 }
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
20
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
21 public static void main(String[] args){
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
22 if(args.length > 1){
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
23 int en = Integer.parseInt(args[0]);
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
24 int cn = Integer.parseInt(args[1]);
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
25 TestMerger2 test = new TestMerger2(en, cn);
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
26 test.start();
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
27 }else{
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
28 TestMerger2 test = new TestMerger2(3, 3);
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
29 test.start();
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
30 }
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
31 }
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
32
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
33 private void start() {
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
34
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
35 }
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
36
5c95a9020e31 Modify ServerMainLoop
one
parents:
diff changeset
37 }