final SequencePointable seqp = new SequencePointable();
final LongPointable lp = (LongPointable) LongPointable.FACTORY.createPointable();
final IntegerPointable ip = (IntegerPointable) IntegerPointable.FACTORY.createPointable();
final ShortPointable sp = (ShortPointable) ShortPointable.FACTORY.createPointable();
final BytePointable bp = (BytePointable) BytePointable.FACTORY.createPointable();
final XSDecimalPointable decp = (XSDecimalPointable) XSDecimalPointable.FACTORY.createPointable();
final DoublePointable dp = (DoublePointable) DoublePointable.FACTORY.createPointable();
final FloatPointable fp = (FloatPointable) FloatPointable.FACTORY.createPointable();
final UTF8StringPointable utf8p = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable();
return new AbstractTaggedValueArgumentScalarEvaluator(args) {
@Override
protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException {
TaggedValuePointable tvp = args[0];
switch (tvp.getTag()) {
case ValueTag.SEQUENCE_TAG: {
tvp.getValue(seqp);
if (seqp.getEntryCount() == 0) {
XDMConstants.setFalse(result);
return;
}
XDMConstants.setTrue(result);
return;
}
case ValueTag.XS_BOOLEAN_TAG: {
result.set(tvp);
return;
}
case ValueTag.XS_DECIMAL_TAG: {
tvp.getValue(decp);
if (decp.longValue() == 0) {
XDMConstants.setFalse(result);
return;
}
XDMConstants.setTrue(result);
return;