/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package inport; /** * * @author topazh_ag */ public class TransportShip extends MovingObject { private double cargoMax; public double getCargoMax() { return cargoMax; } public void setCargoMax(double cargoMax) { this.cargoMax = cargoMax; } public TransportShip(int id, String name, double cargoMax) { super(id, name); this.cargoMax = cargoMax; } public TransportShip() { } @Override public String toString() { return getId() + ";" + getName() + ";" + cargoMax; } public TransportShip(String s) { super(s); String[] tokens = s.split(";"); cargoMax = Double.parseDouble(tokens[2].trim()); } }