summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2008-03-25 13:54:00 +0000
committermichelou <michelou@epfl.ch>2008-03-25 13:54:00 +0000
commit5d91c77938232b1985627870d68008c721e86dc0 (patch)
tree557580abe5c479b38cd24b0fd6856dc35377a4a6 /src/library
parent3a76532277fd1e70021ac3a3fd1ac9c5e551b98f (diff)
downloadscala-5d91c77938232b1985627870d68008c721e86dc0.tar.gz
scala-5d91c77938232b1985627870d68008c721e86dc0.tar.bz2
scala-5d91c77938232b1985627870d68008c721e86dc0.zip
added insert for Byte/Short, synchronized CLDC ...
added insert for Byte/Short, synchronized CLDC version
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/StringBuilder.scala44
1 files changed, 38 insertions, 6 deletions
diff --git a/src/library/scala/StringBuilder.scala b/src/library/scala/StringBuilder.scala
index 866b60b5ca..92ee3b9ac8 100644
--- a/src/library/scala/StringBuilder.scala
+++ b/src/library/scala/StringBuilder.scala
@@ -357,6 +357,9 @@ extends (Int => Char) with Proxy {
this
}
+ def append(x: Byte): StringBuilder =
+ append(String.valueOf(x))
+
def append(x: Char): StringBuilder = {
val newCount = count + 1
if (newCount > value.length) expandCapacity(newCount)
@@ -364,16 +367,13 @@ extends (Int => Char) with Proxy {
this
}
- def append(x: Int): StringBuilder =
- append(String.valueOf(x))
-
- def append(x: Long): StringBuilder =
+ def append(x: Short): StringBuilder =
append(String.valueOf(x))
- def append(x: Short): StringBuilder =
+ def append(x: Int): StringBuilder =
append(String.valueOf(x))
- def append(x: Byte): StringBuilder =
+ def append(x: Long): StringBuilder =
append(String.valueOf(x))
def append(x: Float): StringBuilder =
@@ -564,6 +564,22 @@ extends (Int => Char) with Proxy {
insert(at, String.valueOf(x))
/** <p>
+ * Inserts the string representation of the <code>Byte</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>Byte</code> value.
+ * @return a reference to this object.
+ */
+ def insert(at: Int, x: Byte): StringBuilder =
+ insert(at, String.valueOf(x))
+
+ /** <p>
* Inserts the string representation of the <code>Char</code> argument
* into this sequence.
* </p>
@@ -588,6 +604,22 @@ extends (Int => Char) with Proxy {
}
/** <p>
+ * Inserts the string representation of the <code>Short</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>Short</code> value.
+ * @return a reference to this object.
+ */
+ def insert(at: Int, x: Short): StringBuilder =
+ insert(at, String.valueOf(x))
+
+ /** <p>
* Inserts the string representation of the <code>Int</code> argument
* into this sequence.
* </p>