end = last.getEnd();
@Override public AbstractDataSegment split(final int position) { // Calculate positions and get anchor final int pos = position - getStart(); final Anchor splitAnchor = _underlying.getAnchor(_start.getPosition() + pos); // Create new segment final ObliqueSegment suffix = new ObliqueSegment(this, _next, splitAnchor, _end); // Change current segment _end = splitAnchor; // Insert new segment _next._prev = suffix; _next = suffix; return suffix; }
@Override public String toString() { return "[" + get() + "]"; } }
public AlignedString(final AlignedString underlying) { _underlying = underlying; _underlying.addChangeListener(this); _first._next = new ObliqueSegment(_first, _last, _underlying.getAnchor(0), _underlying.getAnchor(_underlying.length())); _last._prev = _first._next; }