/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package inport; /** * * @author topazh_ag */ public class Cargo { private double cost; private int id; private String name; /** * Get the value of cost * * @return the value of cost */ public double getCost() { return cost; } /** * Set the value of cost * * @param cost new value of cost */ public void setCost(double cost) { this.cost = cost; } /** * Get the value of name * * @return the value of name */ public String getName() { return name; } /** * Set the value of name * * @param name new value of name */ public void setName(String name) { this.name = name; } /** * Get the value of id * * @return the value of id */ public int getId() { return id; } /** * Set the value of id * * @param id new value of id */ public void setId(int id) { this.id = id; } public Cargo(double cost, int id, String name) { this.cost = cost; this.id = id; this.name = name; } public Cargo() { } @Override public String toString() { return id + "; " + name + "; " + cost; } public Cargo(String s) { String[] tokens = s.split(";"); id = Integer.parseInt(tokens[0].trim()); name = tokens[1].trim(); cost = 0; //Double.parseDouble(tokens[2]); } }