Package net.sf.saxon.type
Class Subsumption
java.lang.Object
net.sf.saxon.type.Subsumption
Utility class (static methods only) for computing relationships among classes.
This logic is configuration-independent and stateless. It is often accessed
via class
TypeHierarchy, which maintains a cache
of the results, local to a Configuration.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Affinitystatic AffinitycombineRelationships(Affinity rel1, Affinity rel2) static AffinityCompute the relationship between the allowed content-types of two types, for example attribute(*, xs:integer) and attribute(xs:string).static AffinitycomputeRelationship(ItemType t1, ItemType t2) Determine the relationship of one item type to another.static booleanderivesFrom(AtomicType t1, AtomicType t2) static AffinityinverseRelationship(Affinity relation) static AffinityGet the relationship of two schema types to each otherstatic AffinityGet the relationship of two sequence types to each other
-
Constructor Details
-
Subsumption
public Subsumption()
-
-
Method Details
-
computeRelationship
Determine the relationship of one item type to another. This should be equivalent to the rules for subtype-itemType(t1, t2) (in the XPath31 specification section 2.5.6.2), except that we are computing a more precise relationship:- If subtype(A, B) and subtype(B, A) then SAME_TYPE
- Else, if subtype(A, B) then SUBSUMED_BY
- Else, if subtype(B, A) then SUBSUMES
- Else, if the value spaces of A and B have a non-empty intersection then OVERLAPS
- Else, DISJOINT.
- Parameters:
t1- the first item typet2- the second item type- Returns:
Affinity.SAME_TYPEif the types are the same;Affinity.SUBSUMESif the first type subsumes the second (that is, all instances of the second type are also instances of the first);Affinity.SUBSUMED_BYif the second type subsumes the first;Affinity.OVERLAPSif the two types overlap (have a non-empty intersection, but neither subsumes the other);Affinity.DISJOINTif the two types are disjoint (have an empty intersection)
-
derivesFrom
-
combineRelationships
-
computeContentRelationship
Compute the relationship between the allowed content-types of two types, for example attribute(*, xs:integer) and attribute(xs:string). Note that although such types are fairly meaningless in a non-schema-aware environment, they are permitted, and supported in Saxon-HE.- Parameters:
t1- the first typet2- the second type- Returns:
- the relationship, as one of the constants
Affinity.SAME_TYPE,Affinity.SUBSUMES,Affinity.SUBSUMED_BY,Affinity.DISJOINT,Affinity.OVERLAPS
-
sequenceTypeRelationship
Get the relationship of two sequence types to each other- Parameters:
s1- the first types2- the second type- Returns:
- the relationship, as one of the constants
Affinity.SAME_TYPE,Affinity.SUBSUMES,Affinity.SUBSUMED_BY,Affinity.DISJOINT,Affinity.OVERLAPS
-
choiceItemRelationship
-
schemaTypeRelationship
Get the relationship of two schema types to each other- Parameters:
s1- the first types2- the second type- Returns:
- the relationship of the two types, as one of the constants
Affinity.SAME_TYPE,Affinity.SUBSUMES,Affinity.SUBSUMED_BY,Affinity.DISJOINT,Affinity.OVERLAPS
-
inverseRelationship
-