Class MappingValueExtractor
java.lang.Object
org.incenp.obofoundry.sssom.extract.MappingValueExtractor
- All Implemented Interfaces:
IValueExtractor
- Direct Known Subclasses:
HashExtractor
,MappingExtensionExtractor
,MappingSlotExtractor
,SExpressionExtractor
Base class for extractors that extract a value from a specific mapping
record.
This is used by all expressions of the form mapping.
or
mapping(N).
.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MappingValueExtractor
(int mappingNo) Creates a new instance. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.incenp.obofoundry.sssom.extract.IValueExtractor
getType
-
Field Details
-
mappingNo
protected int mappingNo
-
-
Constructor Details
-
MappingValueExtractor
protected MappingValueExtractor(int mappingNo) Creates a new instance.- Parameters:
mappingNo
- If non-negative, the 0-based index of the mapping from which to extract a value. If negative, the 1-based index starting from the last mapping of the set.
-
-
Method Details
-
extract
Description copied from interface:IValueExtractor
Extracts the desired value from the given mapping set.- Specified by:
extract
in interfaceIValueExtractor
- Parameters:
ms
- The mapping set from which to extract the value.- Returns:
- The desired value, or
null
if the set does not contain a value at the specified location.
-
extract
Extracts the desired value from the given mapping.- Parameters:
mapping
- The mapping from which to extract the value.- Returns:
- The desired value, or
null
if the mapping does not have a value at the specified location.
-