// File: Bike.java
// Time-stamp: "2005-08-18 13:46:15 calvanese"
// Purpose: Written exam 28/6/2005 - BSC in Production Engineering
//          solution part 1

import java.io.*;

public class Bike {

  // representation of the objects
  private String code;
  private String color;
  private int minweight;
  private int maxweight;

  // pubblic methods

  public Bike(String cod, String col, int minw, int maxw) {
    code = cod;
    color = col;
    minweight = minw;
    maxweight = maxw;
  }
  
  public String getCode() {
    return code;
  }
  
  public String getColor() {
    return color;
  }
  
  public int getMinWeight() {
    return minweight;
  }
  
  public int getMaxWeight() {
    return maxweight;
  }


  // method not requested by the specification
  public static Bike readBike(BufferedReader br) throws IOException {
    String s = br.readLine();
    if (s != null && !s.equals("")) {
      String[] fields = s.split(" +");
      Bike b = new Bike(fields[0], fields[1], Integer.parseInt(fields[2]),
                        Integer.parseInt(fields[3]));
      return b;
    } else
      return null;
  }

}
