diff options
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/rootdoc.txt | 2 | ||||
-rw-r--r-- | src/library/scala/collection/immutable/Range.scala | 8 | ||||
-rw-r--r-- | src/library/scala/collection/mutable/PriorityQueue.scala | 5 | ||||
-rw-r--r-- | src/library/scala/util/Properties.scala | 6 |
4 files changed, 16 insertions, 5 deletions
diff --git a/src/library/rootdoc.txt b/src/library/rootdoc.txt index 4795a47efe..e84942b8c4 100644 --- a/src/library/rootdoc.txt +++ b/src/library/rootdoc.txt @@ -12,7 +12,7 @@ Notable packages include: - [[scala.collection.immutable `scala.collection.immutable`]] - Immutable, sequential data-structures such as [[scala.collection.immutable.Vector `Vector`]], [[scala.collection.immutable.List `List`]], [[scala.collection.immutable.Range `Range`]], [[scala.collection.immutable.HashMap `HashMap`]] or - [[scala.collection.immutable.HashSet `HasSet`]] + [[scala.collection.immutable.HashSet `HashSet`]] - [[scala.collection.mutable `scala.collection.mutable`]] - Mutable, sequential data-structures such as [[scala.collection.mutable.ArrayBuffer `ArrayBuffer`]], [[scala.collection.mutable.StringBuilder `StringBuilder`]], diff --git a/src/library/scala/collection/immutable/Range.scala b/src/library/scala/collection/immutable/Range.scala index 720dfeed59..3ae8a2c342 100644 --- a/src/library/scala/collection/immutable/Range.scala +++ b/src/library/scala/collection/immutable/Range.scala @@ -33,7 +33,13 @@ import scala.collection.parallel.immutable.ParRange * `init`) are also permitted on overfull ranges. * * @param start the start of this range. - * @param end the exclusive end of the range. + * @param end the end of the range. For exclusive ranges, e.g. + * `Range(0,3)` or `(0 until 3)`, this is one + * step past the last one in the range. For inclusive + * ranges, e.g. `Range.inclusive(0,3)` or `(0 to 3)`, + * it may be in the range if it is not skipped by the step size. + * To find the last element inside a non-empty range, + use `last` instead. * @param step the step for the range. * * @author Martin Odersky diff --git a/src/library/scala/collection/mutable/PriorityQueue.scala b/src/library/scala/collection/mutable/PriorityQueue.scala index b949bec48a..a6e538528a 100644 --- a/src/library/scala/collection/mutable/PriorityQueue.scala +++ b/src/library/scala/collection/mutable/PriorityQueue.scala @@ -16,6 +16,11 @@ import generic._ * To prioritize elements of type A there must be an implicit * Ordering[A] available at creation. * + * Only the `dequeue` and `dequeueAll` methods will return methods in priority + * order (while removing elements from the heap). Standard collection methods + * including `drop` and `iterator` will remove or traverse the heap in whichever + * order seems most convenient. + * * @tparam A type of the elements in this priority queue. * @param ord implicit ordering used to compare the elements of type `A`. * diff --git a/src/library/scala/util/Properties.scala b/src/library/scala/util/Properties.scala index 8835730d95..367488f116 100644 --- a/src/library/scala/util/Properties.scala +++ b/src/library/scala/util/Properties.scala @@ -62,10 +62,10 @@ private[scala] trait PropertiesTrait { def envOrSome(name: String, alt: Option[String]) = envOrNone(name) orElse alt - // for values based on propFilename - def scalaPropOrElse(name: String, alt: String): String = scalaProps.getProperty(name, alt) + // for values based on propFilename, falling back to System properties + def scalaPropOrElse(name: String, alt: String): String = scalaPropOrNone(name).getOrElse(alt) def scalaPropOrEmpty(name: String): String = scalaPropOrElse(name, "") - def scalaPropOrNone(name: String): Option[String] = Option(scalaProps.getProperty(name)) + def scalaPropOrNone(name: String): Option[String] = Option(scalaProps.getProperty(name)).orElse(propOrNone("scala." + name)) /** The numeric portion of the runtime Scala version, if this is a final * release. If for instance the versionString says "version 2.9.0.final", |