|
Scala
1.4.0.3 |
|||
Stack
represent
empty stacks; they can be either created by calling the constructor
directly, or by applying the function Stack.Empty
.
Method Summary | |
def +[B >: A](elem: B): Stack[B]
Push an element on the stack. |
|
def +[B >: A](elems: Iterable[B]): Stack[B]
Push all elements provided by the given iterable object onto the stack. |
|
def apply(n: Int): A
Returns the n-th element of this stack. |
|
def elements: Iterator[A]
Returns an iterator over all elements on the stack. |
|
override
|
def equals(obj: Any): Boolean
Compares this stack with the given object. |
override
|
def hashCode(): Int
Returns the hash code for this stack. |
def isEmpty: Boolean
Checks if this stack is empty. |
|
def length: Int
Returns the size of this stack. |
|
def pop: Stack[A]
Removes the top element from the stack. |
|
def push[B >: A](elems: B*): Stack[B]
Push a sequence of elements onto the stack. |
|
override
|
def stringPrefix: String
Redefines the prefix of the string representation. |
override
|
def toList: List[A]
Creates a list of all stack elements in LIFO order. |
def top: A
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 |
Class Summary | |
protected
|
class Node[+B >: A](elem: B)
|
Method Detail |
def isEmpty: Boolean
def length: Int
def +[B >: A](elem: B): Stack[B]
elem
-
the element to push on the stack.
def +[B >: A](elems: Iterable[B]): Stack[B]
elems
-
the iterable object.
def push[B >: A](elems: B*): Stack[B]
elems
-
the element sequence.
def top: A
def pop: Stack[A]
def apply(n: Int): A
n
-
the index number.
def elements: Iterator[A]
override def toList: List[A]
override def equals(obj: Any): Boolean
override def hashCode(): Int
override def stringPrefix: String
|
Scala
1.4.0.3 |
|||