第二个任务差一步版本

package routingtile;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.HashMap;

public class TestMain {
	private static RoutingTileHeader header = new RoutingTileHeader();		
    private static SimpleIntersectionList simpleIntersection = new SimpleIntersectionList();
	private static LinkList link = new LinkList();
	private static RoutingIdRangeList routingIdRange = new RoutingIdRangeList();
	protected static final int BITS_PER_BYTE = 0x8;
	private static Readblom rb;
	private final static StringBuilder strB = HexFinder.readData();
	//创建一个指针
	private static int pointer;
	public static void main(String[] agrs)throws Exception{
			//header赋值
			routingTileHeader();
			//调用交叉点方法
			simpleIntersection();
			//调用link方法
			link();
			//调用routingIdRange方法
			routingIdRange();
	}
	/**
	 * routingIdRange方法,返回RoutingIdRangeList
	 * @throws IOException
	 */
	public static RoutingIdRangeList routingIdRange() throws IOException{
		//创建一个mp用于接收返回值
		HashMap<String, Integer> mp;
	    //初始化LinkIdRangeListOffset指针位置
		HexFinder.initialize(header.getLinkIdRangeListOffset());
		//numFeatureRanges
		RoutingIdRangeList rIRL = new RoutingIdRangeList();
		NumRoutingListElements nRLE = new NumRoutingListElements();
		mp = HexFinder.dicedall(16,pointer, strB);
		pointer = mp.get("pointer");
		int numFeatureRanges = mp.get("value");
		rIRL.setNumFeatureRanges(nRLE);
		nRLE.setNumFeatureRanges(numFeatureRanges);
		System.out.println("\r\n" + "numFeatureRanges:" + nRLE.getNumFeatureRanges());
		
		ArrayList<RouteNumberRange> featureranges = new ArrayList<RouteNumberRange>();
		for (int p = 0; p < nRLE.getNumFeatureRanges(); p++) {
			RouteNumberRange rNr = new RouteNumberRange();
			NumRoutingListElements NRLE = new NumRoutingListElements();
			
			mp = HexFinder.dicedall(16,pointer, strB);
			pointer = mp.get("pointer");
			int startFeatureId = mp.get("value");
			rNr.setStartFeatureId1(NRLE);
			NRLE.setStartFeatureId(startFeatureId);
//			System.out.println("startFeatureId:" + NRLE.getStartFeatureId());
			
			mp = HexFinder.dicedall(16,pointer, strB);
			pointer = mp.get("pointer");
			int endFeatureId = mp.get("value");
			rNr.setEndFeatureId1(NRLE);
			NRLE.setEndFeatureId(endFeatureId);
//			System.out.println("EndFeatureId:" + NRLE.getEndFeatureId());
			
			featureranges.add(rNr);
		}
		
		routingIdRange.setFeatureRange(featureranges);
		//输出所有值
		for (RouteNumberRange routingidranges : featureranges) {
		     System.out.println("\n"+"startFeatureId:" + routingidranges.getStartFeatureId1().getStartFeatureId());
		     System.out.println("EndFeatureId:" + routingidranges.getEndFeatureId1().getEndFeatureId());
		    }
		return routingIdRange;
	}
	/**
	 * link方法,返回LinkList
	 * @throws IOException
	 */
	public static LinkList link() throws IOException{
		//创建一个mp用于接收返回值
		HashMap<String, Integer> mp;
	    //初始化LinksOffset指针位置
		HexFinder.initialize(header.getLinksOffset());
		//numLinks
		LinkList linkList = new LinkList();
		mp = HexFinder.dicedall(16,pointer, strB);
		pointer = mp.get("pointer");
		int numnumLinks = mp.get("value");
		linkList.setNumnumLinks(numnumLinks);
		System.out.println("\n" + "numLinks:" + linkList.getNumnumLinks());
		
		ArrayList<Link> links = new ArrayList<Link>();
		for (int j = 0; j < linkList.getNumnumLinks(); j++) {
			//linkList.getNumnumLinks()
			Link lk = new Link();
			FeatureLength FL = new FeatureLength();
			StringBuilder stB = new StringBuilder();
			
			for (int k = 0; k < 32/BITS_PER_BYTE; k++) {
				mp = HexFinder.dicedall(1,pointer, strB);
				pointer = mp.get("pointer");
				int first = mp.get("value");
				if (first == 1) {
					for (int m = 0; m < BITS_PER_BYTE - 1; m++) {
						mp = HexFinder.dicedall(1, pointer, strB);
						pointer = mp.get("pointer");
						int one = mp.get("value");
						stB = stB.append(one);
					}
				}else {
					for (int n = 0; n < BITS_PER_BYTE - 1; n++) {
						mp = HexFinder.dicedall(1, pointer, strB);
						pointer = mp.get("pointer");
						int last = mp.get("value");
						stB = stB.append(last);
						//最后七位二进制
					}
					break;
				}
			}
			Long length = Long .valueOf(stB.toString(),2);
			FL.setLength1(length);
			lk.setLength(FL);
//			System.out.println("length:" + FL.getLength());
			
			AttributeSource aBS = new AttributeSource();              //选择   0   1
			mp = HexFinder.dicedall(1,pointer, strB);
			pointer = mp.get("pointer");
			int attrSource = mp.get("value");
			
			RoutingAttributeInfo rABI = new RoutingAttributeInfo();   //选择
			
			//attrsource == 0       INDEXED = 0         输出INDEXED(0)  
			if (attrSource == 0) {
			aBS.setAttrsource1(false);
//			System.out.println("attrSource: INDEXED (" + aBS.getAttrsource() + ")");
			
            FixedRoadAttributeSetListIndex fRASLI = new FixedRoadAttributeSetListIndex();
            
            mp = HexFinder.dicedall(8,pointer, strB);
			pointer = mp.get("pointer");
			int fixedroadattributesetlistindex = mp.get("value");
			rABI.setFixedRoadAttributeSetListIndex(fRASLI);
			fRASLI.setFixedRoadAttributeSetListIndex(fixedroadattributesetlistindex);
//			System.out.println("fixedRoadAttributeSetListIndex:" + fRASLI.getFixedRoadAttributeSetListIndex());
			lk.setAttrSource(aBS);
			lk.setAttrInfo(rABI);
			
			}else {
				aBS.setAttrsource1(true);
//				System.out.println("attrSource: EXPLICIT (" + aBS.getAttrsource() + ")");
				lk.setAttrSource(aBS);
				lk.setAttrInfo(rABI);
				
				FixedRoadAttributeSet fRABS = new FixedRoadAttributeSet();
				
				SharedRoadAttributes sRA = new SharedRoadAttributes();
				RoutingRoadAttributes rRA = new RoutingRoadAttributes();
				
				PriorityRoadClass pRC = new PriorityRoadClass();
				LinkType lT = new LinkType();
				Direction d = new Direction();
				
				FunctionalRoadClass fRC  = new FunctionalRoadClass();
				
				//SharedRoadAttributes
				mp = HexFinder.dicedall(4,pointer, strB);
				pointer = mp.get("pointer");
				int priorityroadclass = mp.get("value");
				rABI.setFixedAttributes(fRABS);
				sRA.setPriorityRoadClass(pRC);
				pRC.setPriorityRoadClass1(priorityroadclass);
//				System.out.println("priorityRoadClass:" + pRC.getPriorityRoadClass());
				
				mp = HexFinder.dicedall(4,pointer, strB);     //13个选择
				pointer = mp.get("pointer");
				int linkType = mp.get("value");
				rABI.setFixedAttributes(fRABS);
				fRABS.setSharedAttr(sRA);
				sRA.setLinkType(lT);
				lT.setLinkType1(linkType);  //13个选择输出
				
				mp = HexFinder.dicedall(2,pointer, strB);    //4个选择
				pointer = mp.get("pointer");
				int travelDirection = mp.get("value");
				rABI.setFixedAttributes(fRABS);
				fRABS.setSharedAttr(sRA);
				sRA.setTravelDirection(d);
				d.setTravelDirection(travelDirection);
				
				
				mp = HexFinder.dicedall(1,pointer, strB);    
				pointer = mp.get("pointer");
				boolean ferry;
				if(mp.get("value") == 1){
					ferry = true;
				}else{
					ferry = false;
				}
				rABI.setFixedAttributes(fRABS);
				fRABS.setSharedAttr(sRA);
				sRA.setFerry(ferry);
//				System.out.println("ferry:" + sRA.getFerry());
				
				mp = HexFinder.dicedall(1,pointer, strB);    
				pointer = mp.get("pointer");
				boolean tunnel;
				if(mp.get("value") == 1){
					tunnel = true;
				}else{
					tunnel = false;
				}
				rABI.setFixedAttributes(fRABS);
				fRABS.setSharedAttr(sRA);
				sRA.setTunnel(tunnel);
//				System.out.println("tunnel:" + sRA.getTunnel());
				
				mp = HexFinder.dicedall(1,pointer, strB);    
				pointer = mp.get("pointer");
				boolean bridge;
				if(mp.get("value") == 1){
					bridge = true;
				}else{
					bridge = false;
				}
				rABI.setFixedAttributes(fRABS);
				fRABS.setSharedAttr(sRA);
				sRA.setBridge(bridge);
//				System.out.println("bridge:" + sRA.getBridge());
				
				mp = HexFinder.dicedall(2,pointer, strB);    //4个选择
				pointer = mp.get("pointer");
				int toll = mp.get("value");
				rABI.setFixedAttributes(fRABS);
				fRABS.setSharedAttr(sRA);
				sRA.setToll(d);
				d.setToll(toll);
				
				
				mp = HexFinder.dicedall(1,pointer, strB);    
				pointer = mp.get("pointer");
				boolean controlledAccess;
				if(mp.get("value") == 1){
					controlledAccess = true;
				}else{
					controlledAccess = false;
				}
				rABI.setFixedAttributes(fRABS);
				fRABS.setSharedAttr(sRA);
				sRA.setControlledAccess(controlledAccess);
//				System.out.println("controlledAccess:" + sRA.getControlledAccess());
				
				mp = HexFinder.dicedall(1,pointer, strB);    
				pointer = mp.get("pointer");
				boolean serviceArea;
				if(mp.get("value") == 1){
					serviceArea = true;
				}else{
					serviceArea = false;
				}
				rABI.setFixedAttributes(fRABS);
				fRABS.setSharedAttr(sRA);
				sRA.setServiceArea(serviceArea);
//				System.out.println("serviceArea:" + sRA.getServiceArea());
				
				//RoutingRoadAttributes
				mp = HexFinder.dicedall(3,pointer, strB);    
				pointer = mp.get("pointer");
				int functionalRoadClass = mp.get("value");
				rABI.setFixedAttributes(fRABS);
				fRABS.setRoutingAttr(rRA);
				rRA.setFunctionalRoadClass(fRC);
				fRC.setFunctionalRoadClass(functionalRoadClass);
//				System.out.println("functionalRoadClass:" + fRC.getFunctionalRoadClass());
				
				mp = HexFinder.dicedall(1,pointer, strB);    
				pointer = mp.get("pointer");
				boolean urban;
				if(mp.get("value") == 1){
					urban = true;
				}else{
					urban = false;
				}
				rABI.setFixedAttributes(fRABS);
				fRABS.setRoutingAttr(rRA);
				rRA.setUrban(urban);
//				System.out.println("urban:" + rRA.getUrban());
				
				mp = HexFinder.dicedall(1,pointer, strB);    
				pointer = mp.get("pointer");
				boolean complexIntersection;
				if(mp.get("value") == 1){
					complexIntersection = true;
				}else{
					complexIntersection = false;
				}
				rABI.setFixedAttributes(fRABS);
				fRABS.setRoutingAttr(rRA);
				rRA.setComplexIntersection(complexIntersection);
//				System.out.println("complexIntersection:" + rRA.getComplexIntersection());
				
				mp = HexFinder.dicedall(1,pointer, strB);    
				pointer = mp.get("pointer");
				boolean pluralJunction;
				if(mp.get("value") == 1){
					pluralJunction = true;
				}else{
					pluralJunction = false;
				}
				rABI.setFixedAttributes(fRABS);
				fRABS.setRoutingAttr(rRA);
				rRA.setPluralJunction(pluralJunction);
//				System.out.println("pluralJunction:" + rRA.getPluralJunction());
				
				mp = HexFinder.dicedall(1,pointer, strB);    
				pointer = mp.get("pointer");
				boolean motorway;
				if(mp.get("value") == 1){
					motorway = true;
				}else{
					motorway = false;
				}
				rABI.setFixedAttributes(fRABS);
				fRABS.setRoutingAttr(rRA);
				rRA.setMotorway(motorway);
//				System.out.println("motorway:" + rRA.getMotorway());
				
			}
			
			AverageSpeed aS = new AverageSpeed();
			LinkSector lS = new LinkSector();
			
			mp = HexFinder.dicedall(8,pointer, strB);
			pointer = mp.get("pointer");
			int averageSpeed = mp.get("value");
			lk.setAverageSpeed(aS);
			aS.setAverageSpeed(averageSpeed);
//			System.out.println("averageSpeed:" + aS.getAverageSpeed());
			
			mp = HexFinder.dicedall(6,pointer, strB);
			pointer = mp.get("pointer");
			int startangle = mp.get("value");
			lk.setStartAngle(lS);
			lS.setStartAngle(startangle);    
//			System.out.println("startAngle:" + lS.getStartAngle());
			
			mp = HexFinder.dicedall(6,pointer, strB);
			pointer = mp.get("pointer");
			int endangle = mp.get("value");
			lk.setEndAngle(lS);
			lS.setEndAngle(endangle);     
//			System.out.println("endAngle:" + lS.getEndAngle() + "\r\n");
			
//			lk.setAverageSpeed(aS);
//			lk.setStartAngle(lS);
//			lk.setEndAngle(lS);
			
			links.add(lk);
		}
		link.setLink1(links);
		//输出所有值
		for (Link linklink : links) {
		     System.out.println("\n"+"length:" + linklink.getLength().getLength1());
		      if (linklink.getAttrSource().getAttrsource1()) {
		    	  System.out.println("attrSource: EXPLICIT (1)");
		    	  System.out.println("priorityRoadClass:" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getPriorityRoadClass().getPriorityRoadClass1());
		    	  
		    	  switch (linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1()) {
		    	  case 0:
		    		  System.out.println("linkType: " + "NO_SPECIAL (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 1:
		    		  System.out.println("linkType: " + "RAMP (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 2:
		    		  System.out.println("linkType: " + "ROUNDABOUT (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 3:
		    		  System.out.println("linkType: " + "PARALLEL (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 4:
		    		  System.out.println("linkType: " + "SERVICE_ROAD (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 5:
		    		  System.out.println("linkType: " + "MAIN_ROAD (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 6:
		    		  System.out.println("linkType: " + "SQUARE (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 8:
		    		  System.out.println("linkType: " + "PEDESTRIAN_ZONE (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 9:
		    		  System.out.println("linkType: " + "PEDESTRIAN (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 10:
		    		  System.out.println("linkType: " + "ROUNDABOUT_INTERIOR (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 11:
		    		  System.out.println("linkType: " + "SLIP_ROAD (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 12:
		    		  System.out.println("linkType: " + "SPECIAL_TRAFFIC_FIGURE (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  case 13:
		    		  System.out.println("linkType: " + "BOUNDARY (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getLinkType().getLinkType1() + ")");
		    		  break;
		    	  default:
		    		  break;
		    	  }
		    	  switch (linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getTravelDirection().getTravelDirection()) {
		    	  case 0:
		    		  System.out.println("travelDirection: " + "IN_NO_DIRECTION (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getTravelDirection().getTravelDirection() + ")");
		    		  break;
		    	  case 1:
		    		  System.out.println("travelDirection: " + "IN_POSITIVE_DIRECTION (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getTravelDirection().getTravelDirection() + ")");
		    		  break;
		    	  case 2:
		    		  System.out.println("travelDirection: " + "IN_NEGATIVE_DIRECTION (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getTravelDirection().getTravelDirection() + ")");
		    		  break;
		    	  case 3:
		    		  System.out.println("travelDirection: " + "IN_BOTH_DIRECTIONS (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getTravelDirection().getTravelDirection() + ")");
		    		  break;
		    	  default:
		    		  break;
		    	  }
		    	  System.out.println("ferry:" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getFerry());
		    	  System.out.println("tunnel:" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getTunnel());
		    	  System.out.println("bridge:" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getBridge());
		    	  switch (linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getToll().getToll()) {
		    	  case 0:
		    		  System.out.println("toll: " + "IN_NO_DIRECTION (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getToll().getToll() + ")");
		    		  break;
		    	  case 1:
		    		  System.out.println("toll: " + "IN_POSITIVE_DIRECTION (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getToll().getToll() + ")");
		    		  break;
		    	  case 2:
		    		  System.out.println("toll: " + "IN_NEGATIVE_DIRECTION (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getToll().getToll() + ")");
		    		  break;
		    	  case 3:
		    		  System.out.println("toll: " + "IN_BOTH_DIRECTIONS (" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getToll().getToll() + ")");
		    		  break;
		    	  default:
		    		  break;
		    	  }
		    	  System.out.println("controlledAccess:" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getControlledAccess());
		    	  System.out.println("serviceArea:" + linklink.getAttrInfo().getFixedAttributes().getSharedAttr().getServiceArea());
		    	  
		    	  System.out.println("functionalRoadClass:" + linklink.getAttrInfo().getFixedAttributes().getRoutingAttr().getFunctionalRoadClass().getFunctionalRoadClass());
		    	  System.out.println("urban:" + linklink.getAttrInfo().getFixedAttributes().getRoutingAttr().getUrban());
		    	  System.out.println("complexIntersection:" + linklink.getAttrInfo().getFixedAttributes().getRoutingAttr().getComplexIntersection());
		    	  System.out.println("pluralJunction:" + linklink.getAttrInfo().getFixedAttributes().getRoutingAttr().getPluralJunction());
		    	  System.out.println("motorway:" + linklink.getAttrInfo().getFixedAttributes().getRoutingAttr().getMotorway());
		      }else{
		    	  System.out.println("attrSource: INDEXED (0)");
			       System.out.println("fixedRoadAttributeSetListIndex:" + linklink.getAttrInfo().getFixedRoadAttributeSetListIndex().getFixedRoadAttributeSetListIndex());
		         }
		      System.out.println("averageSpeed:" + linklink.getAverageSpeed().getAverageSpeed());
		      System.out.println("startAngle:" + linklink.getStartAngle().getStartAngle());
		      System.out.println("endAngle:" + linklink.getEndAngle().getEndAngle() + "\r\n");
		     }
return link;
}
/**
* simpleIntersection方法,返回SimpleIntersectionList
* @throws IOException
*/
public static SimpleIntersectionList simpleIntersection() throws IOException{
	//创建一个mp用于接收返回值
	HashMap<String, Integer> mp;
	//初始化SimpleIntersectionOffset指针位置
	HexFinder.initialize(header.getSimpleIntersectionOffset());
	//numIntersections
	SimpleIntersectionList numIntersectionList = new SimpleIntersectionList();
	mp = HexFinder.dicedall(16,pointer, strB);
	pointer = mp.get("pointer");
	int numIntersection = mp.get("value");
	numIntersectionList.setNumIntersections(numIntersection);
	System.out.println("numIntersections:" + numIntersectionList.getNumIntersections());
	
	ArrayList<SimpleIntersection> simpleIntersections =new ArrayList<SimpleIntersection>();
	for(int i = 0; i<simpleIntersection.getNumIntersections(); i++) 
	{   
		// 放到CoordXYOffset对象中
		CoordXYOffset coordXYOffset = new CoordXYOffset();
		SimpleIntersection sIntersection = new SimpleIntersection();
		
		mp = HexFinder.dicedall(14,pointer, strB);
		pointer = mp.get("pointer");
		int dx = mp.get("value");
		if (14 < 64 && (dx & (1L << (14-1))) != 0) {
			dx |= (-1L << 14);
		}
		
		mp = HexFinder.dicedall(14,pointer, strB);
		pointer = mp.get("pointer");
		int dy = mp.get("value");
		if (14 < 64 && (dy & (1L << (14-1))) != 0) {
			dy |= (-1L << 14);
		}
		
		coordXYOffset.setDx(dx);
		coordXYOffset.setDy(dy);

		mp = HexFinder.dicedall(8,pointer, strB);
		pointer = mp.get("pointer");
		int numLinks = mp.get("value");

		sIntersection.setNumLinks(numLinks);
		sIntersection.setPosition(coordXYOffset);

		ArrayList<IntOrExtDirectedLinkReference> connectedLinks = new ArrayList<IntOrExtDirectedLinkReference>();
		for(int n = 0; n<sIntersection.getNumLinks(); n++) 
		{   
			DirectedLinkReference dLR= new DirectedLinkReference();
			ExternalDirectedLinkReference eDLR = new ExternalDirectedLinkReference();
			IntOrExtDirectedLinkReference iEDLR = new IntOrExtDirectedLinkReference();
			LinkReferenceChoice choice = new LinkReferenceChoice();

			mp = HexFinder.dicedall(1,pointer, strB);
			pointer = mp.get("pointer");
			int isExternalLinkReference = mp.get("value");					

			//IsExternalLinkReference等于false时
			if(isExternalLinkReference==0){
				iEDLR.setIsExternalLinkReference(false);

				mp = HexFinder.dicedall(1,pointer, strB);
				pointer = mp.get("pointer");

				boolean positiveLinkDirection;	
				if(mp.get("value") == 1){
					positiveLinkDirection = true;
				}else{
					positiveLinkDirection = false;
				}
				dLR.setPositiveLinkDirection(positiveLinkDirection);
				mp = HexFinder.dicedall(15,pointer, strB);
				pointer = mp.get("pointer");
				int linkId = mp.get("value");
				
				dLR.setLinkId(linkId);
				choice.setInternalLinkReference(dLR);
				choice.setExternalLinkReference(eDLR);
				iEDLR.setLinkReferenceChoice(choice);
				connectedLinks.add(iEDLR);	
			}else{       //true
				iEDLR.setIsExternalLinkReference(true);
				
				mp = HexFinder.dicedall(8,pointer, strB);
				pointer = mp.get("pointer");
				int extTileIdx = mp.get("value");

				mp = HexFinder.dicedall(1,pointer, strB);
				pointer = mp.get("pointer");
				boolean positiveLinkDirection;
				if(mp.get("value") == 1){
					positiveLinkDirection = true;
				}else{
					positiveLinkDirection = false;
				}
				dLR.setPositiveLinkDirection(positiveLinkDirection);
				
				mp = HexFinder.dicedall(15,pointer, strB);
				pointer = mp.get("pointer");
				int linkId = mp.get("value");

				dLR.setLinkId(linkId);
				eDLR.setTileExternalLinkReference(dLR);
				eDLR.setExtTileIdx(extTileIdx);
				eDLR.setTileExternalLinkReference(dLR);
				choice.setInternalLinkReference(dLR);
				choice.setExternalLinkReference(eDLR);
				iEDLR.setLinkReferenceChoice(choice);
				connectedLinks.add(iEDLR);
			}
		}
		sIntersection.setConnectedLinks(connectedLinks);
		simpleIntersections.add(sIntersection);
	}
	simpleIntersection.setSimpleIntersection(simpleIntersections);
	//输出所有值
	for (SimpleIntersection Intersection : simpleIntersections) {
	     System.out.println("\n"+"dx:" + Intersection.getPosition().getDx());
	     System.out.println("dy:" + Intersection.getPosition().getDy());
	     System.out.println("numLinks:" + Intersection.getNumLinks());
	     for (IntOrExtDirectedLinkReference Intorextdirectedlinkreference: Intersection.getConnectedLinks() ) {
	      System.out.println("isExternalLinkReference:" + Intorextdirectedlinkreference.getIsExternalLinkReference());
	      if (Intorextdirectedlinkreference.getIsExternalLinkReference()) {
	       System.out.println("extTileIdx:" + Intorextdirectedlinkreference.getLinkReferenceChoice().getExternalLinkReference().getExtTileIdx());
	       System.out.println("positiveLinkDirection:" + Intorextdirectedlinkreference.getLinkReferenceChoice().getExternalLinkReference().getTileExternalLinkReference().getPositiveLinkDirection());
	       System.out.println("LinkId:" + Intorextdirectedlinkreference.getLinkReferenceChoice().getExternalLinkReference().getTileExternalLinkReference().getLinkId());
	      }else {
	    	  System.out.println("positiveLinkDirection:" + Intorextdirectedlinkreference.getLinkReferenceChoice().getInternalLinkReference().getPositiveLinkDirection());
		      System.out.println("LinkId:" + Intorextdirectedlinkreference.getLinkReferenceChoice().getInternalLinkReference().getLinkId());
	         }
	     }
	    }
	
	    //取第几条
/*			    SimpleIntersection intersection = simpleIntersection.getSimpleIntersection().get(15);
	    System.out.println("dx:" + intersection.getPosition().getDx());
	    System.out.println("dy:" + intersection.getPosition().getDy());
	    System.out.println("NumLinks:" + intersection.getNumLinks());
	    ArrayList<IntOrExtDirectedLinkReference> connectedLinks = intersection.getConnectedLinks();
	    for (int i = 0; i < connectedLinks.size(); i++) {
	    	if (connectedLinks.get(i).getIsExternalLinkReference()) {
	    		   System.out.println("IsExternalLinkReference:" + connectedLinks.get(i).getIsExternalLinkReference());
			       System.out.println("extTileIdx:" + connectedLinks.get(i).getLinkReferenceChoice().getExternalLinkReference().getExtTileIdx());
			       System.out.println("positiveLinkDirection:" + connectedLinks.get(i).getLinkReferenceChoice().getExternalLinkReference().getTileExternalLinkReference().getPositiveLinkDirection());
			       System.out.println("LinkId:" + connectedLinks.get(i).getLinkReferenceChoice().getExternalLinkReference().getTileExternalLinkReference().getLinkId());
			      }else {
			    	  System.out.println("IsExternalLinkReference:" + connectedLinks.get(i).getIsExternalLinkReference());
			    	  System.out.println("positiveLinkDirection:" + connectedLinks.get(i).getLinkReferenceChoice().getInternalLinkReference().getPositiveLinkDirection());
				      System.out.println("LinkId:" + connectedLinks.get(i).getLinkReferenceChoice().getInternalLinkReference().getLinkId());
			         }
		}
*/
	return simpleIntersection;
}
/**
 * routingTileHeader方法,给header赋值
 * @throws IOException
 */
public static void routingTileHeader() throws IOException{
	RandomAccessFile in=new RandomAccessFile("first.dat","r");
	rb = new Readblom(2);
	in.read(rb.buffer, 0, 2);
	RoutingContentMask routingcontentmask = new RoutingContentMask();
	routingcontentmask.setHasFixedRoadAttributeSetList(rb.readBool());
	routingcontentmask.setHasSimpleIntersectionList(rb.readBool()); 	
	routingcontentmask.setHasLinkList(rb.readBool()); 		
	routingcontentmask.setHasRouteUpLinkList(rb.readBool()); 		
	routingcontentmask.setHasRouteDownLinkList(rb.readBool()); 		
	routingcontentmask.setHasLinkToTileList(rb.readBool()); 		
	routingcontentmask.setHasLinkIdRangeList(rb.readBool()); 		
	routingcontentmask.setHasSimpleIntersectionIdRangeList(rb.readBool()); 		
	routingcontentmask.setHasAttributeMaps(rb.readBool()); 		
	routingcontentmask.setHasExternalTileIdList(rb.readBool());
	header.setContentMask(routingcontentmask);
	if(header.getContentMask().getHasFixedRoadAttributeSetList() == true) 
	{
		header.setFixedRoadAttributeSetListOffset(in.readInt());
	}
	if(header.getContentMask().getHasSimpleIntersectionList() == true) 
	{
		header.setSimpleIntersectionOffset(in.readInt());
	}
	if(header.getContentMask().getHasLinkList()== true) 
	{
		header.setLinksOffset(in.readInt());
	}
	if(header.getContentMask().getHasRouteUpLinkList()== true) 
	{
		header.setRouteUpLinksOffset(in.readInt());
	}
	if(header.getContentMask().getHasRouteDownLinkList()== true) 
	{
		header.setRouteDownLinksOffset(in.readInt());
	}
	if(header.getContentMask().getHasLinkToTileList()== true) 
	{
		header.setLink2TileListOffset(in.readInt());
	}
	if(header.getContentMask().getHasLinkIdRangeList()== true) 
	{
		header.setLinkIdRangeListOffset(in.readInt());
	}
	if(header.getContentMask().getHasSimpleIntersectionIdRangeList()== true) 
	{
		header.setSimplIntIdRangeListOffset(in.readInt());
	}
	if(header.getContentMask().getHasAttributeMaps()== true) 
	{
		header.setAttributeMapsOffset(in.readInt());
	}
	if(header.getContentMask().getHasExternalTileIdList()== true) 
	{
		header.setExternalTileIdListOffset(in.readInt());
	}
/*	System.out.println(
			+header.getFixedRoadAttributeSetListOffset() + "\r\n"
			+header.getSimpleIntersectionOffset() + "\r\n"
			+header.getLinksOffset() + "\r\n"
			+header.getRouteUpLinksOffset() + "\r\n"
			+header.getRouteDownLinksOffset() + "\r\n"
			+header.getLink2TileListOffset() + "\r\n"
			+header.getSimplIntIdRangeListOffset() + "\r\n"
			+header.getLinkIdRangeListOffset() + "\r\n"
			+header.getAttributeMapsOffset() + "\r\n"
			+header.getExternalTileIdListOffset() + "\r\n");
	*/
	in.seek(header.getSimpleIntersectionOffset());
	simpleIntersection.setNumIntersections(in.readShort());
}
}


 

class Readblom{
	protected int bytePosition;
	protected int bitOffset;
	protected static final byte BYTE_MOD_MASK = 0x7;
	protected static final int BITS_PER_BYTE = 0x8;
	protected static final int BITS_PER_LONG = 0x40;
	public byte[] buffer;
	Readblom(int b)
	{
		buffer = new byte[b];
	}
	public long getBitPosition()
    {
        return BITS_PER_BYTE * bytePosition + bitOffset;
    }
	//设置bit位置
    public void setBitPosition(final long bitPosition) throws IOException
    {
        bitOffset = (int)(bitPosition % 8);
        bytePosition = (int)(bitPosition / BITS_PER_BYTE);
    }
	private byte nextByte() throws IOException
    {
        if (bytePosition >= buffer.length)
            throw new IOException("ByteArrayBitStreamReader: Unable to read byte on offset position " +
                    (bytePosition + 1) + ". It's beyond end of the stream with length " + buffer.length + ".");
        return buffer[bytePosition++];
    }
    /**
     * Returns the next unsigned byte without resetting the bit offset.
     *
     * @return Read next byte.
     *
     * @throws IOException If the reading failed.
     */
    private int nextUnsignedByte() throws IOException
    {
        return nextByte() & 0xff;
    }
	public boolean readBool() throws IOException
	{
	    return readBits(1) == 1;
	}
	//有符号位
	 public long readSignedBits(final int numBits) throws IOException
    {
        long result = readBits(numBits);
        /*
         * Perform a sign extension if needed.
         * 1L << 64 in Java is not 0L, but 1L, so treat numBits == 64 as a special case
         * (numBits == 64 does not need sign extension anyway)
         */
        if (numBits < 64 && (result & (1L << (numBits - 1))) != 0)
        {
            result |= (-1L << numBits);
        }
        return result;
    }
	 public long readBits(final int numBits) throws IOException
    {
        int bitsToRead = bitOffset + numBits;
        final int nextBitOffset = bitsToRead & BYTE_MOD_MASK;
        long accum = 0L;
        while (bitsToRead > 0)
        {
            accum = (accum << BITS_PER_BYTE) | nextUnsignedByte();
            bitsToRead -= BITS_PER_BYTE;
        }
        bitOffset = nextBitOffset;
        if (nextBitOffset != 0)
        {
            bytePosition--;
        }
        /*
         * Shift away unwanted bits on the right and mask out unwanted bits on
         * the left.
         */
        return (accum >>> -bitsToRead) & (-1L >>> (BITS_PER_LONG - numBits));
    }
}

class RoutingContentMask{
	private boolean hasFixedRoadAttributeSetList; 	
	private boolean hasSimpleIntersectionList; 		
	private boolean hasLinkList; 		
	private boolean hasRouteUpLinkList; 		
	private boolean hasRouteDownLinkList; 		
	private boolean hasLinkToTileList; 		
	private boolean hasLinkIdRangeList; 		
	private boolean hasSimpleIntersectionIdRangeList; 		
	private boolean hasAttributeMaps; 		
	private boolean hasExternalTileIdList;
	public RoutingContentMask() {}
	public void setHasFixedRoadAttributeSetList(boolean hasFixedRoadAttributeSetList) {
		this.hasFixedRoadAttributeSetList = hasFixedRoadAttributeSetList;
	}
	public boolean getHasFixedRoadAttributeSetList() {
		return hasFixedRoadAttributeSetList;
	}
	public void setHasSimpleIntersectionList(boolean hasSimpleIntersectionList) {
		this.hasSimpleIntersectionList = hasSimpleIntersectionList;
	}
	public boolean getHasSimpleIntersectionList() {
		return hasSimpleIntersectionList;
	}
	public void setHasLinkList(boolean hasLinkList) {
		this.hasLinkList = hasLinkList;
	}
	public boolean getHasLinkList() {
		return hasLinkList;
	}
	public void setHasRouteUpLinkList(boolean hasRouteUpLinkList) {
		this.hasRouteUpLinkList = hasRouteUpLinkList;
	}
	public boolean getHasRouteUpLinkList() {
		return hasRouteUpLinkList;
	}
	public void setHasRouteDownLinkList(boolean hasRouteDownLinkList) {
		this.hasRouteDownLinkList = hasRouteDownLinkList;
	}
	public boolean getHasRouteDownLinkList() {
		return hasRouteDownLinkList;
	}
	public void setHasLinkToTileList(boolean hasLinkToTileList) {
		this.hasLinkToTileList = hasLinkToTileList;
	}
	public boolean getHasLinkToTileList() {
		return hasLinkToTileList;
	}
	public void setHasLinkIdRangeList(boolean hasLinkIdRangeList) {
		this.hasLinkIdRangeList = hasLinkIdRangeList;
	}
	public boolean getHasLinkIdRangeList() {
		return hasLinkIdRangeList;
	}
	public void setHasSimpleIntersectionIdRangeList(boolean hasSimpleIntersectionIdRangeList) {
		this.hasSimpleIntersectionIdRangeList = hasSimpleIntersectionIdRangeList;
	}
	public boolean getHasSimpleIntersectionIdRangeList() {
		return hasSimpleIntersectionIdRangeList;
	}
	public void setHasAttributeMaps(boolean hasAttributeMaps) {
		this.hasAttributeMaps = hasAttributeMaps;
	}
	public boolean getHasAttributeMaps() {
		return hasAttributeMaps;
	}
	public void setHasExternalTileIdList(boolean hasExternalTileIdList) {
		this.hasExternalTileIdList = hasExternalTileIdList;
	}
	public boolean getHasExternalTileIdList() {
		return hasExternalTileIdList;
	}
}

 class RoutingTileHeader {
		RoutingContentMask  contentMask;
		int fixedRoadAttributeSetListOffset;
		int simpleIntersectionOffset;
		int linksOffset;
		int routeUpLinksOffset;
		int routeDownLinksOffset;
		int link2TileListOffset;
		int linkIdRangeListOffset;
		int simplIntIdRangeListOffset;
		int attributeMapsOffset;
		int externalTileIdListOffset;
		public RoutingTileHeader() {}
		public RoutingContentMask getContentMask() {
			return contentMask;
		}
		public void setContentMask(RoutingContentMask contentMask) {
			this.contentMask = contentMask;
		}
		public int getFixedRoadAttributeSetListOffset() {
			return fixedRoadAttributeSetListOffset;
		}
		public void setFixedRoadAttributeSetListOffset(int fixedRoadAttributeSetListOffset) {
			this.fixedRoadAttributeSetListOffset = fixedRoadAttributeSetListOffset;
		}
		public int getSimpleIntersectionOffset() {
			return simpleIntersectionOffset;
		}
		public void setSimpleIntersectionOffset(int simpleIntersectionOffset) {
			this.simpleIntersectionOffset = simpleIntersectionOffset;
		}
		public int getLinksOffset() {
			return linksOffset;
		}
		public void setLinksOffset(int linksOffset) {
			this.linksOffset = linksOffset;
		}
		public int getRouteUpLinksOffset() {
			return routeUpLinksOffset;
		}
		public void setRouteUpLinksOffset(int routeUpLinksOffset) {
			this.routeUpLinksOffset = routeUpLinksOffset;
		}
		public int getRouteDownLinksOffset() {
			return routeDownLinksOffset;
		}
		public void setRouteDownLinksOffset(int routeDownLinksOffset) {
			this.routeDownLinksOffset = routeDownLinksOffset;
		}
		public int getLink2TileListOffset() {
			return link2TileListOffset;
		}
		public void setLink2TileListOffset(int link2TileListOffset) {
			this.link2TileListOffset = link2TileListOffset;
		}
		public int getLinkIdRangeListOffset() {
			return linkIdRangeListOffset;
		}
		public void setLinkIdRangeListOffset(int linkIdRangeListOffset) {
			this.linkIdRangeListOffset = linkIdRangeListOffset;
		}
		public int getSimplIntIdRangeListOffset() {
			return simplIntIdRangeListOffset;
		}
		public void setSimplIntIdRangeListOffset(int simplIntIdRangeListOffset) {
			this.simplIntIdRangeListOffset = simplIntIdRangeListOffset;
		}
		public int getAttributeMapsOffset() {
			return attributeMapsOffset;
		}
		public void setAttributeMapsOffset(int attributeMapsOffset) {
			this.attributeMapsOffset = attributeMapsOffset;
		}

		public int getExternalTileIdListOffset() {
			return externalTileIdListOffset;
		}
		public void setExternalTileIdListOffset(int externalTileIdListOffset) {
			this.externalTileIdListOffset = externalTileIdListOffset;
		}
	}
 class SimpleIntersectionList {
		private int numIntersections;
		private ArrayList<SimpleIntersection> simpleIntersection;//simpleIntersection[numIntersections]	
		public SimpleIntersectionList() {}
		public int getNumIntersections() {
			return numIntersections;
		}
		public void setNumIntersections(int numIntersections) {
			this.numIntersections = numIntersections;
		}
		public ArrayList<SimpleIntersection> getSimpleIntersection() {
			return simpleIntersection;
		}
		public void setSimpleIntersection(ArrayList<SimpleIntersection> simpleIntersection) {
			this.simpleIntersection = simpleIntersection;   //simpleIntersection.addAll(simpleIntersection);
		}
	}

 class SimpleIntersection{
		private CoordXYOffset position;
		private int numLinks;
		private ExternalDirectedLinkReference externalLinkReference;
		private ArrayList<IntOrExtDirectedLinkReference> connectedLinks;//connectedLinks[numLinks]
        public SimpleIntersection() {}
		public CoordXYOffset getPosition() {
			return position;
		}
		public void setPosition(CoordXYOffset position) {
			this.position = position;
		}
		public int getNumLinks() {
			return numLinks;
		}
		public void setNumLinks(int numLinks) {
			this.numLinks = numLinks;
		}
		public ArrayList<IntOrExtDirectedLinkReference> getConnectedLinks() {
			return connectedLinks;
		}
		public void setConnectedLinks(ArrayList<IntOrExtDirectedLinkReference> connectedLinks) {
			this.connectedLinks = connectedLinks;    //connectedLinks.addAll(connectedLinks);
		}
		public ExternalDirectedLinkReference getExternalLinkReference() {
			return externalLinkReference;
		}
		public void setExternalLinkReference(
				ExternalDirectedLinkReference externalLinkReference) {
			this.externalLinkReference = externalLinkReference;
		}
	}	

 class CoordXYOffset{
			private int numBits;
			private int dx;
			private int dy;
			public CoordXYOffset() {}
			public int getNumBits() {
				return numBits;
			}
			public void setNumBits(int numBits) {
				this.numBits = numBits;
			}
			public int getDx() {
				return dx;
			}
			public void setDx(int dx) {
				this.dx = dx;
			}
			public int getDy() {
				return dy;
			}
			public void setDy(int dy) {
				this.dy = dy;
			}
		}

 class IntOrExtDirectedLinkReference{
			private boolean isExternalLinkReference;
			private LinkReferenceChoice linkReferenceChoice;
	    public IntOrExtDirectedLinkReference() {}
		public boolean getIsExternalLinkReference() {
			return isExternalLinkReference;
		}
		public void setIsExternalLinkReference(boolean isExternalLinkReference) {
			this.isExternalLinkReference = isExternalLinkReference;
		}
		public LinkReferenceChoice getLinkReferenceChoice() {
			return linkReferenceChoice;
		}
		public void setLinkReferenceChoice(LinkReferenceChoice linkReferenceChoice) {
			this.linkReferenceChoice = linkReferenceChoice;
		}
		}

 class LinkReferenceChoice{
	    	private DirectedLinkReference internalLinkReference;
	    	private ExternalDirectedLinkReference externalLinkReference;
	    	public LinkReferenceChoice() {}
			public DirectedLinkReference getInternalLinkReference() {
				return internalLinkReference;
			}
			public void setInternalLinkReference(DirectedLinkReference internalLinkReference) {
				this.internalLinkReference = internalLinkReference;
			}
			public ExternalDirectedLinkReference getExternalLinkReference() {
				return externalLinkReference;
			}
			public void setExternalLinkReference(ExternalDirectedLinkReference externalLinkReference) {
				this.externalLinkReference = externalLinkReference;
			}
		}

class DirectedLinkReference{
	    		private boolean positiveLinkDirection;
	    		private int linkId;
	    		public DirectedLinkReference() {}
				public boolean getPositiveLinkDirection() {
					return positiveLinkDirection;
				}
				public void setPositiveLinkDirection(boolean positiveLinkDirection) {
					this.positiveLinkDirection = positiveLinkDirection;
				}
				public int getLinkId() {
					return linkId;
				}
				public void setLinkId(int linkId2) {
					this.linkId = linkId2;
				}
			}

class LinkId{
	    			private byte linkId;
					public LinkId() {}
					public byte getLinkId() {
		               return linkId;
					}
					public void setLinkId(byte linkId) {
						this.linkId = linkId;
					}
	    		}

class ExternalDirectedLinkReference{
	        	private int extTileIdx;
	        	private DirectedLinkReference tileExternalLinkReference;
	        	public ExternalDirectedLinkReference() {}
				public int getExtTileIdx() {
					return extTileIdx;
				}
				public void setExtTileIdx(int extTileIdx2) {
					this.extTileIdx = extTileIdx2;
				}
				public DirectedLinkReference getTileExternalLinkReference() {
					return tileExternalLinkReference;
				}
				public void setTileExternalLinkReference(DirectedLinkReference tileExternalLinkReference) {
					this.tileExternalLinkReference = tileExternalLinkReference;
				}
	        }		

class SizeOfExternalTileIdList{
	private int SizeOfExternalTileIdList;
	public SizeOfExternalTileIdList() {}
	public int getSizeOfExternalTileIdList() {
		return SizeOfExternalTileIdList;
	}
	public void setSizeOfExternalTileIdList(int SizeOfExternalTileIdList) {
		this.SizeOfExternalTileIdList = SizeOfExternalTileIdList;
	}
}

class LinkList{
	private int numnumLinks;                 //uint16  16位
	private ArrayList<Link> link1; //有问题      //集合
	public LinkList() {}
	public int getNumnumLinks() {
		return numnumLinks;
	}
	public void setNumnumLinks(int numnumLinks) {
		this.numnumLinks = numnumLinks;
	}
	public ArrayList<Link> getLink1() {
		return link1;
	}
	public void setLink1(ArrayList<Link> link1) {
		this.link1 = link1;
	}
}

class Link{
	private FeatureLength length;
	private AttributeSource attrSource;
	private RoutingAttributeInfo attrInfo;
	private AverageSpeed averageSpeed;
	private LinkSector startAngle;
	private LinkSector endAngle;
	public Link() {}
	public FeatureLength getLength() {
		return length;
	}
	public void setLength(FeatureLength length) {
		this.length = length;
	}
	public AttributeSource getAttrSource() {
		return attrSource;
	}
	public void setAttrSource(AttributeSource attrSource) {
		this.attrSource = attrSource;
	}
	public RoutingAttributeInfo getAttrInfo() {
		return attrInfo;
	}
	public void setAttrInfo(RoutingAttributeInfo attrInfo) {
		this.attrInfo = attrInfo;
	}
	public AverageSpeed getAverageSpeed() {
		return averageSpeed;
	}
	public void setAverageSpeed(AverageSpeed averageSpeed) {
		this.averageSpeed = averageSpeed;
	}
	public LinkSector getStartAngle() {
		return startAngle;
	}
	public void setStartAngle(LinkSector startAngle) {
		this.startAngle = startAngle;
	}
	public LinkSector getEndAngle() {
		return endAngle;
	}
	public void setEndAngle(LinkSector endAngle) {
		this.endAngle = endAngle;
	}
}
class FeatureLength{
	private long length;                      //varuint32   24位可变
	public FeatureLength() {}
	public long getLength1() {
		return length;
	}
	public void setLength1(long length) {
		this.length = length;
	}
}
class AttributeSource{
//	private int INDEXED;                   //1bit   INDEXED = 0
//	private int EXPLICIT;                  //1bit   EXPLICIT = 1
	private boolean attrsource;
	public AttributeSource() {}
	public boolean getAttrsource1() {
		return attrsource;
	}
	public void setAttrsource1(boolean attrsource) {
		this.attrsource = attrsource;
	}
	
//	public int getINDEXED() {
//		return INDEXED;
//	}
//	public void setINDEXED(int INDEXED) {
//		this.INDEXED = INDEXED;
//	}
//	public int getEXPLICIT() {
//		return EXPLICIT;
//	}
//	public void setEXPLICIT(int EXPLICIT) {
//		this.EXPLICIT = EXPLICIT;
//	}
}
class RoutingAttributeInfo{
	private FixedRoadAttributeSetListIndex fixedRoadAttributeSetListIndex;
	private FixedRoadAttributeSet fixedAttributes;
	public RoutingAttributeInfo() {}
	public FixedRoadAttributeSetListIndex getFixedRoadAttributeSetListIndex() {
		return fixedRoadAttributeSetListIndex;
	}
	public void setFixedRoadAttributeSetListIndex(FixedRoadAttributeSetListIndex fixedRoadAttributeSetListIndex) {
		this.fixedRoadAttributeSetListIndex = fixedRoadAttributeSetListIndex;
	}
	public FixedRoadAttributeSet getFixedAttributes() {
		return fixedAttributes;
	}
	public void setFixedAttributes(FixedRoadAttributeSet fixedAttributes) {
		this.fixedAttributes = fixedAttributes;
	}
}
class FixedRoadAttributeSetListIndex{          //1bit   INDEXED = 0时     
	private int fixedRoadAttributeSetListIndex;    //varuint16    8位
	public FixedRoadAttributeSetListIndex() {}
	public int getFixedRoadAttributeSetListIndex() {
		return fixedRoadAttributeSetListIndex;
	}
	public void setFixedRoadAttributeSetListIndex(int fixedRoadAttributeSetListIndex) {
		this.fixedRoadAttributeSetListIndex = fixedRoadAttributeSetListIndex;
	}
}
class FixedRoadAttributeSet{      //1bit   EXPLICIT = 1时
	private SharedRoadAttributes sharedAttr;
	private RoutingRoadAttributes routingAttr;
	public FixedRoadAttributeSet() {}
	public SharedRoadAttributes getSharedAttr() {
		return sharedAttr;
	}
	public void setSharedAttr(SharedRoadAttributes sharedAttr) {
		this.sharedAttr = sharedAttr;
	}
	public RoutingRoadAttributes getRoutingAttr() {
		return routingAttr;
	}
	public void setRoutingAttr(RoutingRoadAttributes routingAttr) {
		this.routingAttr = routingAttr;
	}
}
class SharedRoadAttributes{
	private PriorityRoadClass priorityRoadClass;
	private LinkType linkType;
	private Direction travelDirection;
	private boolean ferry;    //所有布尔:1bit
	private boolean tunnel;
	private boolean bridge;
	private Direction toll;
	private boolean controlledAccess;
	private boolean serviceArea;
	public SharedRoadAttributes() {}
	public PriorityRoadClass getPriorityRoadClass() {
		return priorityRoadClass;
	}
	public void setPriorityRoadClass(PriorityRoadClass priorityRoadClass) {
		this.priorityRoadClass = priorityRoadClass;
	}
	public LinkType getLinkType() {
		return linkType;
	}
	public void setLinkType(LinkType linkType) {
		this.linkType = linkType;
	}
	public Direction getTravelDirection() {
		return travelDirection;
	}
	public void setTravelDirection(Direction travelDirection) {
		this.travelDirection = travelDirection;
	}
	public boolean getFerry() {
		return ferry;
	}
	public void setFerry(boolean ferry) {
		this.ferry = ferry;
	}
	public boolean getTunnel() {
		return tunnel;
	}
	public void setTunnel(boolean tunnel) {
		this.tunnel = tunnel;
	}
	public boolean getBridge() {
		return bridge;
	}
	public void setBridge(boolean bridge) {
		this.bridge = bridge;
	}
	public Direction getToll() {
		return toll;
	}
	public void setToll(Direction toll) {
		this.toll = toll;
	}
	public boolean getControlledAccess() {
		return controlledAccess;
	}
	public void setControlledAccess(boolean controlledAccess) {
		this.controlledAccess = controlledAccess;
	}
	public boolean getServiceArea() {
		return serviceArea;
	}
	public void setServiceArea(boolean serviceArea) {
		this.serviceArea = serviceArea;
	}
}
class PriorityRoadClass{
	private int priorityRoadClass;         //4bit
	public PriorityRoadClass() {}
	public int getPriorityRoadClass1() {
		return priorityRoadClass;
	}
	public void setPriorityRoadClass1(int priorityroadclass) {
		this.priorityRoadClass = priorityroadclass;
	}
}
class LinkType{
	private int linkType;       //特殊:14中情况,0~D       4bit
	public LinkType() {}
	public int getLinkType1() {
		return linkType;
	}
	public void setLinkType1(int linkType) {
		this.linkType = linkType;
	}
}
class Direction{                    //特殊:四种情况:0~3 ,下面的两个不是都顺序输出的,两个东西   
	private int travelDirection;   //2bit
	private int toll;              //2bit
	public Direction() {}
	public int getTravelDirection() {
		return travelDirection;
	}
	public void setTravelDirection(int travelDirection) {
		this.travelDirection = travelDirection;
	}
	public int getToll() {
		return toll;
	}
	public void setToll(int toll) {
		this.toll = toll;
	}
}
class RoutingRoadAttributes {
	private FunctionalRoadClass functionalRoadClass;
	private boolean urban;
	private boolean complexIntersection;
	private boolean pluralJunction;
	private boolean motorway;
	public RoutingRoadAttributes() {}
	public FunctionalRoadClass getFunctionalRoadClass() {
		return functionalRoadClass;
	}
	public void setFunctionalRoadClass(FunctionalRoadClass functionalRoadClass) {
		this.functionalRoadClass = functionalRoadClass;
	}
	public boolean getUrban() {
		return urban;
	}
	public void setUrban(boolean urban) {
		this.urban = urban;
	}
	public boolean getComplexIntersection() {
		return complexIntersection;
	}
	public void setComplexIntersection(boolean complexIntersection) {
		this.complexIntersection = complexIntersection;
	}
	public boolean getPluralJunction() {
		return pluralJunction;
	}
	public void setPluralJunction(boolean pluralJunction) {
		this.pluralJunction = pluralJunction;
	}
	public boolean getMotorway() {
		return motorway;
	}
	public void setMotorway(boolean motorway) {
		this.motorway = motorway;
	}
}
class FunctionalRoadClass {
	private int functionalRoadClass;          //3bit
	public FunctionalRoadClass() {}
	public int getFunctionalRoadClass() {
		return functionalRoadClass;
	}
	public void setFunctionalRoadClass(int functionalRoadClass) {
		this.functionalRoadClass = functionalRoadClass;
	}
}
class AverageSpeed{
	private int averageSpeed;      //uint8   8位
	public AverageSpeed() {}
	public int getAverageSpeed() {
		return averageSpeed;
	}
	public void setAverageSpeed(int averageSpeed) {
		this.averageSpeed = averageSpeed;
	}
}
class LinkSector{            //下面的两个不是都顺序输出的,两个东西  
	private int startAngle;            //6bit
	private int endAngle;              //6bit
	public LinkSector() {}
	public int getStartAngle() {
		return startAngle;
	}
	public void setStartAngle(int startAngle) {
		this.startAngle = startAngle;
	}
	public int getEndAngle() {
		return endAngle;
	}
	public void setEndAngle(int endAngle) {
		this.endAngle = endAngle;
	}
}


class RoutingIdRangeList{
	private NumRoutingListElements numFeatureRanges;
	private ArrayList<RouteNumberRange> featureRange;
	public RoutingIdRangeList() {}
	public NumRoutingListElements getNumFeatureRanges() {
		return numFeatureRanges;
	}
	public void setNumFeatureRanges(NumRoutingListElements numFeatureRanges) {
		this.numFeatureRanges = numFeatureRanges;
	}
	public ArrayList<RouteNumberRange> getFeatureRange() {
		return featureRange;
	}
	public void setFeatureRange(ArrayList<RouteNumberRange> featureRange) {
		this.featureRange = featureRange;
	}
}

class NumRoutingListElements{
	private int numFeatureRanges;
	private int startFeatureId;
	private int endFeatureId;
	public NumRoutingListElements() {}
	public int getNumFeatureRanges() {
		return numFeatureRanges;
	}
	public void setNumFeatureRanges(int numFeatureRanges) {
		this.numFeatureRanges = numFeatureRanges;
	}
	public int getStartFeatureId() {
		return startFeatureId;
	}
	public void setStartFeatureId(int startFeatureId) {
		this.startFeatureId = startFeatureId;
	}
	public int getEndFeatureId() {
		return endFeatureId;
	}
	public void setEndFeatureId(int endFeatureId) {
		this.endFeatureId = endFeatureId;
	}
}

class RouteNumberRange{
	private NumRoutingListElements startFeatureId;
	private NumRoutingListElements endFeatureId;
	public RouteNumberRange() {}
	public NumRoutingListElements getStartFeatureId1() {
		return startFeatureId;
	}
	public void setStartFeatureId1(NumRoutingListElements startFeatureId) {
		this.startFeatureId = startFeatureId;
	}
	public NumRoutingListElements getEndFeatureId1() {
		return endFeatureId;
	}
	public void setEndFeatureId1(NumRoutingListElements endFeatureId) {
		this.endFeatureId = endFeatureId;
	}
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值