@Test public void getInvariantSpansSmallWidthLeft() throws Exception { VariantStream<InvariantSpan> stream = new RopeVariantStream<>(documentHash, getA()); List<InvariantSpan> spans = stream.getStreamElements(new VariantSpan(1, 1)); assertEquals(new InvariantSpan(100, 1, documentHash), spans.get(0)); }
@Override public List<T> getStreamElements() throws MalformedSpanException { List<T> elements = new ArrayList<>(); Iterator<Node<T>> it = getAllLeafNodes(); while (it.hasNext()) { Node<T> node = it.next(); if (node.value != null) { elements.add(node.value); } } return elements; }
RopeVariantStream implements VariantStream<T> { @Override public List<T> getStreamElements() throws MalformedSpanException { List<T> elements = new ArrayList<>(); Iterator<Node<T>> it = getAllLeafNodes(); while (it.hasNext()) { Node<T> node = it.next(); if (node.value != null) { elements.add(node.value); } } return elements; } }
RopeVariantStream implements VariantStream<T> { @Override public List<T> getStreamElements() throws MalformedSpanException { List<T> elements = new ArrayList<>(); Iterator<Node<T>> it = getAllLeafNodes(); while (it.hasNext()) { Node<T> node = it.next(); if (node.value != null) { elements.add(node.value); } } return elements; } RopeVariantStream(String documentHash);  RopeVariantStream(String documentHash, Node<T> root); }
RopeVariantStream implements VariantStream<T> { @Override public List<T> getStreamElements() throws MalformedSpanException { List<T> elements = new ArrayList<>(); Iterator<Node<T>> it = getAllLeafNodes(); while (it.hasNext()) { Node<T> node = it.next(); if (node.value != null) { elements.add(node.value); } } return elements; } RopeVariantStream(String documentHash);  RopeVariantStream(String documentHash, Node<T> root); @Override void copy(long characterPosition, VariantSpan variantSpan); @Override void delete(VariantSpan variantSpan); @Override String getDocumentHash(); @Override List<T> getStreamElements(); @Override List<T> getStreamElements(VariantSpan variantSpan); @Override List<VariantSpan> getVariantSpans(InvariantSpan targetSpan); @Override T index(long characterPosition); @Override void move(long to, VariantSpan v1); @Override void put(long characterPosition, T val); @Override void rebalance(); void save(OutputStream os); @Override void swap(VariantSpan v1, VariantSpan v2); @Override void toggleOverlay(VariantSpan variantSpan, Overlay linkType); }
RopeVariantStream implements VariantStream<T> { @Override public List<T> getStreamElements() throws MalformedSpanException { List<T> elements = new ArrayList<>(); Iterator<Node<T>> it = getAllLeafNodes(); while (it.hasNext()) { Node<T> node = it.next(); if (node.value != null) { elements.add(node.value); } } return elements; } RopeVariantStream(String documentHash);  RopeVariantStream(String documentHash, Node<T> root); @Override void copy(long characterPosition, VariantSpan variantSpan); @Override void delete(VariantSpan variantSpan); @Override String getDocumentHash(); @Override List<T> getStreamElements(); @Override List<T> getStreamElements(VariantSpan variantSpan); @Override List<VariantSpan> getVariantSpans(InvariantSpan targetSpan); @Override T index(long characterPosition); @Override void move(long to, VariantSpan v1); @Override void put(long characterPosition, T val); @Override void rebalance(); void save(OutputStream os); @Override void swap(VariantSpan v1, VariantSpan v2); @Override void toggleOverlay(VariantSpan variantSpan, Overlay linkType);  }