net.sf.adatagenerator.api
Interface NamedInstance

All Superinterfaces:
Comparable<NamedInstance>
All Known Subinterfaces:
BeanModifier<T>, Group<T>, HierarchicalGroup<T>, PairModifier<T,P>, ValueModifier<V>
All Known Implementing Classes:
AbstractValueModifier, AbstractValueModifier.StringModifier, BeanFieldModifier, CharInserter, CompositeBeanFieldModifier, CompositePairModifier, DefaultGroup, DefaultNamedInstance, DefaultPairModifier, FebrlDataDrivenModifier, GivenNameMisspeller, NoChangeValueModifier, NullValueModifier, OCRTransformer, PhoneticTransformer, RandomBeanFieldModifier, RandomPairModifier, StringFieldModifier, Transpositioner

public interface NamedInstance
extends Comparable<NamedInstance>


Method Summary
 int compareContexts(NamedInstance namedInstance)
          Compares the context of this instance to the context of another instance using the context comparator of this instance.
 int compareTo(NamedInstance namedInstance)
          Compares this instance to another instance using the comparator of this instance.
 String getContext()
          The context in which this instance is named.
 Comparator<String> getContextComparator()
           
 String getName()
          Implementing classes should return a name that will be comparable within some context
 Comparator<NamedInstance> getNamedInstanceComparator()
           
 

Method Detail

getName

String getName()
Implementing classes should return a name that will be comparable within some context

Returns:
a value that identifies an instance in some context. This parameter may be null for an anonymous instance, but if it is non-null, the value will be a trimmed String

getContext

String getContext()
The context in which this instance is named. If another instance has different context from this instance, then implementing classes should ensure that compareTo(NamedInstance) returns the same (non-zero) value that is the result of comparing the contexts.

Returns:
may be null if the context is implicit and well understood, and trimmed otherwise

compareContexts

int compareContexts(NamedInstance namedInstance)
Compares the context of this instance to the context of another instance using the context comparator of this instance.


getContextComparator

Comparator<String> getContextComparator()

compareTo

int compareTo(NamedInstance namedInstance)
Compares this instance to another instance using the comparator of this instance.

Specified by:
compareTo in interface Comparable<NamedInstance>

getNamedInstanceComparator

Comparator<NamedInstance> getNamedInstanceComparator()


Copyright © 2011-2012. All Rights Reserved.