當前位置: 首頁>>代碼示例>>Java>>正文


Java AvailableLabels類代碼示例

本文整理匯總了Java中es.tid.ospf.ospfv2.lsa.tlv.subtlv.AvailableLabels的典型用法代碼示例。如果您正苦於以下問題:Java AvailableLabels類的具體用法?Java AvailableLabels怎麽用?Java AvailableLabels使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AvailableLabels類屬於es.tid.ospf.ospfv2.lsa.tlv.subtlv包,在下文中一共展示了AvailableLabels類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createBitmapLabelSet

import es.tid.ospf.ospfv2.lsa.tlv.subtlv.AvailableLabels; //導入依賴的package包/類
public static void createBitmapLabelSet(AvailableLabels availableLabels,int numLabels,int grid, int cs,int n){
	//FIXME: no hay problema de que se salga el ancho de banda
	BitmapLabelSet bitmapLabelSet = new BitmapLabelSet();
	DWDMWavelengthLabel dwdmWavelengthLabel = new DWDMWavelengthLabel();
	dwdmWavelengthLabel.setGrid(grid);
	dwdmWavelengthLabel.setChannelSpacing(cs);
	dwdmWavelengthLabel.setN(n);
	bitmapLabelSet.setDwdmWavelengthLabel(dwdmWavelengthLabel);

	int numberBytes = numLabels/8;
	if ((numberBytes*8)<numLabels){
		numberBytes++;
	}
	byte[] bytesBitMap =  new byte[numberBytes];
	for (int i=0;i<numberBytes;i++)
		bytesBitMap[i]=0x00;	

	bitmapLabelSet.setBytesBitmap(bytesBitMap);
	bitmapLabelSet.setNumLabels(numLabels);

	availableLabels.setLabelSet(bitmapLabelSet);

}
 
開發者ID:telefonicaid,項目名稱:netphony-topology,代碼行數:24,代碼來源:FileTEDBUpdater.java

示例2: duplicateTEDDB

import es.tid.ospf.ospfv2.lsa.tlv.subtlv.AvailableLabels; //導入依賴的package包/類
public static SimpleDirectedWeightedGraph<Object,IntraDomainEdge>  duplicateTEDDB(SimpleDirectedWeightedGraph<Object,IntraDomainEdge> networkGraph){
	SimpleDirectedWeightedGraph<Object,IntraDomainEdge> networkGraphDuplicated= new SimpleDirectedWeightedGraph<Object,IntraDomainEdge> (IntraDomainEdge.class);
	Set<Object> nodes= networkGraph.vertexSet();
	Iterator<Object> iter=nodes.iterator();
	Set<IntraDomainEdge> fiberEdges= networkGraph.edgeSet();
	DataPathID dpid = new DataPathID();
	Iterator<IntraDomainEdge> iterFiberLink;
	while (iter.hasNext()){
		networkGraphDuplicated.addVertex( iter.next());			
	}
	iterFiberLink=fiberEdges.iterator();
	while (iterFiberLink.hasNext()){
		IntraDomainEdge fiberEdge =iterFiberLink.next();
		IntraDomainEdge edge=new IntraDomainEdge();
		TE_Information informationTEDB=new TE_Information();
		edge.setTE_info(informationTEDB);
		informationTEDB.setAvailableLabels(new AvailableLabels());
		BitmapLabelSet newBitmapLabelSet = new BitmapLabelSet();
		int numLabels = fiberEdge.getTE_info().getAvailableLabels().getLabelSet().getNumLabels();
		newBitmapLabelSet.createBytesBitMap(((BitmapLabelSet)fiberEdge.getTE_info().getAvailableLabels().getLabelSet()).getBytesBitMap());
		
		int numberBytes = numLabels/8;
		if ((numberBytes*8)<numLabels){
			numberBytes++;
		}
		byte[] bytesBitMapReserved =  new byte[numberBytes];
		for (int i=0;i<numberBytes;i++)
			bytesBitMapReserved[i]=0x00;	
		newBitmapLabelSet.setBytesBitmapReserved(bytesBitMapReserved);
		newBitmapLabelSet.setNumLabels(numLabels);
		informationTEDB.getAvailableLabels().setLabelSet(newBitmapLabelSet);
		networkGraphDuplicated.addEdge(fiberEdge.getSource(),fiberEdge.getTarget(),edge);			
	}
	return networkGraphDuplicated;
}
 
開發者ID:telefonicaid,項目名稱:netphony-pce,代碼行數:36,代碼來源:PCEPUtils.java

示例3: fillBitmap

import es.tid.ospf.ospfv2.lsa.tlv.subtlv.AvailableLabels; //導入依賴的package包/類
public void fillBitmap(AvailableLabels availableLabels){
	
	int num_wavelength = 0;
		

	bitmapLabelSet = "";
	
	while(num_wavelength < availableLabels.getLabelSet().getNumLabels()){
		
		int num_byte=num_wavelength/8;
		boolean isFree = ((((BitmapLabelSet)availableLabels.getLabelSet()).getBytesBitMap()[num_byte]&(0x80>>>(num_wavelength%8)))==0);
		
		if(isFree){
			bitmapLabelSet = bitmapLabelSet + "0";				
		}else{
			bitmapLabelSet = bitmapLabelSet + "1";
		}
		
		num_wavelength++;
	}	
}
 
開發者ID:telefonicaid,項目名稱:netphony-topology,代碼行數:22,代碼來源:DatabaseControlSimplifiedLSA.java

示例4: getAvailableLabels

import es.tid.ospf.ospfv2.lsa.tlv.subtlv.AvailableLabels; //導入依賴的package包/類
public AvailableLabels getAvailableLabels() {
	return availableLabels;
}
 
開發者ID:telefonicaid,項目名稱:netphony-topology,代碼行數:4,代碼來源:TE_Information.java

示例5: setAvailableLabels

import es.tid.ospf.ospfv2.lsa.tlv.subtlv.AvailableLabels; //導入依賴的package包/類
public void setAvailableLabels(AvailableLabels availableLabels) {
	this.availableLabels = availableLabels;
}
 
開發者ID:telefonicaid,項目名稱:netphony-topology,代碼行數:4,代碼來源:TE_Information.java

示例6: createBitmapLabelSet

import es.tid.ospf.ospfv2.lsa.tlv.subtlv.AvailableLabels; //導入依賴的package包/類
public void createBitmapLabelSet(int numLabels,int grid, int cs,int n,int lambdaIni, int lambdaEnd){
		//FIXME: no hay problema de que se salga el ancho de banda
//log.info("Creamos bit map");
	BitmapLabelSet bitmapLabelSet = new BitmapLabelSet();
		DWDMWavelengthLabel dwdmWavelengthLabel = new DWDMWavelengthLabel();
		dwdmWavelengthLabel.setGrid(grid);
		dwdmWavelengthLabel.setChannelSpacing(cs);
		dwdmWavelengthLabel.setN(n);
		bitmapLabelSet.setDwdmWavelengthLabel(dwdmWavelengthLabel);
							
		int numberBytes = 	getNumberBytes(numLabels);
	
		byte[] bytesBitMap =  new byte[numberBytes];
		for (int i=0;i<numberBytes;i++)
				bytesBitMap[i]=0x00;	
		
		bitmapLabelSet.setBytesBitmap(bytesBitMap);
		byte[] bytesBitMapRes =  new byte[numberBytes];
		for (int i=0;i<numberBytes;i++)
			bytesBitMapRes[i]=0x00;	
		/*----Opcion: LAMBDA SUBSET----*/
		/*Ponemos a 1 los bytes del BitMap que no maneje el pce. Esto es como poner tiempo de reserva infinito*/
		/*Traducir lambdaIni a numero de bytes*/
		int numberBytesLambdaIni = getNumberBytes(lambdaIni);
		
		/*Traducir lambdaEnd a numero bytes*/
		int numberBytesLambdaEnd =getNumberBytes( lambdaEnd);
		
		for (int i=0;i<numberBytesLambdaIni;i++){
			bytesBitMapRes[i]= (byte) 0xff;
			bytesBitMap[i]= (byte) 0xff;
			
		}
		
		for (int i=numberBytesLambdaEnd;i<numberBytes;i++){
			bytesBitMapRes[i]= (byte) 0xff;	
			bytesBitMap[i]= (byte) 0xff;
			
		}
		System.out.println("Setting Bytes:\n\rBytes: "+numberBytes+"\n\rLambdaIni: "+numberBytesLambdaIni+"\n\rLambdaEnd: "+numberBytesLambdaEnd);
		//FuncionesUtiles.printByte(bytesBitMap, "bytesBitMap",log);
		bitmapLabelSet.setBytesBitmapReserved(bytesBitMapRes);
		bitmapLabelSet.setNumLabels(numLabels);
		availableLabels = new AvailableLabels();
		availableLabels.setLabelSet(bitmapLabelSet);
		
	
}
 
開發者ID:telefonicaid,項目名稱:netphony-topology,代碼行數:49,代碼來源:TE_Information.java

示例7: getCommonAvailableLabels

import es.tid.ospf.ospfv2.lsa.tlv.subtlv.AvailableLabels; //導入依賴的package包/類
public AvailableLabels getCommonAvailableLabels() {
	return commonAvailableLabels;
}
 
開發者ID:telefonicaid,項目名稱:netphony-topology,代碼行數:4,代碼來源:WSONInformation.java

示例8: setCommonAvailableLabels

import es.tid.ospf.ospfv2.lsa.tlv.subtlv.AvailableLabels; //導入依賴的package包/類
public void setCommonAvailableLabels(AvailableLabels commonAvailableLabels) {
	this.commonAvailableLabels = commonAvailableLabels;
}
 
開發者ID:telefonicaid,項目名稱:netphony-topology,代碼行數:4,代碼來源:WSONInformation.java


注:本文中的es.tid.ospf.ospfv2.lsa.tlv.subtlv.AvailableLabels類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。