本文整理匯總了Java中org.onosproject.pcepio.protocol.PcepInterLayerObject類的典型用法代碼示例。如果您正苦於以下問題:Java PcepInterLayerObject類的具體用法?Java PcepInterLayerObject怎麽用?Java PcepInterLayerObject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PcepInterLayerObject類屬於org.onosproject.pcepio.protocol包,在下文中一共展示了PcepInterLayerObject類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: read
import org.onosproject.pcepio.protocol.PcepInterLayerObject; //導入依賴的package包/類
/**
* Reads channel buffer and returns object of PcepInterLayerObject.
*
* @param cb of type channel buffer
* @return object of PcepInterLayerObject
* @throws PcepParseException when fails to read from channel buffer
*/
public static PcepInterLayerObject read(ChannelBuffer cb) throws PcepParseException {
PcepObjectHeader interLayerObjHeader;
boolean bNFlag;
boolean bIFlag;
interLayerObjHeader = PcepObjectHeader.read(cb);
//take only InterLayerObject buffer.
ChannelBuffer tempCb = cb.readBytes(interLayerObjHeader.getObjLen() - OBJECT_HEADER_LENGTH);
int iTemp = tempCb.readInt();
bIFlag = ((iTemp & (byte) IFLAG_SHIFT_VALUE) == IFLAG_SHIFT_VALUE);
bNFlag = ((iTemp & (byte) NFLAG_SHIFT_VALUE) == NFLAG_SHIFT_VALUE);
return new PcepInterLayerObjectVer1(interLayerObjHeader, bNFlag, bIFlag);
}
示例2: build
import org.onosproject.pcepio.protocol.PcepInterLayerObject; //導入依賴的package包/類
@Override
public PcepInterLayerObject build() {
PcepObjectHeader interLayerObjHeader = this.bIsHeaderSet ? this.interLayerObjHeader
: DEFAULT_INTER_LAYER_OBJECT_HEADER;
boolean bNFlag = this.bIsNFlagset ? this.bNFlag : DEFAULT_NFLAG;
boolean bIFlag = this.bIsIFlagset ? this.bIFlag : DEFAULT_IFLAG;
if (bIsPFlagSet) {
interLayerObjHeader.setPFlag(bPFalg);
}
if (bIsIFlagSet) {
interLayerObjHeader.setIFlag(iFlag);
}
return new PcepInterLayerObjectVer1(interLayerObjHeader, bNFlag, bIFlag);
}