in scala/collection/immutable/Stack-class
class Node

protected class Node[+B >: A](elem: B)
extends Stack[B]
with ScalaObject

Method Summary
override def +[C >: B](elem: C): Stack[C]
     Push an element on the stack.
override def +[C >: B](elems: Iterable[C]): Stack[C]
     Push all elements provided by the given iterable object onto the stack.
override def apply(n: Int): B
     Returns the n-th element of this stack.
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 toList: List[B]
     Creates a list of all stack elements in LIFO order.
override def top: B
     Returns the top element of the stack.

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

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

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

Methods inherited from scala/ScalaObject-class
getScalaType

Methods inherited from scala/Seq-class
concat, copyToArray, drop, indexOf, isDefinedAt, lastIndexOf, subseq, take, toString

Methods inherited from scala/collection/immutable/Stack-class
Node, elements, equals, push, stringPrefix

Method Detail

isEmpty

  override def isEmpty: Boolean
Checks if this stack is empty.
Returns:
true, iff there is no element on the stack.

length

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

+

  override def +[C >: B](elem: C): Stack[C]
Push an element on the stack.
Parameters:
elem - the element to push on the stack.
Returns:
the stack with the new element on top.

+

  override def +[C >: B](elems: Iterable[C]): Stack[C]
Push all elements provided by the given iterable object onto the stack. The last element returned by the iterable object will be on top of the new stack.
Parameters:
elems - the iterable object.
Returns:
the stack with the new elements on top.

top

  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.

pop

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

apply

  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.

toList

  override def toList: List[B]
Creates a list of all stack elements in LIFO order.
Returns:
the created list.

hashCode

  override def hashCode(): Int
Returns the hash code for this stack.
Returns:
the hash code of the stack.