/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package inport; /** * * @author topazh_ag */ public class MooringTemplate extends TowUsingTemplate { private TransportShip moorer; private boolean direct; /** * Get the value of direction * * @return the value of direction */ public boolean isDirect() { return direct; } /** * Set the value of direction * * @param direction new value of direction */ public void setDirect(boolean direct) { this.direct = direct; } /** * Get the value of moorer * * @return the value of moorer */ public MovingObject getMoorer() { return moorer; } /** * Set the value of moorer * * @param mover new value of moorer */ public void setMoorer(TransportShip moorer) { this.moorer = moorer; } public MooringTemplate(TransportShip moorer, Berth berth, double duration, boolean direct, int id) { super(duration, id, berth); this.moorer = moorer; this.direct = direct; } public MooringTemplate() { 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; } String code = "mrn"; if (!direct) code = "unm"; return getId() + ";" + code + ";" + twtoString() + ";" + moorer.getId() + ";" + getStartLocation().getId() + ";[" + res +"];"+getDuration(); } }