aboutsummaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/editor/StringEditor.java
blob: 385826719598d4dde6d28409a1cea0d02c47ecb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

package com.yahoo.vespa.hosted.node.admin.task.util.editor;

/**
 * Edits multi-line text.
 *
 * @author hakon
 */
public class StringEditor {
    private final TextBuffer textBuffer;
    private final Cursor cursor;

    public StringEditor() {
        this("");
    }

    public StringEditor(String text) {
        textBuffer = new TextBufferImpl(text);
        cursor = new CursorImpl(textBuffer);
    }

    public Cursor cursor() {
        return cursor;
    }

    public Version bufferVersion() {
        return textBuffer.getVersion();
    }
}