MCPcopy Create free account
hub / github.com/diyhi/bbs / iterator

Method iterator

src/main/java/cms/utils/UniqueBlockingQueue.java:111–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

109 }
110
111 @Override
112 public Iterator<T> iterator() {
113 Iterator<T> iter = mBlockingQueue.iterator();
114 Iterator<T> it = new Iterator<T>() {
115 private T mLastElem = null;
116 @Override
117 public boolean hasNext() {
118 return iter.hasNext();
119 }
120
121 @Override
122 public T next() {
123 mLastElem = iter.next();
124 return mLastElem;
125 }
126
127 @Override
128 public void remove() {
129 iter.remove();
130 if (mLastElem != null) {
131 mElementSet.remove(mLastElem);
132 }
133 mLastElem = null;
134 }
135 };
136 return it;
137 }
138
139 @Override
140 public int size() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected