@SuppressWarnings("unchecked")
	public void readObjectFile(String fn) throws IOException{
		this.setFilename(fn);
		File file = new File(filename);
		
		if (file.exists())
		{
			try
			{
				f = new FileInputStream(file);
				o = new ObjectInputStream(f);
				
				try
				{
					do
					{
						objectlist.add((E) o.readObject());
					}while(f.available() > 0);
				}
				catch (EOFException e)
				{
					System.err.println("End of file reached");
				}
				catch (ClassNotFoundException e)
				{
					System.err.println("Class does not exist");
				}
			}
			catch (FileNotFoundException e)
			{
				System.err.println("File not found exception");
			}
			catch (IOException e)
			{
				System.err.println("IO exception in reader. Filename is".concat(filename));
			} 
			catch (NullPointerException e)
			{
				System.err.println("Null pointer exception");
			}
			finally
			{
				o.close();
			}
			
		}
		//else throw new NullPointerException();
	}