Ejemplo n.º 1
0
 public override ResultSequence nilled()
 {
     if (_value is PSVIElementNSImpl)
     {
         PSVIElementNSImpl psviElement = (PSVIElementNSImpl)_value;
         return(XSBoolean.valueOf(psviElement.Nil));
     }
     else
     {
         return(XSBoolean.FALSE);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Comparison between the supplied and this boolean representation. Returns
        /// true if this XSBoolean represents false and that XSBoolean supplied
        /// represents true. Returns false otherwise
        /// </summary>
        /// <param name="arg">
        ///            The XSBoolean representation of the boolean value to compare
        ///            with. </param>
        /// <exception cref="DynamicError"> </exception>
        /// <returns> New XSBoolean representation of true/false result of the
        ///         comparison </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public boolean lt(AnyType arg, org.eclipse.wst.xml.xpath2.api.DynamicContext context) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public virtual bool lt(AnyType arg, DynamicContext context)
        {
            XSBoolean barg = (XSBoolean)NumericType.get_single_type((Item)arg, typeof(XSBoolean));

            bool result = false;

            if (!value() && barg.value())
            {
                result = true;
            }
            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new result sequence consisting of the retrievable boolean value
        /// in the supplied result sequence
        /// </summary>
        /// <param name="arg">
        ///            The result sequence from which to extract the boolean value. </param>
        /// <exception cref="DynamicError"> </exception>
        /// <returns> A new result sequence consisting of the boolean value supplied. </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public org.eclipse.wst.xml.xpath2.api.ResultSequence constructor(org.eclipse.wst.xml.xpath2.api.ResultSequence arg) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public override ResultSequence constructor(ResultSequence arg)
        {
            if (arg.empty())
            {
                return(ResultBuffer.EMPTY);
            }

            Item anyType = arg.first();

            if (anyType is XSDuration || anyType is CalendarType || anyType is XSBase64Binary || anyType is XSHexBinary || anyType is XSAnyURI)
            {
                throw DynamicError.invalidType();
            }

            string str_value = anyType.StringValue;


            if (!(isCastable(anyType, str_value)))
            {
                throw DynamicError.cant_cast(null);
            }

            return(XSBoolean.valueOf(!isFalse(str_value)));
        }
Ejemplo n.º 4
0
        // comparisons
        /// <summary>
        /// Comparison for equality between the supplied and this boolean
        /// representation. Returns true if both represent same boolean value, false
        /// otherwise
        /// </summary>
        /// <param name="arg">
        ///            The XSBoolean representation of the boolean value to compare
        ///            with. </param>
        /// <exception cref="DynamicError"> </exception>
        /// <returns> New XSBoolean representation of true/false result of the equality
        ///         comparison </returns>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public boolean eq(AnyType arg, org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public virtual bool eq(AnyType arg, DynamicContext dynamicContext)
        {
            XSBoolean barg = (XSBoolean)NumericType.get_single_type((Item)arg, typeof(XSBoolean));

            return(value() == barg.value());
        }