Scala Library
|
|
class
SynchronizedStack[A]
extends
Stack[A]Stack[T]
class. It
implements a data structure which allows to store and retrieve
objects in a last-in-first-out (LIFO) fashion.Values and Variables inherited from Stack | |
elems |
Method Summary | |
override def
|
clear
: Unit
Removes all elements from the stack. After this operation completed,
the stack will be empty.
|
override def
|
isEmpty
: Boolean
Checks if the stack is empty.
|
override def
|
iterator
: Iterator[A]
Returns an iterator over all elements on the stack. This iterator
is stable with respect to state changes in the stack object; i.e.
such changes will not be reflected in the iterator. The iterator
issues elements in the order they were inserted into the stack
(FIFO order).
|
override def
|
pop
: A
Removes the top element from the stack.
|
override def
|
push
(elem : A) : SynchronizedStack[A]
Pushes a single element on top of the stack.
|
override def
|
push
(elem1 : A, elem2 : A, elems : A*) : SynchronizedStack[A]
Push two or more elements onto the stack. The last element
of the sequence will be on top of the new stack.
|
override def
|
pushAll
(elems : Iterator[A]) : SynchronizedStack[A]
Pushes all elements provided by an iterator
on top of the stack. The elements are pushed in the order they
are given out by the iterator.
|
override def
|
pushAll
(elems : Traversable[A]) : SynchronizedStack[A]
Pushes all elements provided by an
Traversable object
on top of the stack. The elements are pushed in the order they
are given out by the iterator. |
override def
|
toList
: List[A]
Creates a list of all stack elements in FIFO order.
|
override def
|
toString
: java.lang.String
Returns a textual representation of a stack as a string.
|
override def
|
top
: A
Returns the top element of the stack. This method will not remove
the element from the stack. An error is signaled if there is no
element on the stack.
|
Methods inherited from Stack | |
length, apply, ++=, ++=, clone |
Methods inherited from Sequence | |
companion |
Methods inherited from SequenceTemplate | |
lengthCompare, size, isDefinedAt, zip, zipAll, zipWithIndex, segmentLength, prefixLength, indexWhere, indexWhere, findIndexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexWhere, lastIndexWhere, reverse, reverseIterator, reversedElements, startsWith, startsWith, endsWith, indexOfSeq, indexOfSeq, lastIndexOfSeq, lastIndexOfSeq, contains, union, diff, intersect, removeDuplicates, patch, padTo, toSequence, indices, view, view, equals, sortWith, findLastIndexOf, slice, equalsWith, containsSlice, projection |
Methods inherited from IterableTemplate | |
elements, foreach, foldRight, reduceRight, toIterable, head, takeRight, dropRight, sameElements, toStream, first, firstOption, toSeq |
Methods inherited from TraversableClass | |
newBuilder, genericBuilder, unzip, flatten, transpose |
Methods inherited from TraversableTemplate | |
thisCollection, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterMap, filterNot, remove, partition, groupBy, forall, exists, count, find, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, headOption, tail, last, lastOption, init, take, drop, slice, takeWhile, dropWhile, span, splitAt, copyToBuffer, copyToArray, copyToArray, toArray, toSet, mkString, mkString, mkString, addString, addString, addString, stringPrefix |
Methods inherited from PartialFunction | |
orElse, andThen |
Methods inherited from Function1 | |
compose |
Methods inherited from AnyRef | |
getClass, hashCode, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
override
def
isEmpty : Boolean
override
def
push(elem : A) : SynchronizedStack[A]
elem -
the element to push onto the stackoverride
def
push(elem1 : A, elem2 : A, elems : A*) : SynchronizedStack[A]
elems -
the element sequence.override
def
pushAll(elems : Traversable[A]) : SynchronizedStack[A]
Traversable
object
on top of the stack. The elements are pushed in the order they
are given out by the iterator.iter -
an iterable objectoverride
def
pushAll(elems : Iterator[A]) : SynchronizedStack[A]
elems -
an iteratoroverride
def
top : A
override
def
pop : A
override
def
clear : Unit
override
def
toString : java.lang.String
Scala Library
|
|