public abstract class AbstractContainer extends OdinElement
Modifier and Type | Field and Description |
---|---|
protected int |
size |
Constructor and Description |
---|
AbstractContainer() |
Modifier and Type | Method and Description |
---|---|
void |
buildContentExtra(java.util.function.Consumer<OdinExtra> consumer)
Build the element content extra by using a consumer.
If this element already contains content extra, the consumer is called with it, else new extra is created. Content extra contains comments and empty lines that appear after the last child of this element in odn. If this element has no children, this content extra contains all comments and empty lines. |
abstract void |
clear() |
OdinElement |
find(java.lang.String name)
Find element in elements hierarchy.
|
<T> T |
findValue(java.lang.String name)
Find object value in elements hierarchy.
|
abstract OdinElement |
get(int index)
Get the
OdinElement present at the given index. |
OdinExtra |
getContentExtra()
Get content extra of this element.
Content extra contains comments and empty lines that appear after the last child of this element in odn. If this element has no children, this content extra contains all comments and empty lines. |
abstract <T> T |
getValue(int index)
Get the object value present at the given index.
|
boolean |
hasContentExtra()
Get if content extra is defined for this element.
Content extra contains comments and empty lines that appear after the last child of this element in odn. If this element has no children, this content extra contains all comments and empty lines. |
boolean |
isEmpty() |
abstract OdinElement |
removeFrom(int index)
Remove the
OdinElement present at the given index. |
void |
setContentExtra(OdinExtra contentExtra)
Set the content extra of this element.
Content extra contains comments and empty lines that appear after the last child of this element in odn. If this element has no children, this content extra contains all comments and empty lines. |
int |
size() |
public boolean hasContentExtra()
public OdinExtra getContentExtra()
public void setContentExtra(OdinExtra contentExtra)
contentExtra
- extra to usepublic void buildContentExtra(java.util.function.Consumer<OdinExtra> consumer)
consumer
- extra consumergetContentExtra()
public int size()
public boolean isEmpty()
public abstract void clear()
public abstract OdinElement get(int index)
OdinElement
present at the given index.index
- element positionpublic abstract <T> T getValue(int index)
T
- the type of the returned objectindex
- element positionpublic abstract OdinElement removeFrom(int index)
OdinElement
present at the given index.index
- element positionpublic OdinElement find(java.lang.String name)
name
- element pathpublic <T> T findValue(java.lang.String name)
T
- returned object typename
- object name