Package org.apache.sis.filter
Class PropertyValue.Converted<V>
java.lang.Object
org.apache.sis.internal.filter.Node
org.apache.sis.filter.LeafExpression<AbstractFeature,V>
org.apache.sis.filter.PropertyValue<V>
org.apache.sis.filter.PropertyValue.Converted<V>
- Type Parameters:
V
- the type of value computed by the expression.
- All Implemented Interfaces:
Serializable
,Function<AbstractFeature,
,V> Expression<AbstractFeature,
,V> Optimization.OnExpression<AbstractFeature,
,V> FeatureExpression<AbstractFeature,
,V> ValueReference<AbstractFeature,
V>
- Direct Known Subclasses:
PropertyValue.CastedAndConverted
- Enclosing class:
PropertyValue<V>
An expression fetching property values as an object of specified type.
The value is converted from
Object
to the specified type.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.filter.LeafExpression
LeafExpression.Literal<R,
V>, LeafExpression.Transformed<R, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
For cross-version compatibility.The desired type of values.Fields inherited from class org.apache.sis.filter.PropertyValue
isVirtual, name, VIRTUAL_PREFIX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply
(AbstractFeature instance) Returns the value of the property of the given name.final PropertyTypeBuilder
expectedType
(DefaultFeatureType valueType, FeatureTypeBuilder addTo) Provides the expected type of values produced by this expression when a feature of the given type is evaluated.Returns the type of values computed by this expression.final PropertyValue
<V> optimize
(Optimization optimization) Tries to optimize this expression.Methods inherited from class org.apache.sis.filter.PropertyValue
create, expectedType, getChildren, getFunctionName, getSourceClass, getXPath, toValueType
Methods inherited from class org.apache.sis.filter.LeafExpression
getParameters
Methods inherited from class org.apache.sis.internal.filter.Node
createName, createType, equals, getGeometryLibrary, hashCode, symbol, toGeometryWrapper, toString, unwrap, warning
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.sis.filter.Expression
getParameters
Methods inherited from interface org.apache.sis.filter.Optimization.OnExpression
recreate
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
type
The desired type of values.
-
-
Constructor Details
-
Converted
Creates a new expression retrieving values from a property of the given name.- Parameters:
type
- the desired type for the expression result.name
- the name of the property to fetch.
-
-
Method Details
-
getValueClass
Returns the type of values computed by this expression.- Returns:
- the type of values computed by this expression.
-
apply
Returns the value of the property of the given name. If no value is found for the given feature, then this method returnsnull
.- Parameters:
instance
- the object to be evaluated by the expression. Can benull
if this expression allows null values.- Returns:
- value computed by the expression.
-
optimize
Tries to optimize this expression. If anObjectConverter
can be determined in advance for the feature type for which to optimize, then a specialized expression is returned. Otherwise this method returnsthis
.- Specified by:
optimize
in interfaceOptimization.OnExpression<AbstractFeature,
V> - Specified by:
optimize
in classPropertyValue<V>
- Parameters:
optimization
- the simplifications or optimizations to apply on this expression.- Returns:
- the simplified or optimized expression, or
this
if no optimization has been applied.
-
expectedType
public final PropertyTypeBuilder expectedType(DefaultFeatureType valueType, FeatureTypeBuilder addTo) Provides the expected type of values produced by this expression when a feature of the given type is evaluated.- Specified by:
expectedType
in interfaceFeatureExpression<AbstractFeature,
V> - Overrides:
expectedType
in classPropertyValue<V>
- Parameters:
valueType
- the type of features to be evaluated by the given expression.addTo
- where to add the type of properties evaluated by the given expression.- Returns:
- builder of the added property, or
null
if this method cannot add a property.
-