Code example for Deque

Methods: addFirst

0
	} 
 
 
	protected void insertEvent(Event event)
	{ 
		this.events.addFirst(event);
	} 
 
	public Event removeEvent() 
	{ 
		return this.events.removeLast();
	} 
 
	protected Event numberToEvent(int number)
	{ 
		switch (number)
		{ 
			case 0: 
				return InputSource.Event.UP_KEY;
			case 1: 
				return InputSource.Event.DOWN_KEY;