in scala
trait Seq

trait Seq[A]()
extends Object
with ScalaObject
with PartialFunction[Int,A]
with Iterable[A]
Implementing classes or objects:
trait List[a]()
trait Stream[a]()
class SeqProxy[A](x: Seq[A])
trait Buffer[A]() in scala/collection/mutable
class SingleLinkedList[A,This <: SingleLinkedList[A,This]]() in scala/collection/mutable
class MutableList[A]() in scala/collection/mutable
class Queue[A](elem: A*) in scala/collection/immutable
class Stack[A]() in scala/collection/immutable
class AttributeSeq() in scala/xml
class NodeSeq() in scala/xml

Class Seq[A] represents finite sequences of elements of type A.
Author:
Martin Odersky, Matthias Zenger
Version:
1.0, 16/07/2003

Method Summary
  def copyToArray[B >: A](xs: Array[B], start: Int): Array[B]
     Fills the given array xs with the elements of this sequence starting at position start.
  def drop(n: Int): Seq[A]
     Returns a new sub-sequence that drops the first n elements of this sequence.
  def indexOf[B >: A](elem: B): Int
     Returns the index of the first occurence of the specified object in this sequence.
  def isDefinedAt(x: Int): Boolean
     Is this partial function defined for the index x?
  def lastIndexOf[B >: A](elem: B): Int
     Returns the index of the last occurence of the specified element in this sequence, or -1 if the sequence does not contain this element.
abstract def length: Int
     Returns the length of the sequence.
protected def stringPrefix: String
     Defines the prefix of the string representation.
  def subseq(from: Int, len: Int): Seq[A]
     Returns a subsequence starting from index from consisting of len elements.
  def take(n: Int): Seq[A]
     Returns the sub-sequence starting from index n.
  def toList: List[A]
     Transform this sequence into a list of all elements.
override def toString(): String
     Customizes the toString method.

Methods inherited from java/lang/Object-class
clone, eq, equals, finalize, getClass, hashCode, notify, notifyAll, synchronized, wait, wait, wait

Methods inherited from scala/Any-class
!=, ==, asInstanceOf, isInstanceOf, match

Methods inherited from scala/Function1-class
apply

Methods inherited from scala/Iterable-class
/:, :\, elements, exists, find, foldLeft, foldRight, forall, foreach, sameElements

Method Detail

length

  abstract def length: Int
Returns the length of the sequence.
Returns:
the sequence length.

isDefinedAt

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

indexOf

  def indexOf[B >: A](elem: B): Int
Returns the index of the first occurence of the specified object in this sequence.
Parameters:
elem - element to search for.
Returns:
the index in this sequence of the first occurence of the specified element, or -1 if the sequence does not contain this element.

lastIndexOf

  def lastIndexOf[B >: A](elem: B): Int
Returns the index of the last occurence of the specified element in this sequence, or -1 if the sequence does not contain this element.
Parameters:
elem - element to search for.
Returns:
the index in this sequence of the last occurence of the specified element, or -1 if the sequence does not contain this element.

take

  def take(n: Int): Seq[A]
Returns the sub-sequence starting from index n.

drop

  def drop(n: Int): Seq[A]
Returns a new sub-sequence that drops the first n elements of this sequence.

subseq

  def subseq(from: Int, len: Int): Seq[A]
Returns a subsequence starting from index from consisting of len elements.

copyToArray

  def copyToArray[B >: A](xs: Array[B], start: Int): Array[B]
Fills the given array xs with the elements of this sequence starting at position start.
Parameters:
xs - the array to fill.
start - starting index.
Returns:
the given array xs filled with this list.

toList

  def toList: List[A]
Transform this sequence into a list of all elements.
Returns:
a list which enumerates all elements of this sequence.

toString

  override def toString(): String
Customizes the toString method.
Returns:
a string representation of this sequence.

stringPrefix

  protected def stringPrefix: String
Defines the prefix of the string representation.