poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fannin...@apache.org
Subject svn commit: r1832354 - in /poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel: TextSegement.java TextSegment.java
Date Sun, 27 May 2018 20:59:52 GMT
Author: fanningpj
Date: Sun May 27 20:59:52 2018
New Revision: 1832354

URL: http://svn.apache.org/viewvc?rev=1832354&view=rev
Log:
[githib-110] rename text segment class. This closes #110

Added:
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextSegment.java   (with props)
Removed:
    poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextSegement.java

Added: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextSegment.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextSegment.java?rev=1832354&view=auto
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextSegment.java (added)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextSegment.java Sun May 27 20:59:52
2018
@@ -0,0 +1,99 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+package org.apache.poi.xwpf.usermodel;
+
+
+/**
+ * saves the begin and end position  of a text in a Paragraph
+ */
+public class TextSegment {
+    private PositionInParagraph beginPos;
+    private PositionInParagraph endPos;
+
+    public TextSegment() {
+        this.beginPos = new PositionInParagraph();
+        this.endPos = new PositionInParagraph();
+    }
+
+    public TextSegment(int beginRun, int endRun, int beginText, int endText, int beginChar,
int endChar) {
+        PositionInParagraph beginPos = new PositionInParagraph(beginRun, beginText, beginChar);
+        PositionInParagraph endPos = new PositionInParagraph(endRun, endText, endChar);
+        this.beginPos = beginPos;
+        this.endPos = endPos;
+    }
+
+    public TextSegment(PositionInParagraph beginPos, PositionInParagraph endPos) {
+        this.beginPos = beginPos;
+        this.endPos = endPos;
+    }
+
+    public PositionInParagraph getBeginPos() {
+        return beginPos;
+    }
+
+    public PositionInParagraph getEndPos() {
+        return endPos;
+    }
+
+    public int getBeginRun() {
+        return beginPos.getRun();
+    }
+
+    public void setBeginRun(int beginRun) {
+        beginPos.setRun(beginRun);
+    }
+
+    public int getBeginText() {
+        return beginPos.getText();
+    }
+
+    public void setBeginText(int beginText) {
+        beginPos.setText(beginText);
+    }
+
+    public int getBeginChar() {
+        return beginPos.getChar();
+    }
+
+    public void setBeginChar(int beginChar) {
+        beginPos.setChar(beginChar);
+    }
+
+    public int getEndRun() {
+        return endPos.getRun();
+    }
+
+    public void setEndRun(int endRun) {
+        endPos.setRun(endRun);
+    }
+
+    public int getEndText() {
+        return endPos.getText();
+    }
+
+    public void setEndText(int endText) {
+        endPos.setText(endText);
+    }
+
+    public int getEndChar() {
+        return endPos.getChar();
+    }
+
+    public void setEndChar(int endChar) {
+        endPos.setChar(endChar);
+    }
+}

Propchange: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/TextSegment.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message