// Path: route_lib/src/com/mapyst/FileHandlerInterface.java
// public interface FileHandlerInterface {
// 	
// 	public int getCampusId();
// 	public void setCampusId(int campusId);
// 	
// 	public InputStream getInputStream(String path) throws IOException;
// 	public OutputStream getOutputStream(String path) throws IOException;
// 	
// 	public String readCampusFile();
// 	public String readFile(String fileName);
// }


import java.io.BufferedInputStream;
import java.io.IOException;
import java.util.HashMap;
import com.mapyst.FileHandlerInterface;
/*
 * Copyright (C) 2013 Mapyst
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.mapyst.route;



//parses mapyst data files containing a graph
//each file represents either a floor, building, or campus
public class DataParser {

	private static final int FLOOR = 0;
	private static final int BUILDING = 1;
	private static final int CAMPUS = 2;

	private static final int FILE_VERSION = 1;
	private static final int FILE_VERIFICATION = 0x2417DC43;

// Path: route_lib/src/com/mapyst/FileHandlerInterface.java
// public interface FileHandlerInterface {
// 	
// 	public int getCampusId();
// 	public void setCampusId(int campusId);
// 	
// 	public InputStream getInputStream(String path) throws IOException;
// 	public OutputStream getOutputStream(String path) throws IOException;
// 	
// 	public String readCampusFile();
// 	public String readFile(String fileName);
// }


// Path: route_lib/src/com/mapyst/route/DataParser.java
import java.io.BufferedInputStream;
import java.io.IOException;
import java.util.HashMap;
import com.mapyst.FileHandlerInterface;

/*
 * Copyright (C) 2013 Mapyst
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.mapyst.route;



//parses mapyst data files containing a graph
//each file represents either a floor, building, or campus
public class DataParser {

	private static final int FLOOR = 0;
	private static final int BUILDING = 1;
	private static final int CAMPUS = 2;

	private static final int FILE_VERSION = 1;
	private static final int FILE_VERIFICATION = 0x2417DC43;

	public static void parseFile(String file, HashMap<WaypointID, GraphNode<Waypoint2D>> allNodes, FileHandlerInterface fileHandler) {