![]() Some of these identifiers are type aliases provided as shortcuts to commonly used classes. Identifiers in the scala package and the scala.Predef object are always in scope by default. scala.swing - A convenient wrapper around Java's GUI framework called Swing (scala-swing.jar).- Parser combinators (scala-parser-combinators.jar).- Parallel collections (scala-parallel-collections.jar).scala.xml - XML parsing, manipulation, and serialization (scala-xml.jar).scala.reflect - Scala's reflection API (scala-reflect.jar).See the complete list on the right.Īdditional parts of the standard library are shipped as separate libraries. scala.sys - Interaction with other processes and the operating system.scala.math - Basic math functions and additional numeric types like.ncurrent - Primitives for concurrent programming such as.- Mutable, concurrent data-structures such as.- Mutable, sequential data-structures such as.- Immutable, sequential data-structures such as.llection and its sub-packages contain Scala's collections framework.Or Option which are accessible in all Scala compilation units without explicit qualification or The scala package contains core types like Int, Float, Array The return type of these methods is boolean, and they return true if the element exists in the Deque instance.This is the documentation for the Scala standard library. If the element does not exist then the Deque instance remains unchanged.Īnother similar method is removeLastOccurence this method removes the last occurrence of the specified element in the Deque instance. One of these is removeFirstOccurence, this method removes theįirst occurrence of the specified element if it exists in the Deque instance. In addition to these basic methods to insert,remove and examine a Deque instance, the Deque interface also has ![]() The 12 methods for insertion, removal and retrieval of Deque elements are summarized in the following table:įirst Element (Beginning of the Deque instance) The methods getFirst and getLast throw an exception if theĭeque instance is empty whereas the methods peekFirst and peekLast These methods dont remove the value from the Deque instance. The methods getFirst and peekFirst retrieve the first element of the Deque instance. RemoveFirst and removeLast throw an exception if the Deque instance is empty. The methods pollFirstĪnd pollLast return null if the Deque is empty whereas the methods ![]() The removeFirst and pollFirst methods remove elementsįrom the beginning of the Deque instance. When the capacity of the Deque instance is restricted, the preferred methods are offerFirst and offerLast because addFirst might fail to throw an exception if it is full. The methods addLast and offerLast insert elements at the end of the Deque instance. The addfirst and offerFirst methods insert elements at the beginning of the Deque instance. The methods given in the Deque interface are divided into three parts: Insert Note that the Deque interface can be used both as last-in-first-out stacks and first-in-first-out queues. LinkedList implement the Deque interface. Methods are provided to insert, remove,Īnd examine the elements. The Deque interface is a richer abstract data type than both Stack and Queue because it implements both stacks and queues at the same time.ĭeque interface, defines methods to access the elements at both ends of the Deque instance. Of elements that supports the insertion and removal of elements at both end points. ![]() A double-ended-queue is a linear collection Usually pronounced as deck, a deque is a double-ended-queue.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |