diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/src/server/Element.java b/ws2012/P2P/uebungen/2/p2p_ex2/src/server/Element.java index ee80c0d4..347fef1c 100644 --- a/ws2012/P2P/uebungen/2/p2p_ex2/src/server/Element.java +++ b/ws2012/P2P/uebungen/2/p2p_ex2/src/server/Element.java @@ -10,12 +10,11 @@ public class Element { public Element(int size, int id) { chunks = new String[size]; this.id = id; - // System.out.println("Created new Element, size: " + size); } public boolean isComplete() { for (String s : chunks) { - if (s == null || s.isEmpty()) { + if (s == null) { return false; } } @@ -27,6 +26,17 @@ public class Element { for (String s : chunks) { result.append(s); } + + // int chunksFinished = 0; + // for (int i = 0; i < chunks.length; i++) { + // if (chunks[i] != null) { + // chunksFinished++; + // } + // } + // result.append("BufferedNetworkStack temporary Element: "); + // result.append(chunksFinished).append("/").append(chunks.length); + // result.append(" chunks finished"); + return result.toString(); } }