Class NumberView<N extends Node>

  • All Implemented Interfaces:
    View<N>, java.io.Serializable, java.lang.Comparable<View<N>>

    public final class NumberView<N extends Node>
    extends java.lang.Object
    implements View<N>, java.io.Serializable
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      NumberView​(double number)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(View<N> other)
      Compare views by XQuery comparison rules.
      boolean toBoolean()
      Converts this view to a boolean value.
      double toNumber()
      Converts this view to a numeric value.
      java.lang.String toString()
      Converts this view to a string value.
      <T> T visit​(ViewVisitor<N,​T> visitor)
      Visits current XML element.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NumberView

        public NumberView​(double number)
    • Method Detail

      • compareTo

        public int compareTo​(View<N> other)
        Description copied from interface: View
        Compare views by XQuery comparison rules.
        Specified by:
        compareTo in interface java.lang.Comparable<N extends Node>
        Specified by:
        compareTo in interface View<N extends Node>
        Parameters:
        other - view to compare with
        Returns:
        comparison result
      • toBoolean

        public boolean toBoolean()
        Description copied from interface: View
        Converts this view to a boolean value.
        Specified by:
        toBoolean in interface View<N extends Node>
        Returns:
        boolean value
      • toNumber

        public double toNumber()
        Description copied from interface: View
        Converts this view to a numeric value.
        Specified by:
        toNumber in interface View<N extends Node>
        Returns:
        numeric value
      • toString

        public java.lang.String toString()
        Description copied from interface: View
        Converts this view to a string value.
        Specified by:
        toString in interface View<N extends Node>
        Overrides:
        toString in class java.lang.Object
        Returns:
        string value
      • visit

        public <T> T visit​(ViewVisitor<N,​T> visitor)
                    throws XmlBuilderException
        Description copied from interface: View
        Visits current XML element.
        Specified by:
        visit in interface View<N extends Node>
        Type Parameters:
        T - type of return value
        Parameters:
        visitor - XML element visitor
        Returns:
        visitor result
        Throws:
        XmlBuilderException - if error occur during XML model modification