All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.javagimmicks.collections8.transformer.ValueBidiTransformingNavigableMap Maven / Gradle / Ivy

There is a newer version: 0.99-alpha1
Show newest version
package net.sf.javagimmicks.collections8.transformer;

import java.util.NavigableMap;
import java.util.NavigableSet;

import net.sf.javagimmicks.transform8.BidiFunction;

class ValueBidiTransformingNavigableMap
   extends ValueBidiTransformingSortedMap
   implements NavigableMap
{
   ValueBidiTransformingNavigableMap(NavigableMap map, BidiFunction valueTransformer)
   {
      super(map, valueTransformer);
   }
   
   public Entry ceilingEntry(K key)
   {
      Entry ceilingEntry = getNavigableMap().ceilingEntry(key);
      
      return ceilingEntry == null ? null : new ValueBidiTransformingEntry(
         ceilingEntry,
         getTransformerBidiFunction());
   }

   public K ceilingKey(K key)
   {
      return getNavigableMap().ceilingKey(key);
   }

   public NavigableSet descendingKeySet()
   {
      return getNavigableMap().descendingKeySet();
   }

   public NavigableMap descendingMap()
   {
      return TransformerUtils.decorateValueBased(
         getNavigableMap().descendingMap(),
         getTransformerBidiFunction());
   }

   public Entry firstEntry()
   {
      Entry firstEntry = getNavigableMap().firstEntry();
      
      return firstEntry == null ? null : new ValueBidiTransformingEntry(
         firstEntry,
         getTransformerBidiFunction());
   }

   public Entry floorEntry(K key)
   {
      Entry floorEntry = getNavigableMap().floorEntry(key);
      
      return floorEntry == null ? null : new ValueBidiTransformingEntry(
         floorEntry,
         getTransformerBidiFunction());
   }

   public K floorKey(K key)
   {
      return getNavigableMap().floorKey(key);
   }

   public NavigableMap headMap(K toKey, boolean inclusive)
   {
      return TransformerUtils.decorateValueBased( 
         getNavigableMap().headMap(toKey, inclusive),
         getTransformerBidiFunction());
   }

   public Entry higherEntry(K key)
   {
      Entry higherEntry = getNavigableMap().higherEntry(key);
      
      return higherEntry == null ? null : new ValueBidiTransformingEntry(
         higherEntry,
         getTransformerBidiFunction());
   }

   public K higherKey(K key)
   {
      return getNavigableMap().higherKey(key);
   }

   public Entry lastEntry()
   {
      Entry lastEntry = getNavigableMap().lastEntry();
      
      return lastEntry == null ? null : new ValueBidiTransformingEntry(
         lastEntry,
         getTransformerBidiFunction());
   }

   public Entry lowerEntry(K key)
   {
      Entry lowerEntry = getNavigableMap().lowerEntry(key);
      
      return lowerEntry == null ? null : new ValueBidiTransformingEntry(
         lowerEntry,
         getTransformerBidiFunction());
   }

   public K lowerKey(K key)
   {
      return getNavigableMap().lowerKey(key);
   }

   public NavigableSet navigableKeySet()
   {
      return getNavigableMap().navigableKeySet();
   }

   public Entry pollFirstEntry()
   {
      Entry firstEntry = getNavigableMap().pollFirstEntry();
      
      return firstEntry == null ? null : new ValueBidiTransformingEntry(
         firstEntry,
         getTransformerBidiFunction());
   }

   public Entry pollLastEntry()
   {
      Entry lastEntry = getNavigableMap().pollLastEntry();
      
      return lastEntry == null ? null : new ValueBidiTransformingEntry(
         lastEntry,
         getTransformerBidiFunction());
   }

   public NavigableMap subMap(K fromKey, boolean fromInclusive, K toKey,
         boolean toInclusive)
   {
      return TransformerUtils.decorateValueBased( 
         getNavigableMap().subMap(fromKey, fromInclusive, toKey, toInclusive),
         getTransformerBidiFunction());
   }

   public NavigableMap tailMap(K fromKey, boolean inclusive)
   {
      return TransformerUtils.decorateValueBased( 
         getNavigableMap().tailMap(fromKey, inclusive),
         getTransformerBidiFunction());
   }

   protected NavigableMap getNavigableMap()
   {
      return (NavigableMap)_internalMap;
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy