comparison src/main/java/alice/test/topology/fish/Routing.java @ 345:8f71c3e6f11d

Change directory structure Maven standard
author sugi
date Wed, 16 Apr 2014 18:26:07 +0900
parents
children
comparison
equal deleted inserted replaced
344:9f97ec18f8c5 345:8f71c3e6f11d
1 package alice.test.topology.fish;
2
3 import java.util.regex.Matcher;
4 import java.util.regex.Pattern;
5
6 import org.msgpack.annotation.Message;
7 import org.msgpack.annotation.Optional;
8
9 @Message
10 public class Routing {
11
12 public String name;
13 public int id;
14 public int width;
15 @Optional public int startX;
16
17 public Routing() {}
18
19 public Routing(String name, int width) {
20 this.name = name;
21 this.width = width;
22 Pattern pattern = Pattern.compile("^child([0-9]+)$");
23 Matcher matcher = pattern.matcher(name);
24 matcher.find();
25 id = new Integer(matcher.group(1));
26 }
27
28 public Routing(String name, int id, int width, int startX) {
29 this.name = name;
30 this.id = id;
31 this.width = width;
32 this.startX = startX;
33 }
34
35 }