
net.sf.jagg.msd.Extractor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jagg-core Show documentation
Show all versions of jagg-core Show documentation
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;
/**
* An Extractor
takes an element (or part of an element) from an
* object and returns it as a label. The label is the value
* that is actually discriminated. Examples of labels include one character in
* a String, or the high-order 16 bits of an integer.
*
* @param The element type that has labels that can be extracted.
* @param The type of the label that this Extractor
extracts
* out of elements of type E
.
*
* @author Randy Gettman
* @since 0.5.0
*/
public interface Extractor
{
/**
* Returns the label for a given element.
* @param element The element.
* @return The label.
*/
public L getLabel(E element);
/**
* Determines whether discrimination is complete for the given element, at
* the given index.
* @param element The element.
* @return true
if discrimination is complete or cannot
* continue, usually because the discrimination has run off the end of
* the label, false
otherwise.
*/
public boolean isComplete(E element);
/**
* The Discriminator
calls this method to indicate whether all
* elements in its current equivalence class were complete.
* @param allComplete Whether all elements were complete.
*/
public void setAllComplete(boolean allComplete);
/**
* The specific Discriminator
calls this method to determine
* whether all elements in the current equivalence class were complete.
* @return Whether all elements were complete.
*/
public boolean isAllComplete();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy