ArrayDeque class Methods in Java Part -I

java.util.ArrayDeque<E>

Resizable-array implementation of the Deque

interface. Array deques have no capacity restrictions; they grow as necessary to support usage. 

Some methods of ArrayDeque.


ArrayDeque.add(E)This method inserts the specified element at the end of this deque.


ArrayDeque.addAll(Collection)This method adds all of the elements in the specified collection at the end of this deque.


ArrayDeque.addFirst(E)This method inserts the specified element at the front of this deque.


ArrayDeque.addLast(E)This method inserts the specified element at the end of this deque.


ArrayDeque.clear()The deque will be empty after this call returns.


ArrayDeque.clone()This method returns a copy of this deque.


ArrayDeque.contains(Object)This method returns true if this deque contains the specified element.


AbstractCollection.containsAll(Collection)This method returns true if this collection contains all of the elements in the specified collection.


ArrayDeque.descendingIterator()This method returns an iterator over the elements in this deque in reverse sequential order.


ArrayDeque.element()This method retrieves but does not remove, the head of the queue represented by this deque.


Object.equals(Object)This method indicates whether some other object is "equal to" this one.


ArrayDeque.forEach(Consumer)This method performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.


ArrayDeque.getFirst()This method retrieves but does not remove, the first element of this deque.


ArrayDeque.getLast()This method retrieves but does not remove, the last element of this deque.


hashCode()This method returns a hash code value for the object (ArrayDeque).


ArrayDeque.isEmpty()This method returns true if this deque contains no elements.


ArrayDeque.offer(E)This method inserts the specified element at the end of this deque.


ArrayDeque.offerFirst(E)This method inserts the specified element at the front of this deque.


ArrayDeque.offerLast(E)This method inserts the specified element at the end of this deque.


parallelStream()This method returns a possibly parallel Stream with this collection as its source.


Some more Methods of ArrayDeque class


No comments:

Post a Comment