|
2.9.0: 2008-11-26 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.util.overview.Node
public class Node
A node in an overview. There are two types of nodes: folder nodes
and item nodes. The only difference is that an item node has a link
to a BasicItem
(see getItem()
but a folder node does not.
Both node types can have child nodes.
Each node has a unique ID (getId()
) which is based on the system
hashcode. Each node also has a name which should be unique among the
child nodes. If the name isn't unique the getChild(String)
returns the
first matching node.
Nested Class Summary | |
---|---|
static class |
Node.Type
The type of node. |
Field Summary | |
---|---|
private int |
childErrors
|
private List<Node> |
children
|
private int |
childWarnings
|
private BasicItem |
item
|
private String |
name
|
private int |
numErrors
|
private int |
numWarnings
|
private Node |
parent
|
private String |
title
|
private Node.Type |
type
|
Constructor Summary | |
---|---|
|
Node(String name,
String title,
BasicItem item)
Create an item-type root node. |
|
Node(String name,
String title,
Node parent)
Create a folder-type child node. |
|
Node(String name,
String title,
Node parent,
BasicItem item)
Create an item-type child node |
private |
Node(String name,
String title,
Node parent,
BasicItem item,
Node.Type type)
|
Method Summary | |
---|---|
protected void |
addChild(Node child)
Add a child node to this one. |
protected void |
addChildErrors(int numErrors)
Add child errors to this node. |
protected void |
addChildWarnings(int numWarnings)
Add child warnings to this node. |
void |
addErrors(int numErrors)
Add more errors to this node. |
void |
addWarnings(int numWarnings)
Add more warnings to this node. |
void |
clearFailures()
Clear all warnings, errors on this node and on all child nodes. |
Node |
getChild(String name)
Get the child node with a specific name. |
int |
getChildErrors()
Get the number of errors to children of this node. |
List<Node> |
getChildren()
Get all child nodes of this node. |
int |
getChildWarnings()
Get the number of warnings to children of this node. |
String |
getId()
Get a unique ID for this node. |
BasicItem |
getItem()
Get the item that is related to this node. |
String |
getName()
Get the name of this node. |
Node.Type |
getNodeType()
Get the node type of this node. |
int |
getNumErrors()
Get the number of errors on this node. |
int |
getNumWarnings()
Get the number of warnings on this node. |
Node |
getParent()
Get the parent of this node. |
String |
getTitle()
Get the display title of this node. |
void |
setErrors(int numErrors)
Set the number of errors that was found while validating this node. |
void |
setWarnings(int numWarnings)
Set the number of warnings that was found while validating this node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private String name
private String title
private BasicItem item
private Node parent
private Node.Type type
private List<Node> children
private int numWarnings
private int numErrors
private int childWarnings
private int childErrors
Constructor Detail |
---|
public Node(String name, String title, BasicItem item)
name
- The name of the nodetitle
- The display title of the nodeitem
- The item the node referencesExperimentOverview.getRootNode()
public Node(String name, String title, Node parent)
name
- The name of the child nodetitle
- The display title of the nodeparent
- The parent nodepublic Node(String name, String title, Node parent, BasicItem item)
name
- The name of the child nodetitle
- The display title of the nodeparent
- The parent nodeitem
- The item this node referencesprivate Node(String name, String title, Node parent, BasicItem item, Node.Type type)
Method Detail |
---|
public String getId()
public Node.Type getNodeType()
getItem()
always return null. It it returns null for
an item-type node it usually means that access was denied to that
particular item.
public String getName()
getParent().getChild(this.getName())
should return this node.
public String getTitle()
public BasicItem getItem()
public Node getParent()
public List<Node> getChildren()
public Node getChild(String name)
name
- The name of the child node.protected void addChild(Node child)
public void setWarnings(int numWarnings)
numWarnings
- The number of warningsaddWarnings(int)
public void addWarnings(int numWarnings)
numWarnings
- The numer of warnings to addsetWarnings(int)
protected void addChildWarnings(int numWarnings)
public void setErrors(int numErrors)
numErrors
- The number of errorsaddErrors(int)
public void addErrors(int numErrors)
numErrors
- The numer of errors to addsetErrors(int)
protected void addChildErrors(int numErrors)
public int getNumWarnings()
getChildWarnings()
public int getNumErrors()
getChildErrors()
public int getChildWarnings()
getNumWarnings()
public int getChildErrors()
getNumErrors()
public void clearFailures()
|
2.9.0: 2008-11-26 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |