// Path: osgi.enroute.trains.api/src/osgi/enroute/trains/cloud/api/Segment.java
// public class Segment extends DTO {
// 
// 	public enum Type {
// 		STRAIGHT, CURVED, SWITCH, SIGNAL, LOCATOR, BLOCK;
// 	}
// 	
// 
// 	/**
// 	 * Our Identity
// 	 */
// 	public String id;
// 	
// 	/**
// 	 * Type of the segment
// 	 */
//  	public Type type;
// 
// 	/**
//  	* Name of the track.This is the name required to get permission 
//  	* from the Track Manager. If this name starts with X then no admission is required. This 
//  	* is generally for switches.
//  	*/
//  	public String track;
//  	
// 	/**
// 	 * Sequence of the segment in the track
// 	 */
// 	public int sequence;
// 
// 	/**
// 	 * Length of the segment in millimeters, can be zero. It an be zero because
// 	 * the relation between the controllers and the switches and the signals is
// 	 * not always 1:1 mappable to controllers. Therefore zero sized segments can
// 	 * be used to map correctly.
// 	 */
// 	public int length;
// 
// 	/**
// 	 * Short code for RFID tag attached to this segment, or 0 for none.
// 	 */
// 	public int tagCode;
// 
// 	/**
// 	 * The associated controller
// 	 */
// 	public int controller = -1;
// 
// 	/**
// 	 * The next segment. Only a switch can have an additional to. The second to
// 	 * is the one selected if the switch is set to its alternative.
// 	 */
// 	public String to[];
// 	
// 	/**
// 	 * The previous segment. Only a switch can have an additional from. The second from
// 	 * is the one selected if the switch is set to its alternative.
// 	 */
// 	public String from[];
// 
// }
// 
// Path: osgi.enroute.trains.util/src/osgi/enroute/trains/track/util/SegmentFactoryAdapter.java
// public class SegmentFactoryAdapter<T> implements SegmentFactory<T> {
// 
// 	@Override
// 	public SegmentHandler<T> create(Segment segment) throws Exception {
// 		SegmentHandler<T> handler;
// 		switch (segment.type) {
// 		case BLOCK:
// 			handler = block(segment);
// 			break;
// 
// 		case CURVED:
// 			handler = curve(segment);
// 			break;
// 		case LOCATOR:
// 			handler = locator(segment);
// 			break;
// 		case SIGNAL:
// 			handler = signal(segment);
// 			break;
// 		case STRAIGHT:
// 			handler = straight(segment);
// 			break;
// 		case SWITCH:
// 			handler = swtch(segment);
// 			break;
// 		default:
// 			throw new IllegalArgumentException("Missing case " + segment.type);
// 		}
// 		handler.segment = segment;
// 		return handler;
// 	}
// 
// 	public SegmentHandler<T> block(Segment segment) {
// 		return new Tracks.BlockHandler<T>(segment);
// 	}
// 
// 	public SegmentHandler<T> curve(Segment segment) {
// 		return new Tracks.CurvedHandler<T>(segment);
// 	}
// 
// 	public SegmentHandler<T> straight(Segment segment) {
// 		return new Tracks.StraightHandler<T>(segment);
// 	}
// 
// 	public SegmentHandler<T> signal(Segment segment) {
// 		return new Tracks.SignalHandler<T>(segment);
// 	}
// 
// 	public SegmentHandler<T> locator(Segment segment) {
// 		return new Tracks.LocatorHandler<T>(segment);
// 	}
// 
// 	public SegmentHandler<T> swtch(Segment segment) {
// 		return new Tracks.SwitchHandler<T>(segment);
// 	}
// 
// }


import osgi.enroute.trains.cloud.api.Segment;
import osgi.enroute.trains.track.util.SegmentFactoryAdapter;
package osgi.enroute.trains.track.manager.example.provider;


class TrackManagerFactory extends SegmentFactoryAdapter<Object>{
	final ExampleTrackManagerImpl	owner;
	
	TrackManagerFactory(ExampleTrackManagerImpl owner) {
		this.owner = owner;
	}
	
