scala.collection.immutable.Stack

class Node

[source: scala/collection/immutable/Stack.scala]

@serializable

protected class Node[+B >: A](elem : B)
extends Stack[B]
Method Summary
override def apply (n : Int) : B
Returns the n-th element of this stack. The top element has index 0, elements below are indexed with increasing numbers.
override def hashCode : Int
Returns the hash code for this stack.
override def isEmpty : Boolean
Checks if this stack is empty.
override def length : Int
Returns the size of this stack.
override def pop : Stack[B]
Removes the top element from the stack.
override def top : B
Returns the top element of the stack. An error is signaled if there is no element on the stack.
Methods inherited from Stack
+, +, push, elements, equals, stringPrefix
Methods inherited from Seq
lengthCompare, size, concat, last, lastOption, first, firstOption, headOption, ++, isDefinedAt, lastIndexOf, map, flatMap, filter, take, drop, slice, slice, takeWhile, dropWhile, reverse, contains, subseq, toArray, toSeq, projection, equalsWith, startsWith, endsWith, indexOf, containsSlice
Methods inherited from Collection
toString
Methods inherited from Iterable
partition, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toStream, 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 isEmpty : Boolean
Checks if this stack is empty.
Returns
true, iff there is no element on the stack.
Overrides
Stack.isEmpty

override def length : Int
Returns the size of this stack.
Returns
the stack size.
Overrides
Stack.length

override def top : B
Returns the top element of the stack. An error is signaled if there is no element on the stack.
Returns
the top element.
Overrides
Stack.top

override def pop : Stack[B]
Removes the top element from the stack.
Returns
the new stack without the former top element.
Overrides
Stack.pop

override def apply(n : Int) : B
Returns the n-th element of this stack. The top element has index 0, elements below are indexed with increasing numbers.
Parameters
n - the index number.
Returns
the n-th element on the stack.
Overrides
Stack.apply

override def hashCode : Int
Returns the hash code for this stack.
Returns
the hash code of the stack.
Overrides
Stack.hashCode