亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fingertable.java

?? Chord package into p2psim
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
			} else {

				this.logger.info("Added reference to finger table entries "
						+ lowestWrittenIndex + " to " + highestWrittenIndex);

			}
		}
	}

	/**
	 * Returns a copy of the finger table entries.
	 * 
	 * @return Copy of finger table entries.
	 */
	final Node[] getCopyOfReferences() {
		this.logger.debug("Returning copy of references.");

		Node[] copy = new Node[this.remoteNodes.length];
		System.arraycopy(this.remoteNodes, 0, copy, 0, this.remoteNodes.length);
		return copy;
	}

	/**
	 * Returns a formatted string representation of this finger table.
	 * 
	 * @return String representation containing one line per reference, together
	 *         with the annotation which table entries contain this reference.
	 */
	public final String toString() {

		StringBuilder result = new StringBuilder("Finger table:\n");

		int lastIndex = -1;
		ID lastNodeID = null;
		URL lastNodeURL = null;
		for (int i = 0; i < this.remoteNodes.length; i++) {
			Node next = this.remoteNodes[i];
			if (next == null) {
				// row ended or did not even start
				if ((lastIndex != -1) && (lastNodeID != null)) {
					// row ended
					result.append("  "
							+ lastNodeID
							+ ", "
							+ lastNodeURL
							+ " "
							+ ((i - 1 - lastIndex > 0) ? "(" + lastIndex + "-"
									+ (i - 1) + ")" : "(" + (i - 1) + ")")
							+ "\n");
					lastIndex = -1;
					lastNodeID = null;
					lastNodeURL = null;
				} else {
					// null at beginning
				}
			} else if (lastNodeID == null) {
				// found first reference in a row
				lastIndex = i;
				lastNodeID = next.getNodeID();
				lastNodeURL = next.getNodeURL();
			} else if (!lastNodeID.equals(next.getNodeID())) {
				// found different reference in finger table
				result.append("  "
						+ lastNodeID
						+ ", "
						+ lastNodeURL
						+ " "
						+ ((i - 1 - lastIndex > 0) ? "(" + lastIndex + "-"
								+ (i - 1) + ")" : "(" + (i - 1) + ")") + "\n");
				lastNodeID = next.getNodeID();
				lastNodeURL = next.getNodeURL();
				lastIndex = i;
			} else {
				// found next reference in a row
			}
		}

		// display last row
		if (lastNodeID != null && lastIndex != -1) {
			// row ended
			result.append("  "
					+ lastNodeID
					+ ", "
					+ lastNodeURL
					+ " "
					+ ((this.remoteNodes.length - 1 - lastIndex > 0) ? "("
							+ lastIndex + "-" + (this.remoteNodes.length - 1)
							+ ")" : "(" + (this.remoteNodes.length - 1) + ")")
					+ "\n");
			lastNodeID = null;
		}

		return result.toString();
	}

	/**
	 * Removes all occurences of the given node from finger table.
	 * 
	 * @param node1
	 *            Reference to be removed from the finger table.
	 * @throws NullPointerException
	 *             If given reference is <code>null</code>.
	 */
	final void removeReference(Node node1) {

		if (node1 == null) {
			NullPointerException e = new NullPointerException(
					"removeReference cannot be invoked with value null!");
			this.logger.error("Null pointer", e);
			throw e;
		}

		// for logging
		int lowestWrittenIndex = -1;
		int highestWrittenIndex = -1;

		// determine node reference with next larger ID than ID of node
		// reference to remove
		Node referenceForReplacement = null;
		for (int i = this.localID.getLength() - 1; i >= 0; i--) {
			Node n = this.getEntry(i);
			if (node1.equals(n)) {
				break;
			}
			if (n != null) {
				referenceForReplacement = n;
			}
		}

		// remove reference(s)
		for (int i = 0; i < this.remoteNodes.length; i++) {
			if (node1.equals(this.remoteNodes[i])) {

				// for logging
				if (lowestWrittenIndex == -1) {
					lowestWrittenIndex = i;
				}
				highestWrittenIndex = i;

				if (referenceForReplacement == null) {
					unsetEntry(i);
				} else {
					setEntry(i, referenceForReplacement);
				}
			}
		}

		// try to add references of successor list to fill 'holes' in finger
		// table
		List<Node> referencesOfSuccessorList = new ArrayList<Node>(
				this.references.getSuccessors());
		referencesOfSuccessorList.remove(node1);
		for (Node referenceToAdd : referencesOfSuccessorList) {
			this.addReference(referenceToAdd);
		}

		// logging
		if (this.logger.isEnabledFor(DEBUG)) {
			if (highestWrittenIndex == -1) {
				this.logger
						.debug("removeReference did not remove the given reference, "
								+ "because it did not exist in finger table "
								+ "anywhere!");
			} else if (highestWrittenIndex == lowestWrittenIndex) {
				this.logger.debug("Removed reference from finger table entry "
						+ highestWrittenIndex);
			} else {
				this.logger
						.debug("Removed reference from finger table entries "
								+ lowestWrittenIndex + " to "
								+ highestWrittenIndex);
			}
		}

	}

	/**
	 * Determines closest preceding node of given id.
	 * 
	 * @param key
	 *            ID of which the closest preceding node shall be determined.
	 * @throws NullPointerException
	 *             If given key is null.
	 * @return Reference to the node which most closely precedes the given ID.
	 *         <code>null</code> if no node has been found.
	 */
	final Node getClosestPrecedingNode(ID key) {
		if (key == null) {
			NullPointerException e = new NullPointerException(
					"ID to determine the closest preceding node may not be "
							+ "null!");
			this.logger.error("Null pointer", e);
			throw e;
		}
		boolean debug = this.logger.isEnabledFor(DEBUG);
		for (int i = this.remoteNodes.length - 1; i >= 0; i--) {
			if (this.remoteNodes[i] != null
					&& this.remoteNodes[i].getNodeID().isInInterval(
							this.localID, key)) {
				if (debug) {
					this.logger.debug("Closest preceding node for ID " + key
							+ " is " + this.remoteNodes[i].toString());
				}
				return this.remoteNodes[i];
			}
		}

		if (debug) {
			this.logger.debug("There is no closest preceding node for ID "
					+ key + " -- returning null!");
		}
		return null;
	}

	/**
	 * Determines if the given reference is stored somewhere in the finger
	 * table.
	 * 
	 * @param newReference
	 *            Reference of which existence shall be determined.
	 * @throws NullPointerException
	 *             If reference to look for is <code>null</code>.
	 * @return <code>true</code>, if the given reference exists in the finger
	 *         table, or <code>false</code>, else.
	 */
	final boolean containsReference(Node newReference) {
		if (newReference == null) {
			NullPointerException e = new NullPointerException(
					"Reference to check must not be null!");
			this.logger.error("Null pointer", e);
			throw e;
		}
		for (int i = 0; i < this.remoteNodes.length; i++) {
			if (newReference.equals(this.remoteNodes[i])) {
				return true;
			}
		}
		return false;
	}

	/**
	 * @param i
	 * @return The first (i+1) entries of finger table. If there are fewer then
	 *         i+1 entries only these are returned.
	 * 
	 * 
	 * 
	 */
	final List<Node> getFirstFingerTableEntries(int i) {
		Set<Node> result = new HashSet<Node>();
		for (int j = 0; j < this.remoteNodes.length; j++) {
			if (this.getEntry(j) != null) {
				result.add(this.getEntry(j));
			}
			if (result.size() >= i) {
				break;
			}
		}
		return new ArrayList<Node>(result);
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看国产一区二区| 99re热这里只有精品免费视频| 国产精品第五页| 亚洲精品在线网站| 欧美大肚乱孕交hd孕妇| 精品蜜桃在线看| 久久久精品tv| 国产精品美女一区二区在线观看| 久久精品欧美日韩| 日本一区二区三区视频视频| 久久久久国产成人精品亚洲午夜| 久久这里只精品最新地址| 欧美大片日本大片免费观看| 精品国产一区二区三区久久影院| 精品国产百合女同互慰| 国产日产欧美一区二区视频| 中文字幕一区日韩精品欧美| 亚洲黄色录像片| 五月婷婷综合在线| 狠狠色丁香九九婷婷综合五月| 国产成人综合自拍| 91在线精品一区二区| 欧美在线观看18| 欧美一区二区三区播放老司机| 日韩午夜av一区| 国产精品丝袜一区| 亚洲精品国产高清久久伦理二区| 午夜影视日本亚洲欧洲精品| 麻豆精品一区二区| 成人激情免费电影网址| 欧美综合一区二区| 精品美女一区二区| 亚洲视频一二区| 久久精品国产免费看久久精品| 成人短视频下载| 在线不卡免费欧美| 国产欧美日本一区视频| 亚洲小少妇裸体bbw| 国产成人日日夜夜| 欧美午夜理伦三级在线观看| 日韩精品一区二区三区视频播放| 亚洲日本在线a| 国产最新精品精品你懂的| 91小视频免费观看| 精品福利在线导航| 亚洲国产日产av| 国产传媒日韩欧美成人| 欧美酷刑日本凌虐凌虐| 欧美国产激情二区三区| 免费高清在线一区| 91麻豆文化传媒在线观看| 欧美成人乱码一区二区三区| 亚洲最大色网站| 成人性生交大片免费看中文网站| 欧美电影影音先锋| 亚洲天堂免费看| 国产成人a级片| 欧美大片日本大片免费观看| 婷婷亚洲久悠悠色悠在线播放| 成人av免费观看| 国产日韩高清在线| 韩国精品主播一区二区在线观看| 欧美日韩一区小说| 亚洲精品国产高清久久伦理二区| 成人av网站免费观看| 精品国产乱码久久久久久免费| 亚洲国产va精品久久久不卡综合| 成人激情开心网| 亚洲国产精品av| 粉嫩av一区二区三区| 久久亚洲捆绑美女| 捆绑紧缚一区二区三区视频| 欧美三级电影精品| 亚洲一区二区视频在线观看| 色88888久久久久久影院野外 | 亚洲另类在线视频| 国产成人午夜片在线观看高清观看| 日韩情涩欧美日韩视频| 亚洲成av人片在www色猫咪| 欧美视频一区二区在线观看| 手机精品视频在线观看| 欧美日韩免费观看一区二区三区| 亚洲国产一区二区在线播放| 欧美在线观看一区二区| 亚洲综合色丁香婷婷六月图片| 91久久人澡人人添人人爽欧美| 一二三四社区欧美黄| 欧美专区日韩专区| 日韩精品高清不卡| 久久中文字幕电影| 成人黄色片在线观看| 亚洲男女一区二区三区| 欧美日韩国产片| 九九热在线视频观看这里只有精品| 欧美电视剧在线观看完整版| 国产电影一区二区三区| 亚洲精品综合在线| 欧美乱妇一区二区三区不卡视频| 丝袜美腿亚洲一区二区图片| 欧美不卡123| 成人美女视频在线观看18| 夜夜夜精品看看| 欧美一级欧美三级在线观看| 国产成人av电影免费在线观看| 亚洲免费视频成人| 欧美tickling网站挠脚心| av在线不卡观看免费观看| 亚洲最大色网站| 久久久久久久综合日本| 色诱视频网站一区| 精品亚洲porn| 有坂深雪av一区二区精品| 在线综合视频播放| 丁香天五香天堂综合| 亚洲成人第一页| 国产拍欧美日韩视频二区| 欧美午夜精品理论片a级按摩| 韩日精品视频一区| 亚洲曰韩产成在线| 久久久久久久综合日本| 欧美日韩一区二区在线观看视频 | 成人亚洲一区二区一| 亚洲国产精品久久一线不卡| 久久精品亚洲麻豆av一区二区| 色菇凉天天综合网| 国产二区国产一区在线观看| 午夜精品一区在线观看| 中文字幕一区不卡| 日韩欧美中文字幕公布| 91在线视频官网| 国产剧情一区在线| 日韩一区精品视频| 亚洲九九爱视频| 中文字幕第一区综合| 欧美电影免费观看高清完整版在线 | 日本中文字幕一区| 亚洲视频一区二区在线| 久久久精品国产99久久精品芒果| 欧美日韩激情一区| 欧美视频精品在线| 91免费在线播放| 91在线免费看| a亚洲天堂av| 99久久综合99久久综合网站| 国产一区二区美女| 老色鬼精品视频在线观看播放| 亚洲高清免费视频| 亚洲精品国产a久久久久久| 中文在线免费一区三区高中清不卡| 日韩小视频在线观看专区| 欧美美女视频在线观看| 色噜噜狠狠成人中文综合| 99re亚洲国产精品| av电影天堂一区二区在线观看| 国产成人精品免费在线| 丁香啪啪综合成人亚洲小说| 国产精品亚洲成人| 成人一二三区视频| 91论坛在线播放| 欧美色国产精品| 欧美一区二区三区爱爱| 精品国产一区二区三区忘忧草| 精品国产乱子伦一区| 国产视频视频一区| 国产精品久久久久久亚洲毛片| 中文字幕一区二区三区精华液| 国产精品久久久久久福利一牛影视 | 欧美精品视频www在线观看| 欧洲一区在线观看| 欧美人xxxx| 91精品国产日韩91久久久久久| 欧美日韩免费电影| 日韩免费观看2025年上映的电影 | 亚洲人成精品久久久久久| 亚洲精品五月天| 日韩激情一二三区| 国产一区欧美一区| 91网址在线看| 91精品国产一区二区三区蜜臀| 精品国产免费人成在线观看| 国产欧美一区二区精品久导航 | 欧美在线视频全部完| 91超碰这里只有精品国产| 精品日本一线二线三线不卡| 日本一区免费视频| 亚洲一区二区影院| 国产麻豆9l精品三级站| 91免费观看国产| 欧美大度的电影原声| 亚洲女性喷水在线观看一区| 免费观看一级特黄欧美大片| 成人免费视频免费观看| 欧美日韩美女一区二区| 久久久久亚洲综合| 亚洲成精国产精品女| 国产激情91久久精品导航| 欧美日韩亚洲高清一区二区| 久久久精品免费免费| 亚洲va天堂va国产va久| 成人网在线播放|