Best code examples for Java 8 Deque class (java.util.Deque)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Deque class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 Deque examples from Open Source projects
This code example shows how to use the following methods: getFirst, pop, push
39:	return states.getFirst(); 
-
171:	states.push(State.KEY_CHAR); 
-
174:	states.pop(); 
-
178:	states.pop(); 
-
183:	states.push(State.STRING); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isEmpty, pop, push
130:	if (nodes.isEmpty()) 
-
133:	ConfigVisitorNode current = nodes.pop(); 
-
141:	nodes.push(current); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: isEmpty, addFirst, peek, peekFirst, removeFirst
15:	iterators.addFirst(iterator); 
-
24:	if (nextBlank && !this.iterators.isEmpty()) { 
25:	if (!iterators.peek().hasNext()) { 
26:	iterators.removeFirst(); 
-
29:	final Object next = iterators.peekFirst().next(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: peek
51:	return st.peek(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addLast, removeFirst, size
59:	assert ringBuffer.size() <= maxSize; 
60:	if (ringBuffer.size() == maxSize) { 
-
62:	final T removed = ringBuffer.removeFirst(); 
-
73:	ringBuffer.addLast(item); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addFirst
97:	deque.addFirst(value); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addAll
48:	_stack.addAll(instructions);  /* adds to last */ 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addLast, removeFirst, size
83:	keyList.addLast(key); 
84:	if (keyList.size() > size) { 
85:	Object oldestKey = keyList.removeFirst(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: add
233:	Deque<Expression> children = new LinkedList<Expression>(); 
234:	children.add(second); 
235:	children.add(first); 
236:	and.addChildren(children); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isEmpty, add, removeLast
15:	Number y = stack.removeLast(); 
16:	Number x = stack.isEmpty() ? 0 : stack.removeLast(); 
-
29:	stack.add((Number) arg); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isEmpty, addFirst, removeLast
34:	if (list.isEmpty()) { 
-
37:	list.addFirst(list.removeLast()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: peek, peekFirst, peekLast, pollFirst, pollLast
41:	System.out.println("Peek first: "+nameDeque.peekFirst()); 
42:	System.out.println("Size: "+nameDeque.size()); 
-
45:	System.out.println("Peek last: "+nameDeque.peekLast()); 
46:	System.out.println("Size: "+nameDeque.size()); 
-
49:	System.out.println("Poll first: "+nameDeque.pollFirst()); 
50:	System.out.println("Size: "+nameDeque.size()); 
-
53:	System.out.println("Peek: "+nameDeque.peek()); 
54:	System.out.println("Size: "+nameDeque.size()); 
-
57:	System.out.println("Poll last: "+nameDeque.pollLast()); 
58:	System.out.println("Size: "+nameDeque.size()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addLast, getLast, removeLast
99:	Iterator<T> itr = stack.getLast(); // throws NSEE if empty 
-
102:	stack.removeLast(); 
-
106:	stack.addLast(childItr); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: size
26:	return _deque.size(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isEmpty, addFirst, contains, getFirst, remove
59:	if (!mostRecentlyUsedFrames.isEmpty() && f.equals(mostRecentlyUsedFrames.getFirst())) { 
-
62:	} else if (!mostRecentlyUsedFrames.isEmpty() && mostRecentlyUsedFrames.contains(f)) { 
63:	mostRecentlyUsedFrames.remove(f); 
-
65:	JInternalFrame previousTop = mostRecentlyUsedFrames.isEmpty() ? null : mostRecentlyUsedFrames.getFirst(); 
66:	mostRecentlyUsedFrames.addFirst(f); 
-
153:	if (mostRecentlyUsedFrames.isEmpty()) { 
-
156:	topFrame = mostRecentlyUsedFrames.getFirst(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: size
19:	assertNotNull(dq); 
20:	assertEquals(1, dq.size()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isEmpty, removeLast
66:	if (stack.isEmpty()) { 
-
70:	current = stack.removeLast(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: size
103:	return stack.size() < rootCount; 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isEmpty, add, peekLast, pollLast
42:	if (queue.isEmpty()) { 
-
45:	if (queue.peekLast().hasNext()) { 
46:	T next = queue.peekLast().next(); 
47:	queue.add(provider.listChildren(next)); 
-
50:	queue.pollLast(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isEmpty, pop
65:	if(!stack.isEmpty()) { 
66:	current = stack.pop(); 
-
75:	if(!stack.isEmpty()) { 
76:	current = stack.pop(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: peek, push
83:	bracketStack.push(Character.valueOf('}')); 
-
116:	return bracketStack.peek().charValue() == ']'; 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getLast, removeLast, size
152:	T node = stack.getLast(); 
153:	boolean expandedNode = hasExpanded.get(stack.size() - 1); 
-
155:	stack.removeLast(); 
156:	hasExpanded.clear(stack.size()); 
-
159:	hasExpanded.set(stack.size() - 1); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getLast
128:	scopes.getLast().putAll(m); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isEmpty, peekLast, removeLast
71:	checkArgument(!scopes.isEmpty() && scope == scopes.peekLast().getScope(), "Scope is not top of the stack"); 
-
73:	ScopeContext scopeContext = scopes.removeLast(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: addFirst
68:	Deque<T> stack = new ArrayDeque<T>(); 
-
70:	stack.addFirst(value); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: clear, isEmpty, addFirst
103:	if (reportLines.isEmpty()) { 
-
114:	reportLines.addFirst(header); 
-
116:	FileUtils.writeLines(reportFile, charset == null ? defaultCharset.name() : charset.name(), reportLines); 
-
118:	reportLines.clear(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: peek, pop, push
29:	Object currentlyMappedSink = mappedSinkStack.pop(); 
30:	Object previouslyMappedSink = mappedSinkStack.peek(); 
31:	mappedSinkStack.push( currentlyMappedSink ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isEmpty, getLast
60:	return stack.isEmpty() ? null : stack.getLast(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: peekFirst, peekLast
117:	HttpExchange firstExchange = exchanges.peekFirst(); 
118:	HttpExchange lastExchange = exchanges.peekLast(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: peek, pop, push
29:	Object currentlyMappedSink = mappedSinkStack.pop(); 
30:	Object previouslyMappedSink = mappedSinkStack.peek(); 
31:	mappedSinkStack.push( currentlyMappedSink ); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: push, size
62:	fs.push(new Node("A", new Object().getClass(), null, pc, "A", null)); 
63:	fs.push(new Node("B", new Object().getClass(), null, pc, "B", null)); 
64:	fs.push(new Node("C", new Object().getClass(), null, pc, "C", null)); 
65:	fs.push(new Node("D", new Object().getClass(), null, pc, "D", null)); 
-
67:	Assert.assertEquals(4, fs.size()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: peek, pop, push
29:	Object currentlyMappedSink = mappedSinkStack.pop(); 
30:	Object previouslyMappedSink = mappedSinkStack.peek(); 
31:	mappedSinkStack.push( currentlyMappedSink ); 
Full Snippet Info
6
CodeRank
See Code Examples for Java 8 Deque Methods: