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

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

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

import net.sf.javagimmicks.collections.AbstractRing;
import net.sf.javagimmicks.collections.Ring;
import net.sf.javagimmicks.collections.RingCursor;
import net.sf.javagimmicks.transform.Transforming;
import net.sf.javagimmicks.util.Function;

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

   /**
    * @deprecated Use TranformerUtils.decorate() instead
    */
   @Deprecated
   public TransformingRing(Ring ring, Function tansformer)
   {
      _internalRing = ring;
      _tansformer = tansformer;
   }
   
   public Function getTransformerFunction()
   {
      return _tansformer;
   }

   public RingCursor cursor()
   {
      return TransformerUtils.decorate(_internalRing.cursor(), getTransformerFunction());
   }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy