2.17.2: 2011-06-17

net.sf.basedb.util.overview.node
Enum ChildNodeDirection

java.lang.Object
  extended by java.lang.Enum<ChildNodeDirection>
      extended by 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 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$

Enum Constant Summary
ALL
           
FORWARD
          Child nodes should be loaded in the forward-loading direction.
NONE
          Represents an end-point node.
PROPERTY
          Only property child nodes should be loaded.
REVERSE
          Child nodes should be loaded in the reverse-loading direction.
 
Field Summary
private  boolean loadForward
           
private  boolean loadProperty
           
private  boolean loadReverse
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

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
Field Detail

loadForward

private final boolean loadForward

loadReverse

private final boolean loadReverse

loadProperty

private final boolean loadProperty
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 name
NullPointerException - 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

2.17.2: 2011-06-17