Enum ChildNodeDirection
- java.lang.Object
-
- java.lang.Enum<ChildNodeDirection>
-
- net.sf.basedb.util.overview.node.ChildNodeDirection
-
- All Implemented Interfaces:
Serializable
,Comparable<ChildNodeDirection>
public enum ChildNodeDirection extends Enum<ChildNodeDirection>
Represents the direction to use for loading child nodes in a tree. We need to keep track of this since we need to support rooting a tree at any type of item (eg. at an experiment, hybridization, biosource, etc).For every tree there is a natural order of items. For example, BioSource -> Sample -> Extract -> ... -> Experiment. The natural order is the forward-loading direction and the opposite order is the reverse-loading direction.
For example, if we root the tree at a Hybridization we will load children in the forward-loading direction down to experiment and in the revers-loading direction up to biosource and array design. For each node that is added to a tree we need to keep track if we should continue up or down the natural order. Otherwise we will end up in an infinite loop.
In a tree there can also be side-nodes that in most cases are end-point or leaf nodes. This is for example nodes containing information about protocol, software, annotations, etc. We call such nodes property nodes and they are usually loaded in both the forward- and reverse-loading directions.
- Version:
- 2.10
- Author:
- Nicklas
- See Also:
Node.getChildNodeDirection()
- Last modified
- $Date$
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
loadForward
private boolean
loadProperty
private boolean
loadReverse
-
Constructor Summary
Constructors Modifier Constructor Description private
ChildNodeDirection(boolean loadForward, boolean loadReverse, boolean loadProperty)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
loadForward()
boolean
loadProperty()
boolean
loadReverse()
static ChildNodeDirection
valueOf(String name)
Returns the enum constant of this type with the specified name.static ChildNodeDirection[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final ChildNodeDirection NONE
Represents an end-point node. No more child nodes should be loaded, not even property nodes.
-
PROPERTY
public static final ChildNodeDirection PROPERTY
Only property child nodes should be loaded.
-
FORWARD
public static final ChildNodeDirection FORWARD
Child nodes should be loaded in the forward-loading direction. Property nodes should also be loaded.
-
REVERSE
public static final ChildNodeDirection REVERSE
Child nodes should be loaded in the reverse-loading direction. Property nodes should also be loaded.
-
ALL
public static final ChildNodeDirection ALL
-
-
Method Detail
-
values
public static ChildNodeDirection[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ChildNodeDirection c : ChildNodeDirection.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ChildNodeDirection valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
loadReverse
public boolean loadReverse()
- Returns:
- TRUE if child nodes in the reverse-loading direction should be loaded
-
loadForward
public boolean loadForward()
- Returns:
- TRUE if child nodes in the forward-loading direction should be loaded
-
loadProperty
public boolean loadProperty()
- Returns:
- TRUE if property child nodes should be loaded
-
-