summaryrefslogtreecommitdiff
path: root/src/library/scala/collection
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-04-06 01:26:31 +0000
committerPaul Phillips <paulp@improving.org>2010-04-06 01:26:31 +0000
commitf578ff88d2514bf94c46cfb8c0e33236c2b2fcf1 (patch)
tree79de21d09f14420748c6426f50e7fc636ae7b33f /src/library/scala/collection
parent3b8ee6d4a95eb417b9e4eb944afb8d36bc913e18 (diff)
downloadscala-f578ff88d2514bf94c46cfb8c0e33236c2b2fcf1.tar.gz
scala-f578ff88d2514bf94c46cfb8c0e33236c2b2fcf1.tar.bz2
scala-f578ff88d2514bf94c46cfb8c0e33236c2b2fcf1.zip
As a brief diversion from real work, implemente...
As a brief diversion from real work, implemented Damerau–Levenshtein and ran it on trunk to elicit obvious misspellings. Unfortunately they're mostly in places like compiler comments which real people never see, but I fixed them anyway. All those English Lit majors who peruse our sources are sure to be pleased. No review.
Diffstat (limited to 'src/library/scala/collection')
-rw-r--r--src/library/scala/collection/Iterator.scala14
-rw-r--r--src/library/scala/collection/JavaConversions.scala2
-rwxr-xr-xsrc/library/scala/collection/LinearSeqOptimized.scala2
-rw-r--r--src/library/scala/collection/MapLike.scala4
-rw-r--r--src/library/scala/collection/SeqLike.scala12
-rw-r--r--src/library/scala/collection/SetLike.scala2
-rw-r--r--src/library/scala/collection/TraversableProxy.scala2
-rw-r--r--src/library/scala/collection/TraversableView.scala2
-rw-r--r--src/library/scala/collection/generic/IterableForwarder.scala2
-rw-r--r--src/library/scala/collection/immutable/IntMap.scala2
-rw-r--r--src/library/scala/collection/immutable/List.scala4
-rw-r--r--src/library/scala/collection/immutable/ListMap.scala2
-rw-r--r--src/library/scala/collection/immutable/LongMap.scala2
-rw-r--r--src/library/scala/collection/immutable/PagedSeq.scala6
-rw-r--r--src/library/scala/collection/mutable/ArrayBuffer.scala4
-rw-r--r--src/library/scala/collection/mutable/FlatHashTable.scala2
-rw-r--r--src/library/scala/collection/mutable/GrowingBuilder.scala2
-rw-r--r--src/library/scala/collection/mutable/HashTable.scala2
-rw-r--r--src/library/scala/collection/mutable/MapLike.scala8
-rw-r--r--src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala2
20 files changed, 39 insertions, 39 deletions
diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala
index a8e99836dc..701b24f300 100644
--- a/src/library/scala/collection/Iterator.scala
+++ b/src/library/scala/collection/Iterator.scala
@@ -135,7 +135,7 @@ object Iterator {
}
/** Creates an infinite-length iterator returning the results of evaluating
- * an expression. The epxression is recomputed for every element.
+ * an expression. The expression is recomputed for every element.
*
* @param elem the element computation.
* @return the iterator containing an infinite number of results of evaluating `elem`.
@@ -254,7 +254,7 @@ object Iterator {
def next(): Int = { val j = i; i = step(i); j }
}
- /** Create an iterator that is the concantenation of all iterators
+ /** Create an iterator that is the concatenation of all iterators
* returned by a given iterator of iterators.
* @param its The iterator which returns on each call to next
* a new iterator whose elements are to be concatenated to the result.
@@ -357,8 +357,8 @@ trait Iterator[+A] extends TraversableOnce[A] {
/** Creates a new iterator that maps all produced values of this iterator
* to new values using a transformation function.
* @param f the transformation function
- * @return a new iterator which transformes every value produced by this
- * iterator by applying the functon `f` to it.
+ * @return a new iterator which transforms every value produced by this
+ * iterator by applying the function `f` to it.
*/
def map[B](f: A => B): Iterator[B] = new Iterator[B] {
def hasNext = self.hasNext
@@ -709,12 +709,12 @@ trait Iterator[+A] extends TraversableOnce[A] {
if (found) i else -1
}
- /** Returns the index of the first occurence of the specified
+ /** Returns the index of the first occurrence of the specified
* object in this iterable object.
* $mayNotTerminateInf
*
* @param elem element to search for.
- * @return the index of the first occurence of `elem` in the values produced by this iterator,
+ * @return the index of the first occurrence of `elem` in the values produced by this iterator,
* or -1 if such an element does not exist until the end of the iterator is reached.
*/
def indexOf[B >: A](elem: B): Int = {
@@ -985,7 +985,7 @@ trait Iterator[+A] extends TraversableOnce[A] {
}
}
- /** Tests if another iterator produces the same valeus as this one.
+ /** Tests if another iterator produces the same values as this one.
* $willNotTerminateInf
* @param that the other iterator
* @return `true`, if both iterators produce the same elements in the same order, `false` otherwise.
diff --git a/src/library/scala/collection/JavaConversions.scala b/src/library/scala/collection/JavaConversions.scala
index 0059ab1fca..00f2d745af 100644
--- a/src/library/scala/collection/JavaConversions.scala
+++ b/src/library/scala/collection/JavaConversions.scala
@@ -40,7 +40,7 @@ package scala.collection
* <p>
* Note that no conversion is provided from <code>scala.collection.immutable.List</code>
* to <code>java.util.List</code>. Instead it is convertible to an immutable
- * <code>java.util.Collection</code> which provides size and interation
+ * <code>java.util.Collection</code> which provides size and interaction
* capabilities, but not access by index as would be provided by
* <code>java.util.List</code>.<br/>
* This is intentional: in combination the implementation of
diff --git a/src/library/scala/collection/LinearSeqOptimized.scala b/src/library/scala/collection/LinearSeqOptimized.scala
index dda74da394..7d3c58ad85 100755
--- a/src/library/scala/collection/LinearSeqOptimized.scala
+++ b/src/library/scala/collection/LinearSeqOptimized.scala
@@ -53,7 +53,7 @@ trait LinearSeqOptimized[+A, +Repr <: LinearSeqOptimized[A, Repr]] extends Linea
/** Selects an element by its index in the $coll.
* Note: the execution of `apply` may take time proportial to the index value.
- * @throws `IndexOutOfBoundsEsxception` if `idx` does not satisfy `0 <= idx < length`.
+ * @throws `IndexOutOfBoundsException` if `idx` does not satisfy `0 <= idx < length`.
*/
def apply(n: Int): A = {
val rest = drop(n)
diff --git a/src/library/scala/collection/MapLike.scala b/src/library/scala/collection/MapLike.scala
index f43f7a2ca5..5e1af7a2d7 100644
--- a/src/library/scala/collection/MapLike.scala
+++ b/src/library/scala/collection/MapLike.scala
@@ -110,7 +110,7 @@ self =>
* @param default a computation that yields a default value in case no binding for `key` is
* found in the map.
* @tparam B1 the result type of the default computation.
- * @return the value assocuated with `key` if it exists,
+ * @return the value associated with `key` if it exists,
* otherwise the result of the `default` computation.
* @usecase def getOrElse(key: A, default: => B): B
*/
@@ -322,7 +322,7 @@ self =>
/** Defines the prefix of this object's `toString` representation.
* @return a string representation which starts the result of `toString` applied to this $coll.
- * Unless overridden in subclasse, the string prefix of every map is `"Map"`.
+ * Unless overridden in subclasses, the string prefix of every map is `"Map"`.
*/
override def stringPrefix: String = "Map"
diff --git a/src/library/scala/collection/SeqLike.scala b/src/library/scala/collection/SeqLike.scala
index 9dc102fb11..0db64926a6 100644
--- a/src/library/scala/collection/SeqLike.scala
+++ b/src/library/scala/collection/SeqLike.scala
@@ -169,7 +169,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self =>
*
* @param idx The index to select.
* @return the element of this $coll at index `idx`, where `0` indicates the first element.
- * @throws `IndexOutOfBoundsEsxception` if `idx` does not satisfy `0 <= idx < length`.
+ * @throws `IndexOutOfBoundsException` if `idx` does not satisfy `0 <= idx < length`.
*/
def apply(idx: Int): A
@@ -212,7 +212,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self =>
*/
def isDefinedAt(idx: Int): Boolean = (idx >= 0) && (idx < length)
- /** Computes length of longest segment whose elements all satisfy some preficate.
+ /** Computes length of longest segment whose elements all satisfy some predicate.
*
* $mayNotTerminateInf
*
@@ -229,7 +229,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self =>
i
}
- /** Returns the length of the longest prefix whose elements all satisfy some preficate.
+ /** Returns the length of the longest prefix whose elements all satisfy some predicate.
*
* $mayNotTerminateInf
*
@@ -269,7 +269,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self =>
-1
}
- /** Returns index of the first element satisying a predicate, or `-1`.
+ /** Returns index of the first element satisfying a predicate, or `-1`.
*/
def findIndexOf(p: A => Boolean): Int = indexWhere(p)
@@ -494,7 +494,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self =>
/** Finds last index before or at a given end index where this $coll contains a given sequence as a slice.
* @param that the sequence to test
- * @param end the end idnex
+ * @param end the end index
* @return the last index `<= end` such that the elements of this $coll starting at this index
* match the elements of sequence `that`, or `-1` of no such subsequence exists.
*/
@@ -849,7 +849,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self =>
*/
override def toString = super[IterableLike].toString
- /** Returns index of the last element satisying a predicate, or -1.
+ /** Returns index of the last element satisfying a predicate, or -1.
*/
@deprecated("use `lastIndexWhere` instead")
def findLastIndexOf(p: A => Boolean): Int = lastIndexWhere(p)
diff --git a/src/library/scala/collection/SetLike.scala b/src/library/scala/collection/SetLike.scala
index 156d0d8b2b..48b5358afc 100644
--- a/src/library/scala/collection/SetLike.scala
+++ b/src/library/scala/collection/SetLike.scala
@@ -187,7 +187,7 @@ self =>
* @note This operation contains an unchecked cast: if `that`
* is a set, it will assume with an unchecked cast
* that it has the same element type as this set.
- * Any subsequuent ClassCastException is treated as a `false` result.
+ * Any subsequent ClassCastException is treated as a `false` result.
*/
override def equals(that: Any): Boolean = that match {
case that: Set[_] =>
diff --git a/src/library/scala/collection/TraversableProxy.scala b/src/library/scala/collection/TraversableProxy.scala
index 4a14937781..dd450dccac 100644
--- a/src/library/scala/collection/TraversableProxy.scala
+++ b/src/library/scala/collection/TraversableProxy.scala
@@ -11,7 +11,7 @@
package scala.collection
-// Methods could be printed by cat TraversibeLike.scala | egrep '^ (override )?def'
+// Methods could be printed by cat TraverableLike.scala | egrep '^ (override )?def'
/** This trait implements a proxy for traversable objects. It forwards
diff --git a/src/library/scala/collection/TraversableView.scala b/src/library/scala/collection/TraversableView.scala
index 8a67b8d10f..e9332097e7 100644
--- a/src/library/scala/collection/TraversableView.scala
+++ b/src/library/scala/collection/TraversableView.scala
@@ -18,7 +18,7 @@ import TraversableView.NoBuilder
/** <p>
* A base class for views of <a href="../Traversable.html"
* target="ContentFrame"><code>Traversable<code></a>.<br/>
- * Every subclass has to implenment the <code>foreach</code> method.
+ * Every subclass has to implement the <code>foreach</code> method.
* </p>
*
* @author Martin Odersky
diff --git a/src/library/scala/collection/generic/IterableForwarder.scala b/src/library/scala/collection/generic/IterableForwarder.scala
index 4debb19ad1..f4aef2fcbb 100644
--- a/src/library/scala/collection/generic/IterableForwarder.scala
+++ b/src/library/scala/collection/generic/IterableForwarder.scala
@@ -22,7 +22,7 @@ import collection.mutable.Buffer
* <li><code>toString</code>, <code>hashCode</code>, <code>equals</code>,
* <code>stringPrefix</code></li>
* <li><code>newBuilder</code>, <code>view</code></li>
- * <li>all calls creating a new iterable objetc of the same kind</li>
+ * <li>all calls creating a new iterable object of the same kind</li>
* </ul>
* <p>
* The above methods are forwarded by subclass <a href="../IterableProxy.html"
diff --git a/src/library/scala/collection/immutable/IntMap.scala b/src/library/scala/collection/immutable/IntMap.scala
index 6d72c0bb1a..62309a9f48 100644
--- a/src/library/scala/collection/immutable/IntMap.scala
+++ b/src/library/scala/collection/immutable/IntMap.scala
@@ -360,7 +360,7 @@ sealed abstract class IntMap[+T] extends Map[Int, T] with MapLike[Int, T, IntMap
}
/**
- * Forms the intersection of these two maps with a combinining function. The resulting map is
+ * Forms the intersection of these two maps with a combining function. The resulting map is
* a map that has only keys present in both maps and has values produced from the original mappings
* by combining them with f.
*
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala
index 7522cc370f..2b91ab8852 100644
--- a/src/library/scala/collection/immutable/List.scala
+++ b/src/library/scala/collection/immutable/List.scala
@@ -388,7 +388,7 @@ case object Nil extends List[Nothing] {
throw new NoSuchElementException("head of empty list")
override def tail: List[Nothing] =
throw new UnsupportedOperationException("tail of empty list")
- // Removal of equals method here might lead to an infinite recusion similar to IntMap.equals.
+ // Removal of equals method here might lead to an infinite recursion similar to IntMap.equals.
override def equals(that: Any) = that match {
case that1: Seq[_] => that1.isEmpty
case _ => false
@@ -595,7 +595,7 @@ object List extends SeqFactory[List] {
*
* @param arr the array to convert
* @param start the first index to consider
- * @param len the lenght of the range to convert
+ * @param len the length of the range to convert
* @return a list that contains the same elements than `arr`
* in the same order
*/
diff --git a/src/library/scala/collection/immutable/ListMap.scala b/src/library/scala/collection/immutable/ListMap.scala
index 0f66a1f452..d8e3e0856b 100644
--- a/src/library/scala/collection/immutable/ListMap.scala
+++ b/src/library/scala/collection/immutable/ListMap.scala
@@ -30,7 +30,7 @@ object ListMap extends ImmutableMapFactory[ListMap] {
* directly, or by applying the function <code>ListMap.empty</code>.
*
* @author Matthias Zenger
- * @author Martin Oderskty
+ * @author Martin Odersky
* @version 2.0, 01/01/2007
* @since 1
*/
diff --git a/src/library/scala/collection/immutable/LongMap.scala b/src/library/scala/collection/immutable/LongMap.scala
index 95ab40c5e2..0d74e41cec 100644
--- a/src/library/scala/collection/immutable/LongMap.scala
+++ b/src/library/scala/collection/immutable/LongMap.scala
@@ -346,7 +346,7 @@ sealed abstract class LongMap[+T] extends Map[Long, T] with MapLike[Long, T, Lon
}
/**
- * Forms the intersection of these two maps with a combinining function. The resulting map is
+ * Forms the intersection of these two maps with a combining function. The resulting map is
* a map that has only keys present in both maps and has values produced from the original mappings
* by combining them with f.
*
diff --git a/src/library/scala/collection/immutable/PagedSeq.scala b/src/library/scala/collection/immutable/PagedSeq.scala
index bde8d67ffe..bd12502520 100644
--- a/src/library/scala/collection/immutable/PagedSeq.scala
+++ b/src/library/scala/collection/immutable/PagedSeq.scala
@@ -202,7 +202,7 @@ private class Page[T: ClassManifest](val num: Int) {
/** The next page in the sequence */
var next : Page[T] = null
- /** A later page in the sequence, serves a cachae for pointing to last page */
+ /** A later page in the sequence, serves a cache for pointing to last page */
var later : Page[T] = this
/** The number of characters read into this page */
@@ -218,11 +218,11 @@ private class Page[T: ClassManifest](val num: Int) {
/** The index of the first character in this page relative to the whole sequence */
final def start = num * PageSize
- /** The index of the character following the last charcater in this page relative
+ /** The index of the character following the last character in this page relative
* to the whole sequence */
final def end = start + filled
- /** The currently last page in the sequence; might change as more charcaters are appended */
+ /** The currently last page in the sequence; might change as more characters are appended */
final def latest: Page[T] = {
if (later.next != null) later = later.next.latest
later
diff --git a/src/library/scala/collection/mutable/ArrayBuffer.scala b/src/library/scala/collection/mutable/ArrayBuffer.scala
index 85eb83ac1f..0c6aa9ce0c 100644
--- a/src/library/scala/collection/mutable/ArrayBuffer.scala
+++ b/src/library/scala/collection/mutable/ArrayBuffer.scala
@@ -65,7 +65,7 @@ class ArrayBuffer[A](override protected val initialSize: Int)
* via its <code>iterator</code> method. The identity of the
* buffer is returned.
*
- * @param iter the iterfable object.
+ * @param iter the iterable object.
* @return the updated buffer.
*/
override def ++=(xs: TraversableOnce[A]): this.type = xs match {
@@ -125,7 +125,7 @@ class ArrayBuffer[A](override protected val initialSize: Int)
* the buffer size.
*
* @param n the index which refers to the first element to delete.
- * @param count the number of elemenets to delete
+ * @param count the number of elements to delete
* @throws Predef.IndexOutOfBoundsException if <code>n</code> is out of bounds.
*/
override def remove(n: Int, count: Int) {
diff --git a/src/library/scala/collection/mutable/FlatHashTable.scala b/src/library/scala/collection/mutable/FlatHashTable.scala
index b5094bc098..ea4033d405 100644
--- a/src/library/scala/collection/mutable/FlatHashTable.scala
+++ b/src/library/scala/collection/mutable/FlatHashTable.scala
@@ -46,7 +46,7 @@ trait FlatHashTable[A] {
private def initialCapacity = capacity(initialSize)
/**
- * Initialises the collection from the input stream. `f` will be called for each element
+ * Initializes the collection from the input stream. `f` will be called for each element
* read from the input stream in the order determined by the stream. This is useful for
* structures where iteration order is important (e.g. LinkedHashSet).
*
diff --git a/src/library/scala/collection/mutable/GrowingBuilder.scala b/src/library/scala/collection/mutable/GrowingBuilder.scala
index 259df9a434..445e9d4f3e 100644
--- a/src/library/scala/collection/mutable/GrowingBuilder.scala
+++ b/src/library/scala/collection/mutable/GrowingBuilder.scala
@@ -16,7 +16,7 @@ import generic._
* almost identical to AddingBuilder, but necessitated by the existence of
* classes which are Growable but not Addable, which is a result of covariance
* interacting surprisingly with any2stringadd thus driving '+' out of the Seq
- * hierachy. The tendrils of original sin should never be underestimated.
+ * hierarchy. The tendrils of original sin should never be underestimated.
*
* @author Paul Phillips
* @version 2.8
diff --git a/src/library/scala/collection/mutable/HashTable.scala b/src/library/scala/collection/mutable/HashTable.scala
index aa7993ed14..14f1720a4c 100644
--- a/src/library/scala/collection/mutable/HashTable.scala
+++ b/src/library/scala/collection/mutable/HashTable.scala
@@ -65,7 +65,7 @@ trait HashTable[A] {
private def initialCapacity = capacity(initialSize)
/**
- * Initialises the collection from the input stream. `f` will be called for each key/value pair
+ * Initializes the collection from the input stream. `f` will be called for each key/value pair
* read from the input stream in the order determined by the stream. This is useful for
* structures where iteration order is important (e.g. LinkedHashMap).
*/
diff --git a/src/library/scala/collection/mutable/MapLike.scala b/src/library/scala/collection/mutable/MapLike.scala
index eca102e502..9c3c1c0e5f 100644
--- a/src/library/scala/collection/mutable/MapLike.scala
+++ b/src/library/scala/collection/mutable/MapLike.scala
@@ -42,7 +42,7 @@ import annotation.migration
* {{{
* def> empty: This
* }}}
- * If you wish to avoid the unncessary construction of an `Option`
+ * If you wish to avoid the unnecessary construction of an `Option`
* object, you could also override `apply`, `update`,
* and `delete`.
@@ -102,7 +102,7 @@ trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]]
def += (kv: (A, B)): this.type
/** Creates a new map consisting of all key/value pairs of the current map
- * plus a new pair of a guven key and value.
+ * plus a new pair of a given key and value.
*
* @param key The key to add
* @param value The new value
@@ -192,7 +192,7 @@ trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]]
* in map and returns that value.
* @param key the key to test
* @param op the computation yielding the value to associate with `key`, if
- * `key` is previosuly unbound.
+ * `key` is previously unbound.
* @return the value associated with key (either previously or as a result
* of executing the method).
*/
@@ -204,7 +204,7 @@ trait MapLike[A, B, +This <: MapLike[A, B, This] with Map[A, B]]
/** Applies a transformation function to all values contained in this map.
* The transformation function produces new values from existing keys
- * asssociated values.
+ * associated values.
*
* @param f the transformation to apply
* @return the map itself.
diff --git a/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala b/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala
index 61cb0a1331..9d18846252 100644
--- a/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala
+++ b/src/library/scala/collection/mutable/SynchronizedPriorityQueue.scala
@@ -75,7 +75,7 @@ class SynchronizedPriorityQueue[A](implicit ord: Ordering[A]) extends PriorityQu
*/
override def clear(): Unit = synchronized { super.clear }
- /** Returns an iterator which yiels all the elements of the priority
+ /** Returns an iterator which yield all the elements of the priority
* queue in descending priority order.
*
* @return an iterator over all elements sorted in descending order.