📄 treedetails.java
字号:
/* * @(#)$Id: TreeDetails.java,v 1.1 2005/07/21 20:36:04 huebsch Exp $ * * Copyright (c) 2001-2004 Regents of the University of California. * All rights reserved. * * This file is distributed under the terms in the attached BERKELEY-LICENSE * file. If you do not find these files, copies can be found by writing to: * Computer Science Division, Database Group, Universite of California, * 617 Soda Hall #1776, Berkeley, CA 94720-1776. Attention: Berkeley License * * Copyright (c) 2003-2004 Intel Corporation. All rights reserved. * * This file is distributed under the terms in the attached INTEL-LICENSE file. * If you do not find these files, copies can be found by writing to: * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, * Berkeley, CA, 94704. Attention: Intel License Inquiry. */package pier.helpers.trees;import services.network.Payload;import util.BitID;import util.network.serialization.GenericByteBuffer;import util.network.serialization.SerializationManager;/** * Class Expression */public class TreeDetails { public static long serialVersionUID = SerializationManager.getSerialUID("pier.helpers.trees.TreeDetails"); protected BitID rootID; protected int maxChildren; protected double advertiseChildrenFraction; protected long upstreamRenewPeriod; protected long upstreamLifetime; /** * Constructor TreeMessage * * @param inputBuffer */ public TreeDetails(GenericByteBuffer inputBuffer) { this.rootID = new BitID(inputBuffer); this.maxChildren = inputBuffer.getInt(); this.advertiseChildrenFraction = inputBuffer.getDouble(); this.upstreamRenewPeriod = inputBuffer.getLong(); this.upstreamLifetime = inputBuffer.getLong(); } /** * Method serialize * * @param outputBuffer * @return */ public long serialize(GenericByteBuffer outputBuffer) { rootID.serialize(outputBuffer); outputBuffer.putInt(maxChildren); outputBuffer.putDouble(advertiseChildrenFraction); outputBuffer.putLong(upstreamRenewPeriod); outputBuffer.putLong(upstreamLifetime); return serialVersionUID; } /** * Constructor TreeDetails * * @param rootID * @param maxChildren * @param advertiseChildrenFraction * @param upstreamRenewPeriod * @param upstreamLifetime */ public TreeDetails(BitID rootID, int maxChildren, double advertiseChildrenFraction, long upstreamRenewPeriod, long upstreamLifetime) { this.rootID = rootID; this.maxChildren = maxChildren; this.advertiseChildrenFraction = advertiseChildrenFraction; this.upstreamRenewPeriod = upstreamRenewPeriod; this.upstreamLifetime = upstreamLifetime; } /** * Method getRootID * @return */ public BitID getRootID() { return rootID; } /** * Method getMaxChildren * @return */ public int getMaxChildren() { return maxChildren; } /** * Method getAdvertiseChildrenFraction * @return */ public double getAdvertiseChildrenFraction() { return advertiseChildrenFraction; } /** * Method getUpstreamRenewPeriod * @return */ public long getUpstreamRenewPeriod() { return upstreamRenewPeriod; } /** * Method getUpstreamLifetime * @return */ public long getUpstreamLifetime() { return upstreamLifetime; } /** * Method getSize * @return */ public int getSize() { int size = Payload.INT_SIZE + Payload.DOUBLE_SIZE + Payload.LONG_SIZE + Payload.LONG_SIZE; if (rootID != null) { size += rootID.getSize(); } return size; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -