@SuppressWarnings("unchecked")
	private void read(String resourceName)
	{
		ObjectInputStream stream = null;
		try {
			stream = new ObjectInputStream(	new BufferedInputStream(new FileInputStream(resourceName)));
			if(stream != null) {
				switch(resourceName){
				case RESOURCE_VISITS:
					map = (TreeMap<String, Visit>) stream.readObject();
					break;
				case RESOURCE_INDEX:
					index = (TreeMap<String, String>) stream.readObject();
					break;
				}			
			}		
		} catch (FileNotFoundException e) {
			System.out.println("ATTENSION: file " + resourceName + " does not exsists.");
			System.out.println("It will be created.");
		} catch (ClassNotFoundException e) {
			System.out.println(e);
		} catch (IOException e) {
			System.out.println(e);
		} finally {
			init(resourceName);
			try {
				if (stream != null)
					stream.close();
			} catch (IOException e) {
				System.out.println(e);
			}
		}
	}