Package org.robwork.sdurw_core
Class DOMElemCPtr
- java.lang.Object
-
- org.robwork.sdurw_core.DOMElemCPtr
-
public class DOMElemCPtr extends java.lang.ObjectPtr 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.voiddelete()DOMElemderef()The pointer stored in the object.booleanequals(DOMElem p)static longgetCPtr(DOMElemCPtr obj)DOMElemgetDeref()Member access operator.java.lang.StringgetName()get name of this DOMElemjava.lang.StringgetValue()get string value of this DOMElemdoublegetValueAsDouble()get value as an double floating point, throws an exception if this is not an
double value.vector_dgetValueAsDoubleList()get value as a list of doubles, throws an exception if this is not a
list of doubles.vector_dgetValueAsDoubleList(int N)get value as a list of N doubles, throws an exception if this is not a
list of N doubles.intgetValueAsInt()get value as an integer, throws an exception if this is not an
int value.vector_sgetValueAsStringList()get value as a list of strings, throws an exception if this is not a
list of strings.vector_sgetValueAsStringList(char stringseperator)get value as a list of strings, throws an exception if this is not a
list of strings.booleanhasAttribute(java.lang.String name)test if this DOMElem has an attribute by name name.booleanhasChild(java.lang.String name)test if this DOMElem has a child by name name.booleanhasChildren()test if this DOMElem has any childrenbooleanisName(java.lang.String elemname)test if name of this elem equals elemnamebooleanisNull()checks if the pointer is nullbooleanisShared()check if this Ptr has shared ownership or none
ownership
-
-
-
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
-
-