view src/alice/test/topology/fish/Routing.java @ 35:ac3b48c5f4da

share width each other with tree
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Fri, 20 Jan 2012 04:00:12 +0900
parents
children 0b25b48116b6
line wrap: on
line source

package alice.test.topology.fish;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.msgpack.annotation.Message;
import org.msgpack.annotation.Optional;

@Message
public class Routing {

	public String name;
	public int id;
	public int width;
	@Optional public int startX;
	
	public Routing() {}
	
	public Routing(String name, int width) {
		this.name = name;
		this.width = width;
		System.out.println(name);
		Pattern pattern = Pattern.compile("^child([0-9]+)$");
		Matcher matcher = pattern.matcher(name);
		matcher.find();
		id = new Integer(matcher.group(1));
	}

	public Routing(String name, int id, int width, int startX) {
		this.name = name;
		this.id = id;
		this.width = width;
		this.startX = startX;
	}
	
}