university
Class Library

java.lang.Object
  extended by university.Unit
      extended by university.Library
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Library
extends Unit
implements java.io.Serializable

Singelton Class for the library of the university.

See Also:
Serialized Form

Method Summary
 void addBook(Book book)
          Adds a new book to the Library.
static Unit create(java.lang.String name, Address address)
          Creates a Libarary unit for the university.
 java.lang.String getBooks()
          Get a list of all the books in the library.
static Unit getInstance()
          Retruns an instance of Library.
 boolean search(java.lang.String title)
          Search if the Library contains a book.
 
Methods inherited from class university.Unit
getAddress, getName, setAddress, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static Unit getInstance()
Retruns an instance of Library.

Returns:
Unit an instance of Library.

create

public static Unit create(java.lang.String name,
                          Address address)
Creates a Libarary unit for the university.

Parameters:
name - The name of the Library.
address - The address of the Library.
Returns:
Unit the new unit created.

search

public boolean search(java.lang.String title)
Search if the Library contains a book.

Parameters:
title - The title of the Book to search for.
Returns:
boolean if the book exists

addBook

public void addBook(Book book)
Adds a new book to the Library.

Parameters:
book - The book to add to the library.

getBooks

public java.lang.String getBooks()
Get a list of all the books in the library.

Returns:
String a String representing all books in the Library.