net.sf.jagg.msd
Interface Extractor<E,L>

Type Parameters:
E - The element type that has labels that can be extracted.
L - The type of the label that this Extractor extracts out of elements of type E.
All Known Implementing Classes:
ArrayDiscriminator.ArrayChainedExtractor, CalendarDiscriminator.CalendarChainedExtractor, ChainedExtractor, ClassDiscriminator.ClassChainedExtractor, CollectionDiscriminator.CollectionChainedExtractor, DateDiscriminator.DateChainedExtractor, EnumDiscriminator.EnumChainedExtractor, PropertiesDiscriminator.MethodCallChainedExtractor, RandomAccessListDiscriminator.ListChainedExtractor, SelfExtractor

public interface Extractor<E,L>

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.

Since:
0.5.0
Author:
Randy Gettman

Method Summary
 L getLabel(E element)
          Returns the label for a given element.
 boolean isAllComplete()
          The specific Discriminator calls this method to determine whether all elements in the current equivalence class were complete.
 boolean isComplete(E element)
          Determines whether discrimination is complete for the given element, at the given index.
 void setAllComplete(boolean allComplete)
          The Discriminator calls this method to indicate whether all elements in its current equivalence class were complete.
 

Method Detail

getLabel

L getLabel(E element)
Returns the label for a given element.

Parameters:
element - The element.
Returns:
The label.

isComplete

boolean isComplete(E element)
Determines whether discrimination is complete for the given element, at the given index.

Parameters:
element - The element.
Returns:
true if discrimination is complete or cannot continue, usually because the discrimination has run off the end of the label, false otherwise.

setAllComplete

void setAllComplete(boolean allComplete)
The Discriminator calls this method to indicate whether all elements in its current equivalence class were complete.

Parameters:
allComplete - Whether all elements were complete.

isAllComplete

boolean isAllComplete()
The specific Discriminator calls this method to determine whether all elements in the current equivalence class were complete.

Returns:
Whether all elements were complete.


Copyright © 2010-2013 jAgg Team. All Rights Reserved.