summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2008-02-25 17:34:15 +0000
committermichelou <michelou@epfl.ch>2008-02-25 17:34:15 +0000
commit2d39db44e2f74571fa4dd407f5f56fb568b37360 (patch)
tree064526cd3e26f74d19cab924e8788bbdde751b4b /src/library
parentbefbc9d2c1ec99b07ea1aa4bc853440d4cb9a689 (diff)
downloadscala-2d39db44e2f74571fa4dd407f5f56fb568b37360.tar.gz
scala-2d39db44e2f74571fa4dd407f5f56fb568b37360.tar.bz2
scala-2d39db44e2f74571fa4dd407f5f56fb568b37360.zip
fixed scaladoc comments
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/StringBuilder.scala146
1 files changed, 133 insertions, 13 deletions
diff --git a/src/library/scala/StringBuilder.scala b/src/library/scala/StringBuilder.scala
index 116ec53490..8b657c3279 100644
--- a/src/library/scala/StringBuilder.scala
+++ b/src/library/scala/StringBuilder.scala
@@ -541,9 +541,35 @@ extends (Int => Char) with Proxy {
this
}
+ /** <p>
+ * Inserts the string representation of the <code>Boolean</code> argument
+ * into this sequence.
+ * </p>
+ * <p>
+ * The offset argument must be greater than or equal to 0, and less than
+ * or equal to the length of this sequence.
+ * </p>
+ *
+ * @param at the offset position.
+ * @param x a <code>Boolean</code> value.
+ * @return a reference to this object.
+ */
def insert(at: Int, x: Boolean): StringBuilder =
insert(at, String.valueOf(x))
+ /** <p>
+ * Inserts the string representation of the <code>Char</code> argument
+ * into this sequence.
+ * </p>
+ * <p>
+ * The offset argument must be greater than or equal to 0, and less than
+ * or equal to the length of this sequence.
+ * </p>
+ *
+ * @param at the offset position.
+ * @param x a <code>Char</code> value.
+ * @return a reference to this object.
+ */
def insert(at: Int, x: Char): StringBuilder = {
if (at < 0 || at > count)
throw new StringIndexOutOfBoundsException(at)
@@ -555,25 +581,81 @@ extends (Int => Char) with Proxy {
this
}
+ /** <p>
+ * Inserts the string representation of the <code>Int</code> argument
+ * into this sequence.
+ * </p>
+ * <p>
+ * The offset argument must be greater than or equal to 0, and less than
+ * or equal to the length of this sequence.
+ * </p>
+ *
+ * @param at the offset position.
+ * @param x a <code>Int</code> value.
+ * @return a reference to this object.
+ */
def insert(at: Int, x: Int): StringBuilder =
insert(at, String.valueOf(x))
+ /** <p>
+ * Inserts the string representation of the <code>Long</code> argument
+ * into this sequence.
+ * </p>
+ * <p>
+ * The offset argument must be greater than or equal to 0, and less than
+ * or equal to the length of this sequence.
+ * </p>
+ *
+ * @param at the offset position.
+ * @param x a <code>Long</code> value.
+ * @return a reference to this object.
+ */
def insert(at: Int, x: Long): StringBuilder =
insert(at, String.valueOf(x))
+ /** <p>
+ * Inserts the string representation of the <code>Float</code> argument
+ * into this sequence.
+ * </p>
+ * <p>
+ * The offset argument must be greater than or equal to 0, and less than
+ * or equal to the length of this sequence.
+ * </p>
+ *
+ * @param at the offset position.
+ * @param x a <code>Float</code> value.
+ * @return a reference to this object.
+ */
def insert(at: Int, x: Float): StringBuilder =
insert(at, String.valueOf(x))
+ /** <p>
+ * Inserts the string representation of the <code>Double</code> argument
+ * into this sequence.
+ * </p>
+ * <p>
+ * The offset argument must be greater than or equal to 0, and less than
+ * or equal to the length of this sequence.
+ * </p>
+ *
+ * @param at the offset position.
+ * @param x a <code>Double</code> value.
+ * @return a reference to this object.
+ */
def insert(at: Int, x: Double): StringBuilder =
insert(at, String.valueOf(x))
- /** Returns the index within this string of the first occurrence of the
- * specified substring. The integer returned is the smallest value
- * <i>k</i> such that:
+ /** <p>
+ * Returns the index within this string of the first occurrence of the
+ * specified substring. The integer returned is the smallest value
+ * <i>k</i> such that:
+ * </p>
* <blockquote><pre>
- * this.toString().startsWith(str, <i>k</i>)
- * </pre></blockquote>
- * is <code>true</code>.
+ * this.toString().startsWith(str, <i>k</i>)</pre>
+ * </blockquote>
+ * <p>
+ * is <code>true</code>.
+ * </p>
*
* @param str any string.
* @return if the string argument occurs as a substring within this
@@ -584,17 +666,38 @@ extends (Int => Char) with Proxy {
*/
def indexOf(str: String): Int = indexOf(str, 0)
+ /** <p>
+ * Returns the index within this string of the first occurrence of the
+ * specified substring, starting at the specified index. The integer
+ * returned is the smallest value <code>k</code> for which:
+ * </p><pre>
+ * k >= Math.min(fromIndex, str.length()) &&
+ * this.toString().startsWith(str, k)</pre>
+ * <p>
+ * If no such value of <code>k</code> exists, then <code>-1</code>
+ * is returned.
+ * </p>
+ *
+ * @param str the substring for which to search.
+ * @param fromIndex the index from which to start the search.
+ * @return the index within this string of the first occurrence
+ * of the specified substring, starting at the specified index.
+ */
def indexOf(str: String, fromIndex: Int): Int =
StringBuilder.indexOf(value, 0, count, str.toCharArray, 0, str.length(), fromIndex)
- /** Returns the index within this string of the rightmost occurrence
- * of the specified substring. The rightmost empty string "" is
- * considered to occur at the index value <code>this.length()</code>.
- * The returned index is the largest value <i>k</i> such that
+ /** <p>
+ * Returns the index within this string of the rightmost occurrence
+ * of the specified substring. The rightmost empty string "" is
+ * considered to occur at the index value <code>this.length()</code>.
+ * The returned index is the largest value <i>k</i> such that
+ * </p>
* <blockquote><pre>
- * this.toString().startsWith(str, k)
- * </pre></blockquote>
- * is true.
+ * this.toString().startsWith(str, k)</pre>
+ * </blockquote>
+ * <p>
+ * is true.
+ * </p>
*
* @param str the substring to search for.
* @return if the string argument occurs one or more times as a substring
@@ -605,6 +708,23 @@ extends (Int => Char) with Proxy {
*/
def lastIndexOf(str: String): Int = lastIndexOf(str, count)
+ /** <p>
+ * Returns the index within this string of the last occurrence of the
+ * specified substring. The integer returned is the largest value
+ * <code>k</code> such that:
+ * </p><pre>
+ * k <= Math.min(fromIndex, str.length()) &&
+ * this.toString().startsWith(str, k)</pre>
+ * <p>
+ * If no such value of <code>k</code> exists, then <code>-1</code>
+ * is returned.
+ * </p>
+ *
+ * @param str the substring to search for.
+ * @param fromIndex the index to start the search from.
+ * @return the index within this sequence of the last occurrence
+ * of the specified substring.
+ */
def lastIndexOf(str: String, fromIndex: Int): Int =
StringBuilder.lastIndexOf(value, 0, count, str.toCharArray, 0, str.length(), fromIndex)