/* * Copyright (C) 2011 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * 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. */ package com.google.common.collect; import com.google.common.annotations.Beta; import com.google.common.annotations.GwtCompatible; import java.util.Collection; import java.util.Comparator; import java.util.Iterator; import java.util.SortedSet; /** * A {@link Multiset} which maintains the ordering of its elements, according to * either their natural order or an explicit {@link Comparator}. In all cases, * this implementation uses {@link Comparable#compareTo} or * {@link Comparator#compare} instead of {@link Object#equals} to determine * equivalence of instances. * *
Warning: The comparison must be consistent with equals as * explained by the {@link Comparable} class specification. Otherwise, the * resulting multiset will violate the {@link Collection} contract, which it is * specified in terms of {@link Object#equals}. * *
See the Guava User Guide article on
* {@code Multiset}.
*
* @author Louis Wasserman
* @since 11.0
*/
@Beta
@GwtCompatible
public interface SortedMultiset The iterator returns the elements in ascending order according to this
* multiset's comparator.
*/
@Override Iterator The returned multiset will throw an {@link IllegalArgumentException} on
* attempts to add elements outside its range.
*/
SortedMultiset The returned multiset will throw an {@link IllegalArgumentException} on
* attempts to add elements outside its range.
*
* This method is equivalent to
* {@code tailMultiset(lowerBound, lowerBoundType).headMultiset(upperBound,
* upperBoundType)}.
*/
SortedMultiset The returned multiset will throw an {@link IllegalArgumentException} on
* attempts to add elements outside its range.
*/
SortedMultiset