Package org.robwork.sdurw_core
Class DOMElem.Iterator
- java.lang.Object
-
- org.robwork.sdurw_core.DOMElem.Iterator
-
- Enclosing class:
- DOMElem
public static class DOMElem.Iterator extends java.lang.Object
DOMElem iterator based on concrete ItImpl implementations.
-
-
Constructor Summary
Constructors Constructor Description Iterator()
constructorIterator(long cPtr, boolean cMemoryOwn)
Iterator(DOMElem.Iterator right)
constructorIterator(DOMElem.ItImpl impl)
constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DOMElemPtr
__deref__()
Pointer to the T elementDOMElemPtr
__ref__()
Reference to the T elementDOMElemPtr
addAttribute(java.lang.String name)
Add an attribute element.DOMElemPtr
addChild()
Add a child with an empty name.DOMElemPtr
addChild(java.lang.String name)
Add a child element.DOMElem.Iterator
assign(DOMElem.Iterator right)
Assignment operator.DOMElem.Iterator
begin()
Get iterator to first child element.void
delete()
DOMElem.Iterator
end()
Get iterator to last child element.boolean
equals(DOMElem.Iterator other)
Increments the position of the iteratorDOMElemPtr
getAttribute(java.lang.String name)
get a attribute with a specific name.DOMElemPtr
getAttribute(java.lang.String name, boolean optional)
get a attribute with a specific name.SWIGTYPE_p_rw__core__iter_pairT_rw__core__DOMElem__Iterator_t
getAttributes()
Get iterator to attributes.java.lang.String
getAttributeValue(java.lang.String name)
Get the value of attribute as a string.java.lang.String
getAttributeValue(java.lang.String name, java.lang.String default_value)
std::string&)boolean
getAttributeValueAsBool(java.lang.String name)
Get the value of attribute as an boolean.boolean
getAttributeValueAsBool(java.lang.String name, boolean default_value)
std::string&)double
getAttributeValueAsDouble(java.lang.String name)
Get the value of attribute as an double.double
getAttributeValueAsDouble(java.lang.String name, double default_value)
std::string&)int
getAttributeValueAsInt(java.lang.String name)
Get the value of attribute as an integer.int
getAttributeValueAsInt(java.lang.String name, int default_value)
std::string&)DOMElemPtr
getChild(java.lang.String name)
get a child with a specific name.DOMElemPtr
getChild(java.lang.String name, boolean optional)
get a child with a specific name.SWIGTYPE_p_rw__core__iter_pairT_rw__core__DOMElem__Iterator_t
getChildren()
Get iterator to child elements.static long
getCPtr(DOMElem.Iterator obj)
java.lang.String
getName()
get name of this DOMElemjava.lang.String
getValue()
get string value of this DOMElemboolean
getValueAsBool()
Get the value as a boolean.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 childrenDOMElem.Iterator
incement()
Increments the position of the iteratorboolean
isName(java.lang.String elemname)
test if name of this elem equals elemnameboolean
notEqual(DOMElem.Iterator other)
Tests whether the positions of two iterators are unequalvoid
setName(java.lang.String val)
Set the name of this element.void
setValue(boolean val)
std::string&)void
setValue(double val)
std::string&)void
setValue(int val)
std::string&)void
setValue(java.lang.String val)
Set the value of this element.void
setValueString(java.lang.String val)
std::string&)
-
-
-
Constructor Detail
-
Iterator
public Iterator(long cPtr, boolean cMemoryOwn)
-
Iterator
public Iterator()
constructor
-
Iterator
public Iterator(DOMElem.ItImpl impl)
constructor
-
Iterator
public Iterator(DOMElem.Iterator right)
constructor
-
-
Method Detail
-
getCPtr
public static long getCPtr(DOMElem.Iterator obj)
-
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 findoptional
- [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 findoptional
- [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.
-
getChildren
public SWIGTYPE_p_rw__core__iter_pairT_rw__core__DOMElem__Iterator_t getChildren()
Get iterator to child elements.- Returns:
- iterator pair for the first and last elements.
-
getAttributes
public SWIGTYPE_p_rw__core__iter_pairT_rw__core__DOMElem__Iterator_t getAttributes()
Get iterator to attributes.- Returns:
- iterator pair for the first and last attributes.
-
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&)
-
-