Lines Matching refs:element
116 @Override public int count(@Nullable Object element) { in count() argument
118 return unbox(countMap.get(element)); in count()
161 E element = entry.getElement(); in snapshot() local
163 list.add(element); in snapshot()
181 @Override public int add(E element, int occurrences) { in add() argument
183 return count(element); in add()
188 int current = count(element); in add()
190 if (countMap.putIfAbsent(element, occurrences) == null) { in add()
198 if (countMap.replace(element, current, next)) { in add()
216 @Override public int remove(@Nullable Object element, int occurrences) { in remove() argument
218 return count(element); in remove()
223 int current = count(element); in remove()
228 if (countMap.remove(element, current)) { in remove()
234 E casted = (E) element; in remove()
252 private int removeAllOccurrences(@Nullable Object element) { in removeAllOccurrences() argument
254 return unbox(countMap.remove(element)); in removeAllOccurrences()
274 public boolean removeExactly(@Nullable Object element, int occurrences) { in removeExactly() argument
281 int current = count(element); in removeExactly()
286 if (countMap.remove(element, occurrences)) { in removeExactly()
291 E casted = (E) element; in removeExactly()
307 @Override public int setCount(E element, int count) { in setCount() argument
310 ? removeAllOccurrences(element) in setCount()
311 : unbox(countMap.put(element, count)); in setCount()
327 @Override public boolean setCount(E element, int oldCount, int newCount) { in setCount() argument
333 return !countMap.containsKey(element); in setCount()
335 return countMap.remove(element, oldCount); in setCount()
339 return countMap.putIfAbsent(element, newCount) == null; in setCount()
341 return countMap.replace(element, oldCount, newCount); in setCount()
386 Object element = entry.getElement();
388 return entryCount > 0 && count(element) == entryCount;
441 Object element = entry.getElement();
443 return countMap.remove(element, entryCount);