	@Override
// Path: osgi.enroute.trains.api/src/osgi/enroute/trains/cloud/api/Segment.java
// public class Segment extends DTO {
// 
// 	public enum Type {
// 		STRAIGHT, CURVED, SWITCH, SIGNAL, LOCATOR, BLOCK;
// 	}
// 	
// 
// 	/**
// 	 * Our Identity
// 	 */
// 	public String id;
// 	
// 	/**
// 	 * Type of the segment
// 	 */
//  	public Type type;
// 
// 	/**
//  	* Name of the track.This is the name required to get permission 
//  	* from the Track Manager. If this name starts with X then no admission is required. This 
//  	* is generally for switches.
//  	*/
//  	public String track;
//  	
// 	/**
// 	 * Sequence of the segment in the track
// 	 */
// 	public int sequence;
// 
// 	/**
// 	 * Length of the segment in millimeters, can be zero. It an be zero because
// 	 * the relation between the controllers and the switches and the signals is
// 	 * not always 1:1 mappable to controllers. Therefore zero sized segments can
// 	 * be used to map correctly.
// 	 */
// 	public int length;
// 
// 	/**
// 	 * Short code for RFID tag attached to this segment, or 0 for none.
// 	 */
// 	public int tagCode;
// 
// 	/**
// 	 * The associated controller
// 	 */
// 	public int controller = -1;
// 
// 	/**
// 	 * The next segment. Only a switch can have an additional to. The second to
// 	 * is the one selected if the switch is set to its alternative.
// 	 */
// 	public String to[];
// 	
// 	/**
// 	 * The previous segment. Only a switch can have an additional from. The second from
// 	 * is the one selected if the switch is set to its alternative.
// 	 */
// 	public String from[];
// 
// }
// 
// Path: osgi.enroute.trains.util/src/osgi/enroute/trains/track/util/SegmentFactoryAdapter.java
// public class SegmentFactoryAdapter<T> implements SegmentFactory<T> {
// 
// 	@Override
// 	public SegmentHandler<T> create(Segment segment) throws Exception {
// 		SegmentHandler<T> handler;
// 		switch (segment.type) {
// 		case BLOCK:
// 			handler = block(segment);
// 			break;
// 
// 		case CURVED:
// 			handler = curve(segment);
// 			break;
// 		case LOCATOR:
// 			handler = locator(segment);
// 			break;
// 		case SIGNAL:
// 			handler = signal(segment);
// 			break;
// 		case STRAIGHT:
// 			handler = straight(segment);
// 			break;
// 		case SWITCH:
// 			handler = swtch(segment);
// 			break;
// 		default:
// 			throw new IllegalArgumentException("Missing case " + segment.type);
// 		}
// 		handler.segment = segment;
// 		return handler;
// 	}
// 
// 	public SegmentHandler<T> block(Segment segment) {
// 		return new Tracks.BlockHandler<T>(segment);
// 	}
// 
// 	public SegmentHandler<T> curve(Segment segment) {
// 		return new Tracks.CurvedHandler<T>(segment);
// 	}
// 
// 	public SegmentHandler<T> straight(Segment segment) {
// 		return new Tracks.StraightHandler<T>(segment);
// 	}
// 
// 	public SegmentHandler<T> signal(Segment segment) {
// 		return new Tracks.SignalHandler<T>(segment);
// 	}
// 
// 	public SegmentHandler<T> locator(Segment segment) {
// 		return new Tracks.LocatorHandler<T>(segment);
// 	}
// 
// 	public SegmentHandler<T> swtch(Segment segment) {
// 		return new Tracks.SwitchHandler<T>(segment);
// 	}
// 
// }


// Path: osgi.enroute.trains.track.manager.example.provider/src/osgi/enroute/trains/track/manager/example/provider/TrackManagerFactory.java
import osgi.enroute.trains.cloud.api.Segment;
import osgi.enroute.trains.track.util.SegmentFactoryAdapter;

package osgi.enroute.trains.track.manager.example.provider;


class TrackManagerFactory extends SegmentFactoryAdapter<Object>{
	final ExampleTrackManagerImpl	owner;
	
	TrackManagerFactory(ExampleTrackManagerImpl owner) {
		this.owner = owner;
	}
	
	@Override
	public Signal signal(Segment segment) {