scala.Seq

class singleton

[source: scala/Seq.scala]

case class singleton[A](val value : A)
extends RandomAccessSeq[A] with Product
Method Summary
override def apply (idx : Int) : A
override def equals (arg0 : Any) : Boolean
override def hashCode : Int
override def isDefinedAt (idx : Int) : Boolean
Is this partial function defined for the index x?
override def length : Int
Returns the length of the sequence.
override def productArity : Int
return k for a product A(x_1,...,x_k)
override def productElement (arg0 : Int) : Any
for a product A(x_1,...,x_k), returns x_(n+1) for 0 <= n < k
override def productPrefix : java.lang.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.
Methods inherited from RandomAccessSeq
projection, elements, drop, take, slice, reverse, patch, ++, toStream, safeIs
Methods inherited from Seq
lengthCompare, size, isEmpty, concat, last, lastOption, first, firstOption, headOption, lastIndexOf, map, flatMap, filter, slice, takeWhile, dropWhile, contains, subseq, toArray, toSeq, equalsWith, startsWith, endsWith, indexOf, containsSlice
Methods inherited from Collection
toString, stringPrefix
Methods inherited from Iterable
partition, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, mkString, mkString, mkString, addString, addString, copyToArray, 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
override def length : Int
Returns the length of the sequence.
Returns
the sequence length.

override def isDefinedAt(idx : Int) : Boolean
Is this partial function defined for the index x?
Parameters
x - ..
Returns
true, iff x is a legal sequence index.

override def apply(idx : Int) : A

override def hashCode : Int

override def equals(arg0 : Any) : Boolean

override def productPrefix : java.lang.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 def productArity : Int
return k for a product A(x_1,...,x_k)
Overrides
Product.productArity

override def productElement(arg0 : Int) : Any
for a product A(x_1,...,x_k), returns x_(n+1) for 0 <= n < k
Parameters
n - the index of the element to return
Throws
IndexOutOfBoundsException -
Returns
The element n elements after the first element
Overrides
Product.productElement