package edu.clemson.KayLeigh.Semeraro;

public class Book {

	String title;
	String author;
	Person person;
	
	public Book(String string)
	{
		this.title = string;
		this.author = "unknown author";
		
	}
	
	public String getTitle()
	{
		return title;
	}
	
	public String getAuthor()
	{
		return author;
	}
	
	public void setTitle(String title)
	{
		this.title = title;
	}
	
	public void setAuthor(String author)
	{
		this.author = author;
	}
	
	public Person getPerson()
	{
		return this.person;
	}
	
	public void setPerson(Person p2)
	{
		person = p2;
	}
	
	public String toString()
	{
		String available;
		
		if(this.getPerson() == null)
		{
			available = "Available";
		}
		
		else
		{
			available = "Checked out to " + this.getPerson().getName();
		}
		
		return this.getTitle() + " by " + this.getAuthor() + "; " + available;
	}
	
		
}
