getFront method

T getFront()

Returns the element at the front of the deque without removing it. Throws a StateError if the deque is empty.

Implementation

T getFront() {
  if (isEmpty) {
    throw StateError('Cannot get front element from an empty Deque');
  }
  return _queue.first;
}