<commit_before>//package libManGUI;

/**
 * 
 * @author <NAME>
 * This class serves as a Management class for the user's library.  Then methods here
 * are used to handle and change the library's data which is held in an epandableArray
 * object
 */
public class libManager
{
	public static expandableArray books;
	static int menuDecision = 0;	

	/**
	 * Default Constructor
	 */
	public libManager()
	{
		books = new expandableArray();
	}
	
	/**
	 * @author <NAME>
	 * This method serves as a handler method to handle the addition of books to the
	 * expandableArray object.
	 * @param title 
	 */
	public static String addHandler(String title)
	{
		if(title == null)
		{
			return "Error";
		}
		Book newBook = new Book(title);
		newBook.setTitle(title);
		books.addBook(newBook);
		books.writeToFile();
		return newBook.displayReport();	
		
	}

	/**
	 * @author <NAME>, <NAME>
	 * This method serves as a handler method to make searching for a book in the 
	 * expandableArray object easy
	 */
	public static String searchHandler(String searchItem)
	{
		if(searchItem == null)
		{
			return "Error";
		}
		if(books.search(searchItem) == null)
		{
			return "Error";
		}
		Book bk = books.search(searchItem);
		return bk.displayReport();
	}
	
	public static String chkOutHandler(String bookTitle, String renter){
		if(bookTitle == null || renter == null)
		{
			return "Error";
		}
		String report = books.checkOut(bookTitle, renter);
		if(report == null)
		{
			return "Error";
		}
	//	bk.setMyRenter(renter);
		return report;
	}
	/**
	 * @author <NAME>
	 * This method is used as a handler class.  It is needed to help make it easy to
	 * edit the infomation in the expandableArray object
	 */
	public static void editHandler(String searchItem)
	{
		Book bk = books.search(searchItem);
	    books.editBook(bk);
	    if(bk != null)
	    {
	    	bk.displayReport();
	    }
	}
        public static void readInHandler()
	{
		books.readFromFile();
	}	
	public void removeHandler(String searchItem)
	{
		Book bk = books.search(searchItem);
		books.removeBook(bk);
		books.writeToFile();
	}
}<commit_msg>Added a writeToFileHandler used when the save button is clicked<commit_after>//package libManGUI;

/**
 * 
 * @author <NAME>
 * This class serves as a Management class for the user's library.  Then methods here
 * are used to handle and change the library's data which is held in an epandableArray
 * object
 */
public class libManager
{
	public static expandableArray books;
	static int menuDecision = 0;	

	/**
	 * Default Constructor
	 */
	public libManager()
	{
		books = new expandableArray();
	}
	
	/**
	 * @author <NAME>
	 * This method serves as a handler method to handle the addition of books to the
	 * expandableArray object.
	 * @param title 
	 */
	public static String addHandler(String title)
	{
		if(title == null)
		{
			return "Error";
		}
		Book newBook = new Book(title);
		newBook.setTitle(title);
		books.addBook(newBook);
		return newBook.displayReport();	
		
	}

	/**
	 * @author <NAME>, <NAME>
	 * This method serves as a handler method to make searching for a book in the 
	 * expandableArray object easy
	 */
	public static String searchHandler(String searchItem)
	{
		if(searchItem == null)
		{
			return "Error";
		}
		if(books.search(searchItem) == null)
		{
			return "Error";
		}
		Book bk = books.search(searchItem);
		return bk.displayReport();
	}
	
	public static String chkOutHandler(String bookTitle, String renter){
		if(bookTitle == null || renter == null)
		{
			return "Error";
		}
		String report = books.checkOut(bookTitle, renter);
		if(report == null)
		{
			return "Error";
		}
	//	bk.setMyRenter(renter);
		return report;
	}
	/**
	 * @author <NAME>
	 * This method is used as a handler class.  It is needed to help make it easy to
	 * edit the infomation in the expandableArray object
	 */
	public static void editHandler(String searchItem)
	{
		Book bk = books.search(searchItem);
	    books.editBook(bk);
	    if(bk != null)
	    {
	    	bk.displayReport();
	    }
	}
        public static void readInHandler()
	{
		books.readFromFile();
	}	
	public void removeHandler(String searchItem)
	{
		Book bk = books.search(searchItem);
		books.removeBook(bk);
		books.writeToFile();
	}

	public static void writeToFileHandler()
	{
		books.writeToFile();
	}
}
{'fraction_non_alphanumeric': 0.11064621106462111, 'fraction_numerical': 0.00046490004649000463, 'mean_word_length': 3.2519762845849804, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3573435', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1359, 'n_words': 425}