FlowSegment newSegment = new FlowSegment(); newSegment.after = this.after; newSegment.visited.addAll(this.visited.subList(0, index));
FlowSegment b = new FlowSegment(); b.add(f); livePieces.add(b); branches.put(f, b); ((FlowSegment) myPiece).add(nextBlockStart); branches.put(nextBlockStart, myPiece); } else if (existingPiece == null && myPiece instanceof Fork) { // No merge, we had a fork. Start a segment preceding the fork FlowSegment newSegment = new FlowSegment(); newSegment.isLeaf = false; newSegment.add(nextBlockStart); newSegment.after = myPiece; pieceIterator.remove(); ((Fork) existingPiece).following.add(myPiece); } else { // Split a flow segment so it forks against this one Fork f = ((FlowSegment) existingPiece).split(branches, (BlockStartNode)nextBlockStart, myPiece);