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

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

package net.sf.javagimmicks.collections8.transformer;

import java.util.Iterator;
import java.util.Spliterator;
import java.util.function.Function;

import net.sf.javagimmicks.collections8.AbstractRing;
import net.sf.javagimmicks.collections8.Ring;
import net.sf.javagimmicks.collections8.RingCursor;
import net.sf.javagimmicks.transform8.Transforming;

class TransformingRing
   extends AbstractRing
   implements Transforming
{
   protected final Ring _internalRing;
   private final Function _tansformer;

   TransformingRing(Ring ring, Function tansformer)
   {
      _internalRing = ring;
      _tansformer = tansformer;
   }
   
   public Function getTransformerFunction()
   {
      return _tansformer;
   }

   public RingCursor cursor()
   {
      return TransformerUtils.decorate(_internalRing.cursor(), getTransformerFunction());
   }
   
   public Iterator iterator()
   {
      return TransformerUtils.decorate(_internalRing.iterator(), getTransformerFunction());
   }
   
   @Override
   public Spliterator spliterator()
   {
      return TransformerUtils.decorate(_internalRing.spliterator(), getTransformerFunction());
   }

   @Override
   public int size()
   {
      return _internalRing.size();
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy