// File: Ski.java
// Time-stamp: "2005-09-18 19:20:16 calvanese"
// Purpose: Written exam 7/6/2005 - BSc in Computer Science (6CFU)
//          solution part 1

import java.io.*;

public class Ski {

  // representation of the objects
  private String code;
  private String brand;
  private int minheight;
  private int maxheight;

  // pubblic methods

  public Ski(String cod, String br, int minh, int maxh) {
    code = cod;
    brand = br;
    minheight = minh;
    maxheight = maxh;
  }
  
  public String getCode() {
    return code;
  }
  
  public String getBrand() {
    return brand;
  }
  
  public int getMinHeight() {
    return minheight;
  }
  
  public int getMaxHeight() {
    return maxheight;
  }


  // method not requested by the specification
  public static Ski readSki(BufferedReader br) throws IOException {
    String s = br.readLine();
    if (s != null && !s.equals("")) {
      String[] fields = s.split(" +");
      Ski ski = new Ski(fields[0], fields[1], Integer.parseInt(fields[2]),
                        Integer.parseInt(fields[3]));
      return ski;
    } else
      return null;
  }

}
