/** * Determine the data type of the items returned by the expression */ /*@NotNull*/ public ItemType getItemType() { ItemType operandType = getBaseExpression().getItemType(); TypeHierarchy th = getConfiguration().getTypeHierarchy(); int relationship = th.relationship(requiredItemType, operandType); switch (relationship) { case TypeHierarchy.OVERLAPS: if (requiredItemType instanceof NodeTest && operandType instanceof NodeTest) { return new CombinedNodeTest((NodeTest) requiredItemType, Token.INTERSECT, (NodeTest) operandType); } else { // we don't know how to intersect atomic types, it doesn't actually happen return requiredItemType; } case TypeHierarchy.SUBSUMES: case TypeHierarchy.SAME_TYPE: // shouldn't happen, but it doesn't matter return operandType; case TypeHierarchy.SUBSUMED_BY: default: return requiredItemType; } }
/** * Determine the data type of the items returned by the expression */ /*@NotNull*/ public ItemType getItemType() { ItemType operandType = getBaseExpression().getItemType(); TypeHierarchy th = getConfiguration().getTypeHierarchy(); int relationship = th.relationship(requiredItemType, operandType); switch (relationship) { case TypeHierarchy.OVERLAPS: if (requiredItemType instanceof NodeTest && operandType instanceof NodeTest) { return new CombinedNodeTest((NodeTest) requiredItemType, Token.INTERSECT, (NodeTest) operandType); } else { // we don't know how to intersect atomic types, it doesn't actually happen return requiredItemType; } case TypeHierarchy.SUBSUMES: case TypeHierarchy.SAME_TYPE: // shouldn't happen, but it doesn't matter return operandType; case TypeHierarchy.SUBSUMED_BY: default: return requiredItemType; } }
final TypeHierarchy th = getConfiguration().getTypeHierarchy(); int card = operand.getCardinality(); if (card == StaticProperty.EMPTY) {
final TypeHierarchy th = getConfiguration().getTypeHierarchy(); int card = operand.getCardinality(); if (card == StaticProperty.EMPTY) {