/** * Returns an iterable yielding a bidirectional iterator that will be * {@linkplain FastSortedEntrySet fast}, if possible, on the * {@linkplain Map#entrySet() entry set} of the provided {@code map}. * * @param map * a map from which we will try to extract an iterable yielding a * (fast) bidirectional iterator on the entry set. * @return an iterable yielding a bidirectional iterator on the entry set of the * given map that will be fast, if possible. * @since 8.0.0 */ public static ObjectBidirectionalIterable<Long2ShortMap.Entry> fastIterable(Long2ShortSortedMap map) { final ObjectSortedSet<Long2ShortMap.Entry> entries = map.long2ShortEntrySet(); return entries instanceof Long2ShortSortedMap.FastSortedEntrySet ? ((Long2ShortSortedMap.FastSortedEntrySet) entries)::fastIterator : entries; } /**
/** * Returns a sorted-set view of the mappings contained in this map. * <p> * Note that this specification strengthens the one given in the corresponding * type-specific unsorted map. * * @return a sorted-set view of the mappings contained in this map. * @see SortedMap#entrySet() * @deprecated Please use the corresponding type-specific method instead. */ @SuppressWarnings({"unchecked", "rawtypes"}) @Deprecated @Override default ObjectSortedSet<Map.Entry<Long, Short>> entrySet() { return (ObjectSortedSet) long2ShortEntrySet(); } /**
@Override public ObjectSortedSet<Long2ShortMap.Entry> long2ShortEntrySet() { if (entries == null) entries = ObjectSortedSets.unmodifiable(sortedMap.long2ShortEntrySet()); return (ObjectSortedSet<Long2ShortMap.Entry>) entries; } /**
@Override public ObjectSortedSet<Long2ShortMap.Entry> long2ShortEntrySet() { if (entries == null) entries = ObjectSortedSets.synchronize(sortedMap.long2ShortEntrySet(), sync); return (ObjectSortedSet<Long2ShortMap.Entry>) entries; } /**
@Override public ObjectSortedSet<Long2ShortMap.Entry> headSet(Long2ShortMap.Entry to) { return headMap(to.getLongKey()).long2ShortEntrySet(); } @Override
@Override public ObjectSortedSet<Long2ShortMap.Entry> tailSet(Long2ShortMap.Entry from) { return tailMap(from.getLongKey()).long2ShortEntrySet(); } };
@Override public ObjectSortedSet<Long2ShortMap.Entry> headSet(Long2ShortMap.Entry to) { return headMap(to.getLongKey()).long2ShortEntrySet(); } @Override
@Override public ObjectSortedSet<Long2ShortMap.Entry> tailSet(Long2ShortMap.Entry from) { return tailMap(from.getLongKey()).long2ShortEntrySet(); } };
@Override public ObjectSortedSet<Long2ShortMap.Entry> tailSet(Long2ShortMap.Entry from) { return tailMap(from.getLongKey()).long2ShortEntrySet(); } };
@Override public ObjectSortedSet<Long2ShortMap.Entry> headSet(Long2ShortMap.Entry to) { return headMap(to.getLongKey()).long2ShortEntrySet(); } @Override
@Override public ObjectSortedSet<Long2ShortMap.Entry> headSet(Long2ShortMap.Entry to) { return headMap(to.getLongKey()).long2ShortEntrySet(); } @Override
@Override public ObjectSortedSet<Long2ShortMap.Entry> tailSet(Long2ShortMap.Entry from) { return tailMap(from.getLongKey()).long2ShortEntrySet(); } };
/** * Returns a bidirectional iterator that will be {@linkplain FastSortedEntrySet * fast}, if possible, on the {@linkplain Map#entrySet() entry set} of the * provided {@code map}. * * @param map * a map from which we will try to extract a (fast) bidirectional * iterator on the entry set. * @return a bidirectional iterator on the entry set of the given map that will * be fast, if possible. * @since 8.0.0 */ public static ObjectBidirectionalIterator<Long2ShortMap.Entry> fastIterator(Long2ShortSortedMap map) { final ObjectSortedSet<Long2ShortMap.Entry> entries = map.long2ShortEntrySet(); return entries instanceof Long2ShortSortedMap.FastSortedEntrySet ? ((Long2ShortSortedMap.FastSortedEntrySet) entries).fastIterator() : entries.iterator(); } /**
@Override public ObjectSortedSet<Long2ShortMap.Entry> subSet(Long2ShortMap.Entry from, Long2ShortMap.Entry to) { return subMap(from.getLongKey(), to.getLongKey()).long2ShortEntrySet(); } @Override
@Override public ObjectSortedSet<Long2ShortMap.Entry> subSet(Long2ShortMap.Entry from, Long2ShortMap.Entry to) { return subMap(from.getLongKey(), to.getLongKey()).long2ShortEntrySet(); } @Override
@Override public ObjectSortedSet<Long2ShortMap.Entry> subSet(Long2ShortMap.Entry from, Long2ShortMap.Entry to) { return subMap(from.getLongKey(), to.getLongKey()).long2ShortEntrySet(); } @Override
@Override public ObjectSortedSet<Long2ShortMap.Entry> subSet(Long2ShortMap.Entry from, Long2ShortMap.Entry to) { return subMap(from.getLongKey(), to.getLongKey()).long2ShortEntrySet(); } @Override