scala.collection

trait Ranged

[source: scala/collection/Ranged.scala]

trait Ranged[K, +A]
extends Iterable[A]
Any collection (including maps) whose keys (or elements) are ordered.
Author
Sean McDirmid
Direct Known Subclasses:
Sorted, Ranged

Method Summary
abstract def compare (k0 : K, k1 : K) : Int
Comparison function that orders keys.
abstract def firstKey : K
Returns the first key of the collection.
def from (from : K) : Ranged[K, A]
Creates a ranged projection of this collection with no upper-bound.
abstract def lastKey : K
Returns the last key of the collection.
def range (from : K, until : K) : Ranged[K, A]
Creates a ranged projection of this collection with both a lower-bound and an upper-bound.
abstract def rangeImpl (from : Option[K], until : Option[K]) : Ranged[K, A]
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.
def until (until : K) : Ranged[K, A]
Creates a ranged projection of this collection with no lower-bound.
Methods inherited from Iterable
elements (abstract), concat, ++, map, flatMap, filter, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, mkString, mkString, addString, addString, copyToArray, isEmpty, projection, hasDefiniteSize
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
abstract def firstKey : K
Returns the first key of the collection.

abstract def lastKey : K
Returns the last key of the collection.

abstract def compare(k0 : K, k1 : K) : Int
Comparison function that orders keys.

abstract def rangeImpl(from : Option[K], until : Option[K]) : Ranged[K, A]
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.

def from(from : K) : Ranged[K, A]
Creates a ranged projection of this collection with no upper-bound.
Parameters
from - The lower-bound (inclusive) of the ranged projection.

def until(until : K) : Ranged[K, A]
Creates a ranged projection of this collection with no lower-bound.
Parameters
until - The upper-bound (exclusive) of the ranged projection.

def range(from : K, until : K) : Ranged[K, A]
Creates a ranged projection of this collection with both a lower-bound and an upper-bound.
Parameters
from - The upper-bound (exclusive) of the ranged projection.
until - ...
Returns
...