/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package inport; /** * * @author topazh_ag */ public class MovingTemplate extends TowUsingTemplate { private MovingObject mover; private Berth destination; /** * Get the value of destination * * @return the value of destination */ public Berth getDestination() { return destination; } /** * Set the value of destination * * @param destination new value of destination */ public void setDestination(Berth destination) { this.destination = destination; } /** * Get the value of mover * * @return the value of mover */ public MovingObject getMover() { return mover; } /** * Set the value of mover * * @param mover new value of mover */ public void setMover(MovingObject mover) { this.mover = mover; } public MovingTemplate(MovingObject mover, Berth source, Berth destination, double duration, int id) { super(duration, id, source); this.mover = mover; this.destination = destination; } public MovingTemplate() { super(); } @Override public String toString() { String res = ""; boolean first = true; for(Tow eq : getResources()) { if (!first) res += "," + eq.getId(); else res += eq.getId(); first = false; } return getId() + ";" + "mov;" + twtoString() + ";" + mover.getId() + ";" + getStartLocation().getId() + ";" + destination.getId() + ";[" + res +"];"+getDuration(); } }