Class DOMElemCPtr


  • public class DOMElemCPtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Summary

      Constructors 
      Constructor Description
      DOMElemCPtr()
      Default constructor yielding a NULL-pointer.
      DOMElemCPtr​(long cPtr, boolean cMemoryOwn)  
      DOMElemCPtr​(DOMElem ptr)
      Do not take ownership of ptr.

      ptr can be null.

      The constructor is implicit on purpose.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DOMElem __ref__()
      Dereferencing operator.
      void delete()  
      DOMElem deref()
      The pointer stored in the object.
      boolean equals​(DOMElem p)  
      static long getCPtr​(DOMElemCPtr obj)  
      DOMElem getDeref()
      Member access operator.
      java.lang.String getName()
      get name of this DOMElem
      java.lang.String getValue()
      get string value of this DOMElem
      double getValueAsDouble()
      get value as an double floating point, throws an exception if this is not an
      double value.
      vector_d getValueAsDoubleList()
      get value as a list of doubles, throws an exception if this is not a
      list of doubles.
      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.
      int getValueAsInt()
      get value as an integer, throws an exception if this is not an
      int value.
      vector_s getValueAsStringList()
      get value as a list of strings, throws an exception if this is not a
      list of strings.
      vector_s getValueAsStringList​(char stringseperator)
      get value as a list of strings, throws an exception if this is not a
      list of strings.
      boolean hasAttribute​(java.lang.String name)
      test if this DOMElem has an attribute by name name.
      boolean hasChild​(java.lang.String name)
      test if this DOMElem has a child by name name.
      boolean hasChildren()
      test if this DOMElem has any children
      boolean isName​(java.lang.String elemname)
      test if name of this elem equals elemname
      boolean isNull()
      checks if the pointer is null
      boolean isShared()
      check if this Ptr has shared ownership or none
      ownership
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DOMElemCPtr

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

        public DOMElemCPtr()
        Default constructor yielding a NULL-pointer.
      • DOMElemCPtr

        public DOMElemCPtr​(DOMElem ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • getCPtr

        public static long getCPtr​(DOMElemCPtr obj)
      • delete

        public void delete()
      • deref

        public DOMElem deref()
        The pointer stored in the object.
      • __ref__

        public DOMElem __ref__()
        Dereferencing operator.
      • getDeref

        public DOMElem getDeref()
        Member access operator.
      • equals

        public boolean equals​(DOMElem p)
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • 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
      • 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