scala.collection.generic

# Sorted

#### trait Sorted[K, +This <: Sorted[K, This]] extends AnyRef

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

Since

  2.8

Linear Supertypes
AnyRef, Any
Known Subclasses
BitSet, BitSet, BitSet, BitSet1, BitSet2, BitSetLike, BitSetN, DefaultKeySortedSet, DefaultKeySortedSet, SortedMap, SortedMap, SortedMapLike, SortedSet, SortedSet, SortedSet, SortedSetLike, TreeMap, TreeSet, TreeSet, ValueSet
Type Hierarchy Learn more about scaladoc diagrams
Ordering

1. Alphabetic
2. By inheritance

Inherited

1. Sorted
2. AnyRef
3. Any

Implicitly

1. by any2stringadd
2. by StringFormat
3. by Ensuring
4. by ArrowAssoc

1. Hide All
2. Show all

Learn more about member selection
Visibility

1. Public
2. All

### Abstract Value Members

1. #### abstract def firstKey: K

   Returns the first key of the collection.

2. #### abstract def keySet: SortedSet[K]

   return as a projection the set of keys in this collection

3. #### abstract def keysIteratorFrom(start: K): Iterator[K]

   Creates an iterator over all the keys(or elements) contained in this collection greater than or equal to `start` according to the ordering of this collection.

   Creates an iterator over all the keys(or elements) contained in this collection greater than or equal to `start` according to the ordering of this collection. x.keysIteratorFrom(y) is equivalent to but often more efficient than x.from(y).keysIterator.

   start

     The lower bound (inclusive) on the keys to be returned

4. #### abstract def lastKey: K

   Returns the last key of the collection.

5. #### abstract def ordering: Ordering[K]

6. #### abstract def rangeImpl(from: Option[K], until: Option[K]): This

   Creates a ranged projection of this collection.

   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.

   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.

7. #### abstract def repr: This

   The current collection

   The current collection

   Attributes
     protected

### Concrete Value Members

1. #### final def !=(arg0: Any): Boolean

   Definition Classes
     AnyRef → Any

2. #### final def ##(): Int

   Definition Classes
     AnyRef → Any

3. #### def +(other: String): String

   Implicit information
     This member is added by an implicit conversion from Sorted[K, This] to any2stringadd[Sorted[K, This]] performed by method any2stringadd in scala.Predef.
   Definition Classes
     any2stringadd

4. #### def ->[B](y: B): (Sorted[K, This], B)

   Implicit information
     This member is added by an implicit conversion from Sorted[K, This] to ArrowAssoc[Sorted[K, This]] performed by method ArrowAssoc in scala.Predef.
   Definition Classes
     ArrowAssoc
   Annotations
     @inline()

5. #### final def ==(arg0: Any): Boolean

   Definition Classes
     AnyRef → Any

6. #### final def asInstanceOf[T0]: T0

   Definition Classes
     Any

7. #### def clone(): AnyRef

   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @throws( ... )

8. #### def compare(k0: K, k1: K): Int

   Comparison function that orders keys.

9. #### def ensuring(cond: (Sorted[K, This]) ⇒ Boolean, msg: ⇒ Any): Sorted[K, This]

   Implicit information
     This member is added by an implicit conversion from Sorted[K, This] to Ensuring[Sorted[K, This]] performed by method Ensuring in scala.Predef.
   Definition Classes
     Ensuring

10. #### def ensuring(cond: (Sorted[K, This]) ⇒ Boolean): Sorted[K, This]

    Implicit information
      This member is added by an implicit conversion from Sorted[K, This] to Ensuring[Sorted[K, This]] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring

11. #### def ensuring(cond: Boolean, msg: ⇒ Any): Sorted[K, This]

    Implicit information
      This member is added by an implicit conversion from Sorted[K, This] to Ensuring[Sorted[K, This]] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring

12. #### def ensuring(cond: Boolean): Sorted[K, This]

    Implicit information
      This member is added by an implicit conversion from Sorted[K, This] to Ensuring[Sorted[K, This]] performed by method Ensuring in scala.Predef.
    Definition Classes
      Ensuring

13. #### final def eq(arg0: AnyRef): Boolean

    Definition Classes
      AnyRef

14. #### def equals(arg0: Any): Boolean

    Definition Classes
      AnyRef → Any

15. #### def finalize(): Unit

    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )

16. #### def formatted(fmtstr: String): String

    Returns string formatted according to given `format` string.

    Returns string formatted according to given `format` string. Format strings are as for `String.format` (@see java.lang.String.format).

    Implicit information
      This member is added by an implicit conversion from Sorted[K, This] to StringFormat[Sorted[K, This]] performed by method StringFormat in scala.Predef.
    Definition Classes
      StringFormat
    Annotations
      @inline()

17. #### def from(from: K): This

    Creates a ranged projection of this collection with no upper-bound.

    Creates a ranged projection of this collection with no upper-bound.

    from

      The lower-bound (inclusive) of the ranged projection.

18. #### final def getClass(): Class[_]

    Definition Classes
      AnyRef → Any

19. #### def hasAll(j: Iterator[K]): Boolean

    Attributes
      protected

20. #### def hashCode(): Int

    Definition Classes
      AnyRef → Any

21. #### final def isInstanceOf[T0]: Boolean

    Definition Classes
      Any

22. #### final def ne(arg0: AnyRef): Boolean

    Definition Classes
      AnyRef

23. #### final def notify(): Unit

    Definition Classes
      AnyRef

24. #### final def notifyAll(): Unit

    Definition Classes
      AnyRef

25. #### def range(from: K, until: K): This

    Creates a ranged projection of this collection with both a lower-bound and an upper-bound.

    Creates a ranged projection of this collection with both a lower-bound and an upper-bound.

    from

      The lower-bound (inclusive) of the ranged projection.

    until

      The upper-bound (exclusive) of the ranged projection.

26. #### final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
      AnyRef

27. #### def to(to: K): This

    Create a range projection of this collection with no lower-bound.

    Create a range projection of this collection with no lower-bound.

    to

      The upper-bound (inclusive) of the ranged projection.

28. #### def toString(): String

    Definition Classes
      AnyRef → Any

29. #### def until(until: K): This

    Creates a ranged projection of this collection with no lower-bound.

    Creates a ranged projection of this collection with no lower-bound.

    until

      The upper-bound (exclusive) of the ranged projection.

30. #### final def wait(): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

31. #### final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

32. #### final def wait(arg0: Long): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

33. #### def →[B](y: B): (Sorted[K, This], B)

    Implicit information
      This member is added by an implicit conversion from Sorted[K, This] to ArrowAssoc[Sorted[K, This]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
      ArrowAssoc

### Inherited from AnyRef

### Inherited from Any

### Inherited by implicit conversion any2stringadd from Sorted[K, This] to any2stringadd[Sorted[K, This]]

### Inherited by implicit conversion StringFormat from Sorted[K, This] to StringFormat[Sorted[K, This]]

### Inherited by implicit conversion Ensuring from Sorted[K, This] to Ensuring[Sorted[K, This]]

### Inherited by implicit conversion ArrowAssoc from Sorted[K, This] to ArrowAssoc[Sorted[K, This]]

### Ungrouped