/**
 * Class that models a generic baseball/softball player.
 *   @author Dave Reed
 *   @version 4/17/12
 */
public class BallPlayer {
    private int number;
    private String firstName;
    private String lastName;
    private String position;
    
    /**
     * Constructs a BallPlayer object.
     * @param number the player's uniform number
     * @param fname the player's first name
     * @param lname the player's last name
     * @param pos the player's position (e.g., "1B", "CF", "SP")
     */
    public BallPlayer(int number, String fname, String lname, String pos) {
        this.number = number;
        this.firstName = fname;
        this.lastName = lname;
        this.position = pos;
    }
    
    /**
     * @return the player's uniform number
     */
    public int number() {
        return this.number;
    }
    
    /**
     * @return the player's name
     */
    public String name() {
        return this.firstName + " " + this.lastName;
    }
    
    /**
     * @return the player's position
     */    
    public String position() {
        return this.position;
    }
    
    /**
     * @return the player's information in a String
     */    
    public String toString() {
        return this.number + " " + this.firstName + " " + 
               this.lastName + " " + this.position;
    }
    
////////////////////////////////////////////////////////////////////////
    
    public static void main(String[] args) {
        BallPlayer p = new BallPlayer(12, "Joe", "Smith", "1B");
        System.out.println(p);
    }
}
