Module data.api
Interface Treeable<T,TR extends Treeable<T,TR>>
-
- Type Parameters:
T- the generic type of the value from this tree dataTR- the generic type of the concrete data that will implement this interface
- All Known Subinterfaces:
IdentifiableTreeable<PK,T,TR>,IdentifiableTreeableVersionable<PK,T,TR>,TreeWithChildren<T,TR>
public interface Treeable<T,TR extends Treeable<T,TR>>The interfaceTreeablecan keep information for a tree structure.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOLUMN_NAME_DEPTHThe Constant for the column name 'depth'.static java.lang.StringCOLUMN_NAME_NODEThe Constant for the column name 'node'.static java.lang.StringCOLUMN_NAME_PARENTThe Constant for the column name 'parent'.static java.lang.StringCOLUMN_NAME_VALUEThe Constant for the column name 'value'.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetDepth()Gets the depth of this tree nodeTRgetParent()Gets the parent of this tree nodeTgetValue()Gets the valuebooleanisNode()Checks if this is a node or a leafvoidsetDepth(int depth)Sets the new depth of this tree nodevoidsetNode(boolean node)Sets the node flagvoidsetParent(TR parent)Sets the parent of this tree nodevoidsetValue(T value)Sets the value
-
-
-
Field Detail
-
COLUMN_NAME_DEPTH
static final java.lang.String COLUMN_NAME_DEPTH
The Constant for the column name 'depth'.- See Also:
- Constant Field Values
-
COLUMN_NAME_NODE
static final java.lang.String COLUMN_NAME_NODE
The Constant for the column name 'node'.- See Also:
- Constant Field Values
-
COLUMN_NAME_PARENT
static final java.lang.String COLUMN_NAME_PARENT
The Constant for the column name 'parent'.- See Also:
- Constant Field Values
-
COLUMN_NAME_VALUE
static final java.lang.String COLUMN_NAME_VALUE
The Constant for the column name 'value'.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDepth
int getDepth()
Gets the depth of this tree node- Returns:
- the depth of this tree node
-
setDepth
void setDepth(int depth)
Sets the new depth of this tree node- Parameters:
depth- the new depth
-
getParent
TR getParent()
Gets the parent of this tree node- Returns:
- the parent of this tree node
-
setParent
void setParent(TR parent)
Sets the parent of this tree node- Parameters:
parent- the new parent of this tree node
-
getValue
T getValue()
Gets the value- Returns:
- the value
-
setValue
void setValue(T value)
Sets the value- Parameters:
value- the new value
-
isNode
boolean isNode()
Checks if this is a node or a leaf- Returns:
- true, if it is a node otherwise false if it is a leaf
-
setNode
void setNode(boolean node)
Sets the node flag- Parameters:
node- the new node flag
-
-