MCPcopy Create free account
hub / github.com/ReadyTalk/avian / offerFirst

Method offerFirst

classpath/java/util/ArrayDeque.java:60–76  ·  view source on GitHub ↗
(T e)

Source from the content-addressed store, hash-verified

58 }
59
60 @Override
61 public boolean offerFirst(T e) {
62 ensureCapacity(size() + 1);
63 modCount++;
64
65 if (size > 0) {
66 // we don't need to move the head index for the first one
67 startIndex--;
68 if (startIndex < 0) { // wrapping to the end of the array
69 startIndex = dataArray.length - 1;
70 }
71 }
72 size++;
73 dataArray[startIndex] = e;
74
75 return true;
76 }
77
78 @Override
79 public boolean offerLast(T e) {

Callers

nothing calls this directly

Calls 2

ensureCapacityMethod · 0.95
sizeMethod · 0.95

Tested by

no test coverage detected