* Copyright (C) 2007 The Guava Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
Multisetimplementation with predictable iteration order. Its iterator orders elements according to when the first occurrence of the element was added. When the multiset contains multiple instances of an element, those instances are consecutive in the iteration order. If all occurrences of an element are removed, after which that element is added to the multiset, the element will appear at the end of the iteration.
See the Guava User Guide article on.
LinkedHashMultisetwith the specified expected number of distinct elements.
distinctElementsthe expected number of distinct elements
LinkedHashMultisetcontaining the specified elements.
This implementation is highly efficient when
elements is itself
elementsthe elements that the multiset should contain
// Could use newLinkedHashMapWithExpectedSize() if it existed