Updated ICharSequence with the code comments and license from Apache Harmony.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/c93fa961
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/c93fa961
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/c93fa961

Branch: refs/heads/master
Commit: c93fa96136115acf72ca2ba87728baa8c27a56d2
Parents: c47970b
Author: Shad Storhaug <[email protected]>
Authored: Sat Apr 29 16:17:50 2017 +0700
Committer: Shad Storhaug <[email protected]>
Committed: Mon May 1 04:48:34 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net/Support/ICharSequence.cs | 87 ++++++++++++++++++++--------
 1 file changed, 63 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c93fa961/src/Lucene.Net/Support/ICharSequence.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Support/ICharSequence.cs 
b/src/Lucene.Net/Support/ICharSequence.cs
index 1193379..3978775 100644
--- a/src/Lucene.Net/Support/ICharSequence.cs
+++ b/src/Lucene.Net/Support/ICharSequence.cs
@@ -1,39 +1,78 @@
-/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
+// This interface was sourced from the Apache Harmony project
+// https://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/
 
 namespace Lucene.Net.Support
 {
+    /*
+     * 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.
+     */
+
+    /// <summary>
+    /// This interface represents an ordered set of characters and defines the
+    /// methods to probe them.
+    /// </summary>
     public interface ICharSequence
     {
+        /// <summary>
+        /// Returns the number of characters in this sequence.
+        /// </summary>
         int Length { get; }
 
         // LUCENENET specific - removed CharAt() and replaced with this[int] 
to .NETify
         //char CharAt(int index);
 
+        /// <summary>
+        /// Returns the character at the specified index, with the first 
character
+        /// having index zero.
+        /// </summary>
+        /// <param name="index">the index of the character to return.</param>
+        /// <returns>the requested character.</returns>
+        /// <exception cref="System.IndexOutOfRangeException">
+        /// if <c>index &lt; 0</c> or <c>index</c> is greater than the
+        /// length of this sequence.
+        /// </exception>
         char this[int index] { get; }
 
+        /// <summary>
+        /// Returns a <see cref="ICharSequence"/> from the <paramref 
name="start"/> index (inclusive)
+        /// to the <paramref name="end"/> index (exclusive) of this sequence.
+        /// </summary>
+        /// <param name="start">
+        /// the start offset of the sub-sequence. It is inclusive, that
+        /// is, the index of the first character that is included in the
+        /// sub-sequence.
+        /// </param>
+        /// <param name="end">
+        /// the end offset of the sub-sequence. It is exclusive, that is,
+        /// the index of the first character after those that are included
+        /// in the sub-sequence
+        /// </param>
+        /// <returns>the requested sub-sequence.</returns>
+        /// <exception cref="System.IndexOutOfRangeException">
+        /// if <c>start &lt; 0</c>, <c>end &lt; 0</c>, <c>start &gt; end</c>,
+        /// or if <paramref name="start"/> or <paramref name="end"/> are 
greater than the
+        /// length of this sequence.
+        /// </exception>
         ICharSequence SubSequence(int start, int end);
+
+        /// <summary>
+        /// Returns a string with the same characters in the same order as in 
this
+        /// sequence.
+        /// </summary>
+        /// <returns>a string based on this sequence.</returns>
+        string ToString();
     }
 }
\ No newline at end of file

Reply via email to