Some post-facto patch cleanups, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25311 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
extempore 2011-07-16 05:52:37 +00:00
parent aa3b646fc5
commit 0daba0538c
2 changed files with 15 additions and 24 deletions

View File

@ -10,7 +10,7 @@ package scala.math
/** A trait for data that have a single, natural ordering. See
* [[scala.math.Ordering]] before using this trait for
* more information about whether to use use [[scala.math.Ordering]] instead.
* more information about whether to use [[scala.math.Ordering]] instead.
*
* Classes that implement this trait can be sorted with
* [[scala.utils.Sorting]] and can be compared with standard comparison operators
@ -20,8 +20,9 @@ package scala.math
* integers) while Ordering allows for multiple ordering implementations.
* An Ordering instance will be implicitly created if necessary.
*
* [[scala.math.Ordering]] is an alternative to this trait that allows multiple orderings to be defined for the same type.
*
* [[scala.math.Ordering]] is an alternative to this trait that allows multiple orderings to be
* defined for the same type.
*
* [[scala.math.PartiallyOrdered]] is an alternative to this trait for partially ordered data.
*
* For example, to create a simple class that implements Ordered and then sort it with [[scala.utils.Sorting]]:
@ -34,23 +35,16 @@ package scala.math
* val result = scala.utils.Sorting.quickSort(x)
* }}}
*
* Some additional notes from the initial implementation:
*
* Note that since version 2006-07-24 this trait is no longer covariant in `A`.
* It is important that the `equals` method for an instance of `Ordered[A]` be consistent with the
* compare method. However, due to limitations inherent in the type erasure semantics, there is no
* reasonable way to provide a default implementation of equality for instances of `Ordered[A]`.
* Therefore, if you need to be able to use equality on an instance of `Ordered[A]` you must
* provide it yourself either when inheriting or instantiating.
*
* It is important that the `equals` method for an instance of `Ordered[A]`
* be consistent with the compare method. However, due to limitations
* inherent in the type erasure semantics, there is no reasonable way to
* provide a default implementation of equality for instances of `Ordered[A]`.
* Therefore, if you need to be able to use equality on an instance of
* `Ordered[A]` you must provide it yourself either when inheriting or
* instantiating.
*
* It is important that the `hashCode` method for an instance of `Ordered[A]`
* be consistent with the `compare` method. However, it is not possible to
* provide a sensible default implementation. Therefore, if you need to be
* able compute the hash of an instance of `Ordered[A]` you must provide it
* yourself either when inheriting or instantiating.
* It is important that the `hashCode` method for an instance of `Ordered[A]` be consistent with
* the `compare` method. However, it is not possible to provide a sensible default implementation.
* Therefore, if you need to be able compute the hash of an instance of `Ordered[A]` you must
* provide it yourself either when inheriting or instantiating.
*
* @see [[scala.math.Ordering]], [[scala.math.PartiallyOrdered]]
* @author Martin Odersky

View File

@ -413,11 +413,8 @@ object Regex {
def unapply(m: Match): Some[String] = Some(m.matched)
}
/** An extractor object that yields groups in the match. The main
* advantage of using this is extractor instead of using the original
* regex is that this avoids rematching the string.
*
* For example:
/** An extractor object that yields the groups in the match. Using an extractor
* rather than the original regex avoids recomputing the match.
*
* {{{
* import scala.util.matching.Regex.Groups