Class AbstractSortedBidiMapDecorator

  • All Implemented Interfaces:
    java.util.Map, java.util.SortedMap, BidiMap, IterableMap, OrderedBidiMap, OrderedMap, SortedBidiMap
    Direct Known Subclasses:

    public abstract class AbstractSortedBidiMapDecorator
    extends AbstractOrderedBidiMapDecorator
    implements SortedBidiMap
    Commons Collections 3 is in maintenance mode. Commons Collections 4 should be used instead.
    Provides a base decorator that enables additional functionality to be added to a SortedBidiMap via decoration.

    Methods are forwarded directly to the decorated map.

    This implementation does not perform any special processing with the map views. Instead it simply returns the inverse from the wrapped map. This may be undesirable, for example if you are trying to write a validating implementation it would provide a loophole around the validation. But, you might want that loophole, so this class is kept simple.

    Commons Collections 3.0
    • Constructor Detail

      • AbstractSortedBidiMapDecorator

        public AbstractSortedBidiMapDecorator​(SortedBidiMap map)
        Constructor that wraps (not copies).
        map - the map to decorate, must not be null
        java.lang.IllegalArgumentException - if the collection is null
    • Method Detail

      • inverseSortedBidiMap

        public SortedBidiMap inverseSortedBidiMap()
        Description copied from interface: SortedBidiMap
        Gets a view of this map where the keys and values are reversed.

        Changes to one map will be visible in the other and vice versa. This enables both directions of the map to be accessed as a SortedMap.

        Implementations should seek to avoid creating a new object every time this method is called. See AbstractMap.values() etc. Calling this method on the inverse map should return the original.

        The inverse map returned by inverseBidiMap() should be the same object as returned by this method.

        Specified by:
        inverseSortedBidiMap in interface SortedBidiMap
        an inverted bidirectional map
      • comparator

        public java.util.Comparator comparator()
        Specified by:
        comparator in interface java.util.SortedMap
      • subMap

        public java.util.SortedMap subMap​(java.lang.Object fromKey,
                                          java.lang.Object toKey)
        Specified by:
        subMap in interface java.util.SortedMap
      • headMap

        public java.util.SortedMap headMap​(java.lang.Object toKey)
        Specified by:
        headMap in interface java.util.SortedMap
      • tailMap

        public java.util.SortedMap tailMap​(java.lang.Object fromKey)
        Specified by:
        tailMap in interface java.util.SortedMap