Class SurjectiveConverter<S,T>
java.lang.Object
org.apache.sis.internal.converter.SurjectiveConverter<S,T>
- Type Parameters:
S
- the type of objects to convert.T
- the type of converted objects.
- All Implemented Interfaces:
Function<S,
,T> ObjectConverter<S,
T>
- Direct Known Subclasses:
DefaultMetadata.ToLocale
,FormattedCharacterIterator.Filter
,FormattedCharacterIterator.Selector
,GeometryParser
,PropertiesConverter
,StringJoinOperation.ForFeature
,SystemUnit.DimToUnit
,TimeEncoding
Base class for (usually non-invertible) surjective
ObjectConverter
s.
Surjective converters are converters for which many different source values can produce
the same target value. In many cases, the target value having many possible sources is
the null
value. This is the case in particular when the converter is used as a
filter.
This base class is stateless. Consequently, sub-classes that choose to implement
Serializable
do not need to care about this base class.
- Since:
- 0.3
- Version:
- 0.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninverse()
Unsupported operation, since surjective converters are non-invertible (unless the converter is bijective, which is decided by subclasses).ReturnsFunctionProperty.SURJECTIVE
by default.toString()
Returns a string representation of this converter for debugging purpose.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.sis.util.ObjectConverter
apply, getSourceClass, getTargetClass
-
Constructor Details
-
SurjectiveConverter
protected SurjectiveConverter()Creates a new converter.
-
-
Method Details
-
properties
ReturnsFunctionProperty.SURJECTIVE
by default. Subclasses may add more properties (order preserving, etc.).- Specified by:
properties
in interfaceObjectConverter<S,
T> - Returns:
- the manners in which source values are mapped to target values. May be an empty set, but never null.
-
inverse
Unsupported operation, since surjective converters are non-invertible (unless the converter is bijective, which is decided by subclasses).- Specified by:
inverse
in interfaceObjectConverter<S,
T> - Returns:
- a converter for converting instances of T back to instances of S.
- Throws:
UnsupportedOperationException
- if this converter is not invertible.- See Also:
-
toString
Returns a string representation of this converter for debugging purpose.
-