|
Scala 2
v2.1.3 |
class
Stack
[ A ]
extends
java.lang.Object with
scala.Seq[A] with
scala.ScalaObjectStack
represent
empty stacks; they can be either created by calling the constructor
directly, or by applying the function Stack.Empty
.Constructor Summary | |
def
this
|
Class Summary | |
protected
|
class
Node
[ A <: B ]
|
Def Summary | |
def
+
[ A <: B ]
( elem : B )
: scala.collection.immutable.Stack[B]
Push an element on the stack. |
|
def
+
[ A <: B ]
( elems : scala.Iterable[B] )
: scala.collection.immutable.Stack[B]
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. |
|
def
apply
( n : scala.Int )
: A
Returns the n-th element of this stack. The top element has index 0, elements below are indexed with increasing numbers. |
|
def
elements
: scala.Iterator[A]
Returns an iterator over all elements on the stack. The iterator issues elements in the reversed order they were inserted into the stack (LIFO order). |
|
override
|
def
equals
( obj : scala.Any )
: scala.Boolean
Compares this stack with the given object. |
override
|
def
hashCode
: scala.Int
Returns the hash code for this stack. |
def
isEmpty
: scala.Boolean
Checks if this stack is empty. |
|
def
length
: scala.Int
Returns the size of this stack. |
|
def
pop
: scala.collection.immutable.Stack[A]
Removes the top element from the stack. |
|
def
push
[ A <: B ]
( elems : B* )
: scala.collection.immutable.Stack[B]
Push a sequence of elements onto the stack. The last element of the sequence will be on top of the new stack. |
|
override
|
def
stringPrefix
: java.lang.String
Redefines the prefix of the string representation. |
override
|
def
toList
: scala.List[A]
Creates a list of all stack elements in LIFO order. |
def
top
: A
Returns the top element of the stack. An error is signaled if there is no element on the stack. |
Constructor Detail |
def
this
Def Detail |
def
+
[ A <: B ]( elem : B ) : scala.collection.immutable.Stack[B]
def
+
[ A <: B ]( elems : scala.Iterable[B] ) : scala.collection.immutable.Stack[B]
def
apply
( n : scala.Int ) : A
def
elements
: scala.Iterator[A]
def
equals
( obj : scala.Any ) : scala.Boolean
def
hashCode
: scala.Int
def
isEmpty
: scala.Boolean
def
length
: scala.Int
def
pop
: scala.collection.immutable.Stack[A]
def
push
[ A <: B ]( elems : B* ) : scala.collection.immutable.Stack[B]
def
stringPrefix
: java.lang.String
def
toList
: scala.List[A]
def
top
: A