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

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

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

import java.util.AbstractSet;
import java.util.Iterator;
import java.util.Set;

import net.sf.javagimmicks.transform.Transforming;
import net.sf.javagimmicks.util.Function;

class TransformingSet
   extends AbstractSet
   implements Transforming
{
   protected final Set _internalSet;
   private final Function _transformer;
   
   /**
    * @deprecated Use TranformerUtils.decorate() instead
    */
   @Deprecated
   public TransformingSet(Set set, Function transformer)
   {
      _internalSet = set;
      _transformer = transformer;
   }

   public Function getTransformerFunction()
   {
      return _transformer;
   }

   @Override
   public Iterator iterator()
   {
      return TransformerUtils.decorate(_internalSet.iterator(), getTransformerFunction());
   }

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

   @Override
   public void clear()
   {
      _internalSet.clear();
   }
   
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy