0N/A/*
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A/*
0N/A * This file is available under and governed by the GNU General Public
0N/A * License version 2 only, as published by the Free Software Foundation.
0N/A * However, the following notice accompanied the original version of this
0N/A * file:
0N/A *
0N/A * Written by Doug Lea with assistance from members of JCP JSR-166
0N/A * Expert Group and released to the public domain, as explained at
3984N/A * http://creativecommons.org/publicdomain/zero/1.0/
0N/A */
0N/A
0N/Apackage java.util.concurrent;
0N/Aimport java.util.*;
0N/A
0N/A/**
0N/A * A {@link ConcurrentMap} supporting {@link NavigableMap} operations,
0N/A * and recursively so for its navigable sub-maps.
0N/A *
0N/A * <p>This interface is a member of the
0N/A * <a href="{@docRoot}/../technotes/guides/collections/index.html">
0N/A * Java Collections Framework</a>.
0N/A *
0N/A * @author Doug Lea
0N/A * @param <K> the type of keys maintained by this map
0N/A * @param <V> the type of mapped values
0N/A * @since 1.6
0N/A */
0N/Apublic interface ConcurrentNavigableMap<K,V>
0N/A extends ConcurrentMap<K,V>, NavigableMap<K,V>
0N/A{
0N/A /**
0N/A * @throws ClassCastException {@inheritDoc}
0N/A * @throws NullPointerException {@inheritDoc}
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A */
0N/A ConcurrentNavigableMap<K,V> subMap(K fromKey, boolean fromInclusive,
0N/A K toKey, boolean toInclusive);
0N/A
0N/A /**
0N/A * @throws ClassCastException {@inheritDoc}
0N/A * @throws NullPointerException {@inheritDoc}
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A */
0N/A ConcurrentNavigableMap<K,V> headMap(K toKey, boolean inclusive);
0N/A
0N/A
0N/A /**
0N/A * @throws ClassCastException {@inheritDoc}
0N/A * @throws NullPointerException {@inheritDoc}
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A */
0N/A ConcurrentNavigableMap<K,V> tailMap(K fromKey, boolean inclusive);
0N/A
0N/A /**
0N/A * @throws ClassCastException {@inheritDoc}
0N/A * @throws NullPointerException {@inheritDoc}
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A */
0N/A ConcurrentNavigableMap<K,V> subMap(K fromKey, K toKey);
0N/A
0N/A /**
0N/A * @throws ClassCastException {@inheritDoc}
0N/A * @throws NullPointerException {@inheritDoc}
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A */
0N/A ConcurrentNavigableMap<K,V> headMap(K toKey);
0N/A
0N/A /**
0N/A * @throws ClassCastException {@inheritDoc}
0N/A * @throws NullPointerException {@inheritDoc}
0N/A * @throws IllegalArgumentException {@inheritDoc}
0N/A */
0N/A ConcurrentNavigableMap<K,V> tailMap(K fromKey);
0N/A
0N/A /**
0N/A * Returns a reverse order view of the mappings contained in this map.
0N/A * The descending map is backed by this map, so changes to the map are
0N/A * reflected in the descending map, and vice-versa.
0N/A *
0N/A * <p>The returned map has an ordering equivalent to
0N/A * <tt>{@link Collections#reverseOrder(Comparator) Collections.reverseOrder}(comparator())</tt>.
0N/A * The expression {@code m.descendingMap().descendingMap()} returns a
0N/A * view of {@code m} essentially equivalent to {@code m}.
0N/A *
0N/A * @return a reverse order view of this map
0N/A */
0N/A ConcurrentNavigableMap<K,V> descendingMap();
0N/A
0N/A /**
0N/A * Returns a {@link NavigableSet} view of the keys contained in this map.
0N/A * The set's iterator returns the keys in ascending order.
0N/A * The set is backed by the map, so changes to the map are
0N/A * reflected in the set, and vice-versa. The set supports element
0N/A * removal, which removes the corresponding mapping from the map,
0N/A * via the {@code Iterator.remove}, {@code Set.remove},
0N/A * {@code removeAll}, {@code retainAll}, and {@code clear}
0N/A * operations. It does not support the {@code add} or {@code addAll}
0N/A * operations.
0N/A *
0N/A * <p>The view's {@code iterator} is a "weakly consistent" iterator
0N/A * that will never throw {@link ConcurrentModificationException},
0N/A * and guarantees to traverse elements as they existed upon
0N/A * construction of the iterator, and may (but is not guaranteed to)
0N/A * reflect any modifications subsequent to construction.
0N/A *
0N/A * @return a navigable set view of the keys in this map
0N/A */
0N/A public NavigableSet<K> navigableKeySet();
0N/A
0N/A /**
0N/A * Returns a {@link NavigableSet} view of the keys contained in this map.
0N/A * The set's iterator returns the keys in ascending order.
0N/A * The set is backed by the map, so changes to the map are
0N/A * reflected in the set, and vice-versa. The set supports element
0N/A * removal, which removes the corresponding mapping from the map,
0N/A * via the {@code Iterator.remove}, {@code Set.remove},
0N/A * {@code removeAll}, {@code retainAll}, and {@code clear}
0N/A * operations. It does not support the {@code add} or {@code addAll}
0N/A * operations.
0N/A *
0N/A * <p>The view's {@code iterator} is a "weakly consistent" iterator
0N/A * that will never throw {@link ConcurrentModificationException},
0N/A * and guarantees to traverse elements as they existed upon
0N/A * construction of the iterator, and may (but is not guaranteed to)
0N/A * reflect any modifications subsequent to construction.
0N/A *
0N/A * <p>This method is equivalent to method {@code navigableKeySet}.
0N/A *
0N/A * @return a navigable set view of the keys in this map
0N/A */
0N/A NavigableSet<K> keySet();
0N/A
0N/A /**
0N/A * Returns a reverse order {@link NavigableSet} view of the keys contained in this map.
0N/A * The set's iterator returns the keys in descending order.
0N/A * The set is backed by the map, so changes to the map are
0N/A * reflected in the set, and vice-versa. The set supports element
0N/A * removal, which removes the corresponding mapping from the map,
0N/A * via the {@code Iterator.remove}, {@code Set.remove},
0N/A * {@code removeAll}, {@code retainAll}, and {@code clear}
0N/A * operations. It does not support the {@code add} or {@code addAll}
0N/A * operations.
0N/A *
0N/A * <p>The view's {@code iterator} is a "weakly consistent" iterator
0N/A * that will never throw {@link ConcurrentModificationException},
0N/A * and guarantees to traverse elements as they existed upon
0N/A * construction of the iterator, and may (but is not guaranteed to)
0N/A * reflect any modifications subsequent to construction.
0N/A *
0N/A * @return a reverse order navigable set view of the keys in this map
0N/A */
0N/A public NavigableSet<K> descendingKeySet();
0N/A}