Class DOMElem.Iterator

  • Enclosing class:
    DOMElem

    public static class DOMElem.Iterator
    extends java.lang.Object
    DOMElem iterator based on concrete ItImpl implementations.
    • Constructor Detail

      • Iterator

        public Iterator​(long cPtr,
                        boolean cMemoryOwn)
      • Iterator

        public Iterator()
        constructor
    • Method Detail

      • delete

        public void delete()
      • assign

        public DOMElem.Iterator assign​(DOMElem.Iterator right)
        Assignment operator.
        Parameters:
        right - [in] the Iterator to assign.
        Returns:
        a reference to this iterator (for chaining).
      • __ref__

        public DOMElemPtr __ref__()
        Reference to the T element
      • __deref__

        public DOMElemPtr __deref__()
        Pointer to the T element
      • incement

        public DOMElem.Iterator incement()
        Increments the position of the iterator
        Returns:
        Reference to the incremented iterator
      • equals

        public boolean equals​(DOMElem.Iterator other)
        Increments the position of the iterator
        Parameters:
        other - [in] ConcatVectorIterator to compare with
        Returns:
        the ConcatVectorIterator with the value before the incrementation

        Tests whether the positions of two iterators are equal
      • notEqual

        public boolean notEqual​(DOMElem.Iterator other)
        Tests whether the positions of two iterators are unequal
        Parameters:
        other - [in] ConcatVectorIterator to compare with
        Returns:
        true if unequal
      • isName

        public boolean isName​(java.lang.String elemname)
        test if name of this elem equals elemname
        Parameters:
        elemname - [in] string name to test with
        Returns:
        true if elemname equals name of this DOMElem, false otherwise
      • getName

        public java.lang.String getName()
        get name of this DOMElem
        Returns:
        name of DOMElem
      • getValue

        public java.lang.String getValue()
        get string value of this DOMElem
        Returns:
        string value of this elem
      • getValueAsInt

        public int getValueAsInt()
        get value as an integer, throws an exception if this is not an
        int value.
        Returns:
        the int value
      • getValueAsDouble

        public double getValueAsDouble()
        get value as an double floating point, throws an exception if this is not an
        double value.
        Returns:
        the double value
      • getValueAsStringList

        public vector_s getValueAsStringList​(char stringseperator)
        get value as a list of strings, throws an exception if this is not a
        list of strings. The default string seperator is semicolon (;).
        Returns:
        list of strings
      • getValueAsStringList

        public vector_s getValueAsStringList()
        get value as a list of strings, throws an exception if this is not a
        list of strings. The default string seperator is semicolon (;).
        Returns:
        list of strings
      • getValueAsDoubleList

        public vector_d getValueAsDoubleList()
        get value as a list of doubles, throws an exception if this is not a
        list of doubles. The default string seperator is space ( ).
        Returns:
        list of doubles
      • getValueAsDoubleList

        public vector_d getValueAsDoubleList​(int N)
        get value as a list of N doubles, throws an exception if this is not a
        list of N doubles. The default string seperator is space ( ).
        Returns:
        list of N doubles
      • getChild

        public DOMElemPtr getChild​(java.lang.String name,
                                   boolean optional)
        get a child with a specific name. If more children with the same name occur then
        it cannot be guaranteed which is returned. If optional is false then an exception will be
        thrown if the child cannot be found. If optional is true then NULL is returned if child
        is not found.
        Parameters:
        name - [in] name of the child to find
        optional - [in]
        Returns:
        the DOMElem child if found, else either NULL (is optional) or an exception is
        thrown.
      • getChild

        public DOMElemPtr getChild​(java.lang.String name)
        get a child with a specific name. If more children with the same name occur then
        it cannot be guaranteed which is returned. If optional is false then an exception will be
        thrown if the child cannot be found. If optional is true then NULL is returned if child
        is not found.
        Parameters:
        name - [in] name of the child to find

        Returns:
        the DOMElem child if found, else either NULL (is optional) or an exception is
        thrown.
      • getAttribute

        public DOMElemPtr getAttribute​(java.lang.String name,
                                       boolean optional)
        get a attribute with a specific name. If more attributes with the same name occur
        then it cannot be guaranteed which is returned. If optional is false then an exception
        will be thrown if the child cannot be found. If optional is true then NULL is returned if
        child is not found.
        Parameters:
        name - [in] name of the attribute to find
        optional - [in]
        Returns:
        the DOMElem attribute if found, else either NULL (is optional) or an exception is
        thrown.
      • getAttribute

        public DOMElemPtr getAttribute​(java.lang.String name)
        get a attribute with a specific name. If more attributes with the same name occur
        then it cannot be guaranteed which is returned. If optional is false then an exception
        will be thrown if the child cannot be found. If optional is true then NULL is returned if
        child is not found.
        Parameters:
        name - [in] name of the attribute to find

        Returns:
        the DOMElem attribute if found, else either NULL (is optional) or an exception is
        thrown.
      • hasChild

        public boolean hasChild​(java.lang.String name)
        test if this DOMElem has a child by name name.
        Parameters:
        name - [in] name of the child DOMElem
        Returns:
        true if this DOMElem has a child with name name
      • hasChildren

        public boolean hasChildren()
        test if this DOMElem has any children
        Returns:
        true if this DOMElem has any children
      • hasAttribute

        public boolean hasAttribute​(java.lang.String name)
        test if this DOMElem has an attribute by name name.
        Parameters:
        name - [in] name of the attribute DOMElem
        Returns:
        true if this DOMElem has an attribute with name name
      • getAttributeValue

        public java.lang.String getAttributeValue​(java.lang.String name)
        Get the value of attribute as a string.
        Parameters:
        name - [in] the name of the attribute.
        Returns:
        the value.
      • getAttributeValue

        public java.lang.String getAttributeValue​(java.lang.String name,
                                                  java.lang.String default_value)
        std::string&)
        Parameters:
        default_value - [in] a default value to return if attibute is not found.
      • getAttributeValueAsInt

        public int getAttributeValueAsInt​(java.lang.String name)
        Get the value of attribute as an integer.
        Parameters:
        name - [in] the name of the attribute.
        Returns:
        the value.
      • getAttributeValueAsInt

        public int getAttributeValueAsInt​(java.lang.String name,
                                          int default_value)
        std::string&)
        Parameters:
        default_value - [in] a default value to return if attibute is not found.
      • getAttributeValueAsDouble

        public double getAttributeValueAsDouble​(java.lang.String name)
        Get the value of attribute as an double.
        Parameters:
        name - [in] the name of the attribute.
        Returns:
        the value.
      • getAttributeValueAsDouble

        public double getAttributeValueAsDouble​(java.lang.String name,
                                                double default_value)
        std::string&)
        Parameters:
        default_value - [in] a default value to return if attibute is not found.
      • getValueAsBool

        public boolean getValueAsBool()
        Get the value as a boolean.
        Returns:
        boolean value.
      • getAttributeValueAsBool

        public boolean getAttributeValueAsBool​(java.lang.String name)
        Get the value of attribute as an boolean.
        Parameters:
        name - [in] the name of the attribute.
        Returns:
        the value.
      • getAttributeValueAsBool

        public boolean getAttributeValueAsBool​(java.lang.String name,
                                               boolean default_value)
        std::string&)
        Parameters:
        default_value - [in] a default value to return if attibute is not found.
      • begin

        public DOMElem.Iterator begin()
        Get iterator to first child element.
        Returns:
        iterator.
      • end

        public DOMElem.Iterator end()
        Get iterator to last child element.
        Returns:
        iterator.
      • addChild

        public DOMElemPtr addChild()
        Add a child with an empty name.
        Returns:
        pointer to the new child element.
      • addChild

        public DOMElemPtr addChild​(java.lang.String name)
        Add a child element.
        Parameters:
        name - [in] name of child.
        Returns:
        pointer to the new child element.
      • addAttribute

        public DOMElemPtr addAttribute​(java.lang.String name)
        Add an attribute element.
        Parameters:
        name - [in] name of the attribute.
        Returns:
        pointer to the new attribute.
      • setValue

        public void setValue​(java.lang.String val)
        Set the value of this element.
        Parameters:
        val - [in] new value.
      • setValue

        public void setValue​(boolean val)
        std::string&)
      • setValue

        public void setValue​(int val)
        std::string&)
      • setValue

        public void setValue​(double val)
        std::string&)
      • setName

        public void setName​(java.lang.String val)
        Set the name of this element.
        Parameters:
        val - [in] new name.
      • setValueString

        public void setValueString​(java.lang.String val)
        std::string&)