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

net.sf.jagg.msd.SelfExtractor Maven / Gradle / Ivy

Go to download

jAgg is a Java 5.0 API that supports “group by” operations on Lists of Java objects: aggregate operations such as count, sum, max, min, avg, and many more. It also allows custom aggregate operations.

The newest version!
package net.sf.jagg.msd;

/**
 * A SelfExtractor returns the element itself as the label.
 *
 * @param  The element type whose label is itself.
 *
 * @author Randy Gettman
 * @since 0.5.0
 */
public class SelfExtractor implements Extractor
{
   /**
    * Returns the element as its own label.
    * @param element The element.
    * @return The element as the label.
    */
   public E getLabel(E element)
   {
      return element;
   }

   /**
    * The SelfExtractor is never "complete", i.e., we would never
    * want to prevent the calling of getLabel because that method
    * will always succeed.
    * @param element The element.
    * @return false.
    */
   public boolean isComplete(E element)
   {
      return false;
   }

   /**
    * The SelfExtractor is never "all complete", i.e., there are
    * no Discriminators up the chain to notify that discrimination
    * is complete.
    * @param allComplete Whether all elements were complete.
    */
   public void setAllComplete(boolean allComplete)
   {
   }

   /**
    * The SelfExtractor is never "all complete", i.e., there are
    * no Discriminators up the chain to notify that discrimination
    * is complete.
    * @return false.
    */
   public boolean isAllComplete()
   {
      return false;
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy