scala.collection.generic

trait Sorted

[source: scala/collection/generic/Sorted.scala]

trait Sorted[K, +This <: Sorted[K, This]]
extends AnyRef
Any collection (including maps) whose keys (or elements) are ordered.
Author
Sean McDirmid
Since
2.8
Direct Known Subclasses:
SortedMapLike, SortedSetLike

Method Summary
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) : This
Creates a ranged projection of this collection with no upper-bound.
protected def hasAll (j : Iterator[K]) : Boolean
abstract def keySet : SortedSet[K]
return as a projection the set of keys in this collection
abstract def lastKey : K
Returns the last key of the collection.
abstract def ordering : Ordering[K]
def range (from : K, until : K) : This
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]) : This
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.
protected abstract def repr : This
The current collection
def to (to : K) : This
Create a range projection of this collection with no lower-bound.
def until (until : K) : This
Creates a ranged projection of this collection with no lower-bound.
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 ordering : Ordering[K]

protected abstract def repr : This
The current collection

abstract def keySet : SortedSet[K]
return as a projection the set of keys in this collection

abstract def firstKey : K
Returns the first key of the collection.

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

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

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

def to(to : K) : This
Create a range projection of this collection with no lower-bound.
Parameters
to - The upper-bound (inclusive) of the ranged projection.

protected def hasAll(j : Iterator[K]) : Boolean