]> source.dussan.org Git - poi.git/commitdiff
deprecate BytePropertyNode
authorSergey Vladimirov <sergey@apache.org>
Mon, 11 Jul 2011 18:33:32 +0000 (18:33 +0000)
committerSergey Vladimirov <sergey@apache.org>
Mon, 11 Jul 2011 18:33:32 +0000 (18:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1145274 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java

index e131e7d03948c31d146d285b5e5c45aa9b07e03f..1a322d2939478c6b73b420f24a10fd7c3caa6242 100644 (file)
@@ -33,6 +33,7 @@ public abstract class BytePropertyNode<T extends BytePropertyNode<T>> extends
        /**
         * @param fcStart The start of the text for this property, in _bytes_
         * @param fcEnd The end of the text for this property, in _bytes_
+        * @deprecated
         */
        public BytePropertyNode(int fcStart, int fcEnd, CharIndexTranslator translator, Object buf) {
                super(
@@ -49,6 +50,18 @@ public abstract class BytePropertyNode<T extends BytePropertyNode<T>> extends
                 this.endBytes = fcEnd;
        }
 
+    public BytePropertyNode( int charStart, int charEnd, Object buf )
+    {
+        super( charStart, charEnd, buf );
+
+        if ( charStart > charEnd )
+            throw new IllegalArgumentException( "charStart (" + charStart
+                    + ") > charEnd (" + charEnd + ")" );
+
+        this.startBytes = -1;
+        this.endBytes = -1;
+    }
+
     /**
      * @deprecated Though bytes are actually stored in file, it is advised to
      *             use char positions for all operations. Including save