@Override public void forEach(BiConsumer<? super K, ? super V> action) { checkNotNull(action); ImmutableList<K> keyList = keySet.asList(); for (int i = 0; i < size(); i++) { action.accept(keyList.get(i), valueList.get(i)); } }
@Override public Spliterator<E> spliterator() { return asList().spliterator(); }
@Override public void forEachEntry(ObjIntConsumer<? super E> action) { checkNotNull(action); for (int i = 0; i < length; i++) { action.accept(elementSet.asList().get(i), getCount(i)); } }
@Override Entry<E> getEntry(int index) { return Multisets.immutableEntry(elementSet.asList().get(index), getCount(index)); }
@Override public void forEach(BiConsumer<? super K, ? super V> action) { checkNotNull(action); ImmutableList<K> keyList = keySet.asList(); for (int i = 0; i < size(); i++) { action.accept(keyList.get(i), valueList.get(i)); } }
@Override public Spliterator<E> spliterator() { return asList().spliterator(); }
@Override Entry<E> getEntry(int index) { return Multisets.immutableEntry(elementSet.asList().get(index), getCount(index)); }
@Override public void forEachEntry(ObjIntConsumer<? super E> action) { checkNotNull(action); for (int i = 0; i < length; i++) { action.accept(elementSet.asList().get(i), getCount(i)); } }
@Override Entry<E> getEntry(int index) { return Multisets.immutableEntry(elementSet.asList().get(index), getCount(index)); }
@GwtIncompatible // super.subListUnchecked does not exist; inherited subList is valid if slow /* * TODO(cpovirk): if we start to override indexOf/lastIndexOf under GWT, we'll want some way to * override subList to return an ImmutableSortedAsList for better performance. Right now, I'm not * sure there's any performance hit from our failure to override subListUnchecked under GWT */ @Override ImmutableList<E> subListUnchecked(int fromIndex, int toIndex) { ImmutableList<E> parentSubList = super.subListUnchecked(fromIndex, toIndex); return new RegularImmutableSortedSet<E>(parentSubList, comparator()).asList(); }
@GwtIncompatible // super.subListUnchecked does not exist; inherited subList is valid if slow /* * TODO(cpovirk): if we start to override indexOf/lastIndexOf under GWT, we'll want some way to * override subList to return an ImmutableSortedAsList for better performance. Right now, I'm not * sure there's any performance hit from our failure to override subListUnchecked under GWT */ @Override ImmutableList<E> subListUnchecked(int fromIndex, int toIndex) { ImmutableList<E> parentSubList = super.subListUnchecked(fromIndex, toIndex); return new RegularImmutableSortedSet<E>(parentSubList, comparator()).asList(); }
@GwtIncompatible // super.subListUnchecked does not exist; inherited subList is valid if slow /* * TODO(cpovirk): if we start to override indexOf/lastIndexOf under GWT, we'll want some way to * override subList to return an ImmutableSortedAsList for better performance. Right now, I'm not * sure there's any performance hit from our failure to override subListUnchecked under GWT */ @Override ImmutableList<E> subListUnchecked(int fromIndex, int toIndex) { ImmutableList<E> parentSubList = super.subListUnchecked(fromIndex, toIndex); return new RegularImmutableSortedSet<E>(parentSubList, comparator()).asList(); }
@Override Entry<E> getEntry(int index) { return Multisets.immutableEntry( elementSet.asList().get(index), counts[offset + index]); }
@Override Entry<E> getEntry(int index) { return Multisets.immutableEntry( elementSet.asList().get(index), counts[offset + index]); }
@Override public void forEach(BiConsumer<? super K, ? super V> action) { checkNotNull(action); ImmutableList<K> keyList = keySet.asList(); for (int i = 0; i < size(); i++) { action.accept(keyList.get(i), valueList.get(i)); } }
@Override public void forEachEntry(ObjIntConsumer<? super E> action) { checkNotNull(action); for (int i = 0; i < length; i++) { action.accept(elementSet.asList().get(i), getCount(i)); } }
@Override public ImmutableList<E> subList(int fromIndex, int toIndex) { Preconditions.checkPositionIndexes(fromIndex, toIndex, size()); return (fromIndex == toIndex) ? ImmutableList.<E>of() : new RegularImmutableSortedSet<E>( backingList.subList(fromIndex, toIndex), backingSet.comparator()) .asList(); }
@Override public ImmutableList<E> subList(int fromIndex, int toIndex) { Preconditions.checkPositionIndexes(fromIndex, toIndex, size()); return (fromIndex == toIndex) ? ImmutableList.<E>of() : new RegularImmutableSortedSet<E>( backingList.subList(fromIndex, toIndex), backingSet.comparator()) .asList(); }
@GwtIncompatible("super.subListUnchecked does not exist; inherited subList is valid if slow") /* * TODO(cpovirk): if we start to override indexOf/lastIndexOf under GWT, we'll want some way to * override subList to return an ImmutableSortedAsList for better performance. Right now, I'm not * sure there's any performance hit from our failure to override subListUnchecked under GWT */ @Override ImmutableList<E> subListUnchecked(int fromIndex, int toIndex) { ImmutableList<E> parentSubList = super.subListUnchecked(fromIndex, toIndex); return new RegularImmutableSortedSet<E>(parentSubList, comparator()).asList(); } }
@GwtIncompatible // super.subListUnchecked does not exist; inherited subList is valid if slow /* * TODO(cpovirk): if we start to override indexOf/lastIndexOf under GWT, we'll want some way to * override subList to return an ImmutableSortedAsList for better performance. Right now, I'm not * sure there's any performance hit from our failure to override subListUnchecked under GWT */ @Override ImmutableList<E> subListUnchecked(int fromIndex, int toIndex) { ImmutableList<E> parentSubList = super.subListUnchecked(fromIndex, toIndex); return new RegularImmutableSortedSet<E>(parentSubList, comparator()).asList(); }