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

net.sf.javagimmicks.collections.transformer.TransformingNavigableSet Maven / Gradle / Ivy

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

import java.util.Iterator;
import java.util.NavigableSet;

import net.sf.javagimmicks.util.Function;

class TransformingNavigableSet
   extends TransformingSortedSet
   implements NavigableSet
{
   /**
    * @deprecated Use TranformerUtils.decorate() instead
    */
   @Deprecated
   public TransformingNavigableSet(NavigableSet set, Function transformer)
   {
      super(set, transformer);
   }

   public T ceiling(T e)
   {
      throw new UnsupportedOperationException();
   }

   public Iterator descendingIterator()
   {
      return TransformerUtils.decorate(getNavigableSet().descendingIterator(), getTransformerFunction());
   }

   public NavigableSet descendingSet()
   {
      return TransformerUtils.decorate(getNavigableSet().descendingSet(), getTransformerFunction());
   }

   public T floor(T e)
   {
      throw new UnsupportedOperationException();
   }

   public NavigableSet headSet(T toElement, boolean inclusive)
   {
      throw new UnsupportedOperationException();
   }

   public T higher(T e)
   {
      throw new UnsupportedOperationException();
   }

   public T lower(T e)
   {
      throw new UnsupportedOperationException();
   }

   public T pollFirst()
   {
      F first = getNavigableSet().pollFirst();
      return first != null ? transform(first) : null;
   }

   public T pollLast()
   {
      F last = getNavigableSet().pollLast();
      return last != null ? transform(last) : null;
   }

   public NavigableSet subSet(T fromElement, boolean fromInclusive,
         T toElement, boolean toInclusive)
   {
      throw new UnsupportedOperationException();
   }

   public NavigableSet tailSet(T fromElement, boolean inclusive)
   {
      throw new UnsupportedOperationException();
   }

   protected NavigableSet getNavigableSet()
   {
      return (NavigableSet)_internalSet;
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy