scala.collection.jcl
trait Ranged

[source: `scala/collection/jcl/Ranged.scala`]

`` `trait` Ranged[K, A]
  `extends` Ranged[K, A]`with` MutableIterable[A]

  Any collection (including maps) whose keys (or elements) are ordered.

Author
  Sean McDirmid

Direct Known Subclasses:
  Buffer, Sorted

Type Summary
`protected abstract type` | SortedSelf <: Ranged[K, A]

Method Summary
`abstract def` | compare (k0 : K, k1 : K) : Int Comparison function that orders keys.
`override final def` | from (from : K) : SortedSelf Creates a ranged projection of this collection with no upper-bound. * @param from The lower-bound (inclusive) of the ranged projection.
`override final def` | range (from : K, until : K) : SortedSelf Creates a ranged projection of this collection with both a lower-bound and an upper-bound. * @param from The upper-bound (exclusive) of the ranged projection.
`abstract def` | rangeImpl (from : Option[K], until : Option[K]) : SortedSelf Creates a ranged projection of this collection. Any mutations in the ranged projection will update this collection and vice versa. Note: keys are not garuanteed to be consistent between this collection and the projection. This is the case for buffers where indexing is relative to the projection.
`override final def` | until (until : K) : SortedSelf Creates a ranged projection of this collection with no lower-bound. * @param until The upper-bound (exclusive) of the ranged projection.

Methods inherited from MutableIterable
elements (abstract), has, remove, removeAll, --, -, retain, retainAll, size0, clear, projection

Methods inherited from Collection
size (abstract), toArray, toString, stringPrefix

Methods inherited from Iterable
concat, ++, map, flatMap, filter, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toStream, mkString, mkString, mkString, addString, addString, copyToArray, isEmpty, hasDefiniteSize

Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized

Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf

Methods inherited from Ranged
firstKey (abstract), lastKey (abstract)

Class Summary
`protected class` | Comparator [K](`implicit` view$0 : (K) => Ordered[K])`extends` Comparator `with` AnyRef A wrapper around Java comparators.

Type Details

`protected abstract` `type` SortedSelf <: Ranged[K, A]

Method Details

`abstract` `def` compare(k0 : K, k1 : K) : Int

  Comparison function that orders keys.

Overrides
  Ranged.compare

`abstract` `def` rangeImpl(from : Option[K], until : Option[K]) : SortedSelf

  Creates a ranged projection of this collection. Any mutations in the ranged projection will update this collection and vice versa. Note: keys are not garuanteed to be consistent between this collection and the projection. This is the case for buffers where indexing is relative to the projection.

Parameters
  `from -` The lower-bound (inclusive) of the ranged projection. `None` if there is no lower bound.
  `until -` The upper-bound (exclusive) of the ranged projection. `None` if there is no upper bound.

Overrides
  Ranged.rangeImpl

`override final` `def` from(from : K) : SortedSelf

  Creates a ranged projection of this collection with no upper-bound. * @param from The lower-bound (inclusive) of the ranged projection.

Overrides
  Ranged.from

`override final` `def` until(until : K) : SortedSelf

  Creates a ranged projection of this collection with no lower-bound. * @param until The upper-bound (exclusive) of the ranged projection.

Overrides
  Ranged.until

`override final` `def` range(from : K, until : K) : SortedSelf

  Creates a ranged projection of this collection with both a lower-bound and an upper-bound. * @param from The upper-bound (exclusive) of the ranged projection.

Overrides
  Ranged.range