Package net.sf.saxon.type
Class TypeHierarchy
- java.lang.Object
-
- net.sf.saxon.type.TypeHierarchy
-
- All Implemented Interfaces:
java.io.Serializable
public class TypeHierarchy extends java.lang.Object implements java.io.SerializableThis class exists to provide answers to questions about the type hierarchy. Because such questions are potentially expensive, it caches the answers.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intDISJOINTConstant denoting relationship between two types: A is disjoint from Bstatic intOVERLAPSConstant denoting relationship between two types: A overlaps Bstatic intSAME_TYPEConstant denoting relationship between two types: A is the same type as Bstatic intSUBSUMED_BYConstant denoting relationship between two types: A is subsumed by Bstatic intSUBSUMESConstant denoting relationship between two types: A subsumes B
-
Constructor Summary
Constructors Constructor Description TypeHierarchy(Configuration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigurationgetConfiguration()booleanisIdCode(int typeCode)Test whether a type annotation code represents the type xs:ID or one of its subtypesbooleanisIdrefsCode(int typeCode)Test whether a type annotation code represents the type xs:IDREF, xs:IDREFS or one of their subtypesbooleanisSubType(ItemType subtype, ItemType supertype)Determine whether type A is type B or one of its subtypes, recursivelyintrelationship(ItemType t1, ItemType t2)Determine the relationship of one item type to another.
-
-
-
Field Detail
-
SAME_TYPE
public static final int SAME_TYPE
Constant denoting relationship between two types: A is the same type as B- See Also:
- Constant Field Values
-
SUBSUMES
public static final int SUBSUMES
Constant denoting relationship between two types: A subsumes B- See Also:
- Constant Field Values
-
SUBSUMED_BY
public static final int SUBSUMED_BY
Constant denoting relationship between two types: A is subsumed by B- See Also:
- Constant Field Values
-
OVERLAPS
public static final int OVERLAPS
Constant denoting relationship between two types: A overlaps B- See Also:
- Constant Field Values
-
DISJOINT
public static final int DISJOINT
Constant denoting relationship between two types: A is disjoint from B- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TypeHierarchy
public TypeHierarchy(Configuration config)
-
-
Method Detail
-
getConfiguration
public Configuration getConfiguration()
-
isSubType
public boolean isSubType(ItemType subtype, ItemType supertype)
Determine whether type A is type B or one of its subtypes, recursively- Parameters:
subtype- identifies the first typesupertype- identifies the second type- Returns:
- true if the first type is the second type or a (direct or indirect) subtype of the second type
-
relationship
public int relationship(ItemType t1, ItemType t2)
Determine the relationship of one item type to another.- Parameters:
t1- the first item typet2- the second item type- Returns:
SAME_TYPEif the types are the same;SUBSUMESif the first type subsumes the second (that is, all instances of the second type are also instances of the first);SUBSUMED_BYif the second type subsumes the first;OVERLAPSif the two types overlap (have a non-empty intersection, but neither subsumes the other);DISJOINTif the two types are disjoint (have an empty intersection)
-
isIdCode
public boolean isIdCode(int typeCode)
Test whether a type annotation code represents the type xs:ID or one of its subtypes
-
isIdrefsCode
public boolean isIdrefsCode(int typeCode)
Test whether a type annotation code represents the type xs:IDREF, xs:IDREFS or one of their subtypes
-
-