scala
class ::

[source: `scala/::.scala`]

`case final` `class` ::[b](`val` hd : b, `val` tl : List[b])
  `extends` List[b]`with` Product

  A non empty list characterized by a head and a tail.

Author
  Martin Odersky
Version
  1.0, 15/07/2003

Method Summary
`override def` | equals (arg0 : Any) : Boolean
`override def` | hashCode : Int
`def` | head : b Returns this first element of the list.
`override def` | isEmpty : Boolean Returns true if the list does not contain any elements.
`override final def` | productArity : Int return k for a product `A(x_1,...,x_k))`
`override final def` | productElement (arg0 : Int) : Any for a case class `A(x_1,...,x_k))`, returns `x_(i+1)` for `0 <= i < k`
`override final def` | productPrefix : String By default the empty string. Implementations may override this method in order to prepend a string prefix to the result of the toString methods.
`def` | tail : List[b] Returns this list without its first element.

Methods inherited from Product
element, arity

Methods inherited from List
::, :::, reverse_:::, length, indices, elements, toList, init, last, take, drop, takeRight, dropRight, splitAt, takeWhile, dropWhile, span, break, apply, map, reverseMap, foreach, filter, remove, partition, sort, count, forall, exists, find, foldLeft, foldRight, reduceLeft, reduceRight, flatMap, reverse, zip, zipWithIndex, zipAll, union, diff, intersect, removeDuplicates, stringPrefix

Methods inherited from Seq
size, concat, ++, isDefinedAt, lastIndexOf, contains, slice, subseq, toArray

Methods inherited from Collection
toString

Methods inherited from Iterable
findIndexOf, indexOf, /:, :\, copyToBuffer, sameElements, mkString, mkString, addString, addString, copyToArray, projection, hasDefiniteSize

Methods inherited from PartialFunction
orElse, andThen

Methods inherited from Function1
compose

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

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

Method Details

`` `def` head : b

  Returns this first element of the list.

Returns
  the first element of this list.
Throws
  Predef.NoSuchElementException - if the list is empty.

Overrides
  List.head

`` `def` tail : List[b]

  Returns this list without its first element.

Returns
  this list without its first element.
Throws
  Predef.NoSuchElementException - if the list is empty.

Overrides
  List.tail

`override` `def` isEmpty : Boolean

  Returns true if the list does not contain any elements.

Returns
  `true`, iff the list is empty.

Overrides
  List.isEmpty

`override` `def` hashCode : Int

`override` `def` equals(arg0 : Any) : Boolean

`override final` `def` productPrefix : String

  By default the empty string. Implementations may override this method in order to prepend a string prefix to the result of the toString methods.

Overrides
  Product.productPrefix

`override final` `def` productArity : Int

  return k for a product `A(x_1,...,x_k))`

Overrides
  Product.productArity

`override final` `def` productElement(arg0 : Int) : Any

  for a case class `A(x_1,...,x_k))`, returns `x_(i+1)` for `0 <= i < k`

Parameters
  `n -` the position of the n-th element
Throws
  `IndexOutOfBoundsException -`
Returns
  ...

Overrides
  Product.productElement