Code example for Position

Methods: getOffset

        this.end = end;
    public DocumentSpan(StyledDocument document, Position start, Position end) {
        Parameters.notNull("document", document);
        Parameters.notNull("start", start);
        Parameters.notNull("end", end);
        if (end.getOffset() < start.getOffset()) {
            throw new IllegalArgumentException("endOffset must be greater than or equal to startOffset.");
        this.document = document;
        this.start = new DocumentPoint(document, start);
        this.end = new DocumentPoint(document, end);
    public StyledDocument getDocument() {
        return document;
Experience pair programming with AI  Get Codota for Java