| Constructor and Description |
|---|
IndexedExtractor(int idx) |
| Modifier and Type | Method and Description |
|---|---|
ComparisonResult |
compareTo(Extractor<T,T,C> other)
Compares two extractors
|
boolean |
equals(Object obj) |
T |
extract(C context,
Map<C,Map<Extractor<T,? super T,C>,? super T>> cache,
T... obj)
Extracts value.
|
double |
getCost() |
int |
getIndex() |
int |
hashCode() |
boolean |
isContextDependent() |
Extractor<T,T,C> |
map(int[] map)
Applies mapping to extractor.
|
Set<Integer> |
parameterIndices() |
String |
toString() |
public IndexedExtractor(int idx)
public Set<Integer> parameterIndices()
parameterIndices in interface Extractor<T,T,C>public T extract(C context, Map<C,Map<Extractor<T,? super T,C>,? super T>> cache, T... obj)
Extractorextract in interface Extractor<T,T,C>context - Extraction context. Extraction context may provide source for constants for comparison
with object values.cache - Cache of values extracted from the source object for the given context.
Composite extractors can use cache to find already extracted values and to store extracted values.
For example extractor which extracts object area as obj.getWidth()*obj.getHeight() may find that width was already
extracted and getWidth() doesn't have to be invoked. So it invokes getHeight() and stores
returned value to the cache. It also calculates object area and stores it to the cache. A particular cache instance
is valid only for a particular obj array, i.e. it can be re-used between extractors but not between arguments.obj - Source objects.public boolean isContextDependent()
isContextDependent in interface Extractor<T,T,C>public ComparisonResult compareTo(Extractor<T,T,C> other)
Extractorpublic double getCost()
public Extractor<T,T,C> map(int[] map)
Mappablepublic int getIndex()