if (replacement == null) return score;
return new FullTextSearchScore(replacement);
}
if (operand instanceof Length) {
Length operation = (Length)operand;
PropertyValue wrapped = operation.getPropertyValue();
SelectorName replacement = rewrittenSelectors.get(wrapped.selectorName());
if (replacement == null) return operand;
return new Length(new PropertyValue(replacement, wrapped.getPropertyName()));
}
if (operand instanceof LowerCase) {
LowerCase operation = (LowerCase)operand;
SelectorName replacement = rewrittenSelectors.get(operation.selectorName());
if (replacement == null) return operand;
return new LowerCase(replaceReferencesToRemovedSource(context, operation.getOperand(), rewrittenSelectors));
}
if (operand instanceof UpperCase) {
UpperCase operation = (UpperCase)operand;
SelectorName replacement = rewrittenSelectors.get(operation.selectorName());
if (replacement == null) return operand;
return new UpperCase(replaceReferencesToRemovedSource(context, operation.getOperand(), rewrittenSelectors));
}
if (operand instanceof NodeName) {
NodeName name = (NodeName)operand;
SelectorName replacement = rewrittenSelectors.get(name.selectorName());
if (replacement == null) return name;
return new NodeName(replacement);
}
if (operand instanceof NodeLocalName) {
NodeLocalName name = (NodeLocalName)operand;
SelectorName replacement = rewrittenSelectors.get(name.selectorName());
if (replacement == null) return name;
return new NodeLocalName(replacement);
}
if (operand instanceof PropertyValue) {
PropertyValue value = (PropertyValue)operand;
SelectorName replacement = rewrittenSelectors.get(value.selectorName());
if (replacement == null) return operand;
return new PropertyValue(replacement, value.getPropertyName());
}
if (operand instanceof ReferenceValue) {
ReferenceValue value = (ReferenceValue)operand;
SelectorName replacement = rewrittenSelectors.get(value.selectorName());
if (replacement == null) return operand;
return new ReferenceValue(replacement, value.getPropertyName());
}
if (operand instanceof NodeDepth) {
NodeDepth depth = (NodeDepth)operand;
SelectorName replacement = rewrittenSelectors.get(depth.selectorName());
if (replacement == null) return operand;