Java Doc for Node.java in  » J2EE » Jaffa » org » jaffa » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Jaffa » org.jaffa.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jaffa.util.Node

Node
public class Node (Code)
An instance of this class can represent a node in a tree. Each node will have a system generated unique identifier. It may have a name (which can be non-unique). It can be linked to a Parent node or be the Root of the tree. It can have child nodes. It will have a value Object. Additionally it can have a map of attributes.



Constructor Summary
public  Node()
    
public  Node(String name)
     Creates new Node specifying a name.

Method Summary
public  voidaddChild(Node node)
     Adds a child node.
public  ObjectgetAttribute(Object key)
     Returns the attribute for the specified key.
Parameters:
  key - The attribute key.
public  MapgetAttributes()
     Getter for property attributes.
public  NodegetChildById(String id)
     Returns the child by id.
Parameters:
  id - The node identifier.
public  NodegetChildByName(String name)
     Returns the 1st child which matches the name.
Parameters:
  name - The node name.
public  CollectiongetChildren()
     Returns a collection of child nodes.
public  NodegetFromFamilyById(String id)
     Returns a node from the family by id.
Parameters:
  id - The node identifier.
public  StringgetId()
     Returns the unique identifier of the node.
public  StringgetName()
     Getter for property name.
public  NodegetParent()
     Returns the Parent node, or null if this node has no parent.
public  NodegetRoot()
     Returns the root node of the tree to which this node belongs.
public  ObjectgetValue()
     Getter for property value.
public  booleanhasChildren()
     Returns true if the node has childen.
public  booleanisRoot()
     Returns true if the node is its own root.
public static  voidmain(String[] args)
     Test rig
Parameters:
  args - The arguments.
public  voidmakeRoot()
     Makes the node its own root.
public  booleanparentHasMoreChildren()
     Returns true if the parent node has any more child nodes after the current node.
public  voidprintNode(java.io.Writer writer)
     A helper routine to print the contents of a node.
public  voidprintNode(java.io.Writer writer, String pad, String padIncrement)
     A helper routine to print the contents of a node.
public  ObjectremoveAttribute(Object key)
     Removes an attribute .
Parameters:
  key - The attribute key.
public  booleanremoveChild(Node node)
     Removes a child node.
public  booleanremoveChild(String name)
     Removes the 1st child that matches the name
Parameters:
  name - The node name.
public  booleanremoveChildren()
     Remove all children.
public  ObjectsetAttribute(Object key, Object value)
     Adds an attribute.
public  voidsetAttributes(Map attributes)
     Setter for property attributes.
public  voidsetName(String name)
     Setter for property name.
public  voidsetValue(Object value)
     Setter for property value.


Constructor Detail
Node
public Node()(Code)
Creates new Node



Node
public Node(String name)(Code)
Creates new Node specifying a name.
Parameters:
  name - The node name.




Method Detail
addChild
public void addChild(Node node)(Code)
Adds a child node. Will add a link both ways.
Parameters:
  node - The child node.



getAttribute
public Object getAttribute(Object key)(Code)
Returns the attribute for the specified key.
Parameters:
  key - The attribute key. the attribute for the specified key.



getAttributes
public Map getAttributes()(Code)
Getter for property attributes. Value of property attributes.



getChildById
public Node getChildById(String id)(Code)
Returns the child by id.
Parameters:
  id - The node identifier. the child by id.



getChildByName
public Node getChildByName(String name)(Code)
Returns the 1st child which matches the name.
Parameters:
  name - The node name. the 1st child which matches the name.



getChildren
public Collection getChildren()(Code)
Returns a collection of child nodes. a collection of child nodes.



getFromFamilyById
public Node getFromFamilyById(String id)(Code)
Returns a node from the family by id.
Parameters:
  id - The node identifier. a node from the family by id.



getId
public String getId()(Code)
Returns the unique identifier of the node. the unique identifier of the node.



getName
public String getName()(Code)
Getter for property name. Value of property name.



getParent
public Node getParent()(Code)
Returns the Parent node, or null if this node has no parent. the Parent node, or null if this node has no parent.



getRoot
public Node getRoot()(Code)
Returns the root node of the tree to which this node belongs. the root node of the tree to which this node belongs.



getValue
public Object getValue()(Code)
Getter for property value. Value of property value.



hasChildren
public boolean hasChildren()(Code)
Returns true if the node has childen. true if the node has childen.



isRoot
public boolean isRoot()(Code)
Returns true if the node is its own root. true if the node is its own root.



main
public static void main(String[] args)(Code)
Test rig
Parameters:
  args - The arguments. Not used.



makeRoot
public void makeRoot()(Code)
Makes the node its own root. Will remove links from existing parent node, if any.



parentHasMoreChildren
public boolean parentHasMoreChildren()(Code)
Returns true if the parent node has any more child nodes after the current node. true if the parent node has any more child nodes after the current node.



printNode
public void printNode(java.io.Writer writer) throws java.io.IOException(Code)
A helper routine to print the contents of a node.
Parameters:
  writer - The writer to which the node contents will be printed.
throws:
  IOException - if any I/O error occurs.



printNode
public void printNode(java.io.Writer writer, String pad, String padIncrement) throws java.io.IOException(Code)
A helper routine to print the contents of a node.
Parameters:
  writer - The writer to which the node contents will be printed.
Parameters:
  pad - The pad string to be used.
Parameters:
  padIncrement - The increment string to be appended to the pad string at each successive level of child nodes.
throws:
  IOException - if any I/O error occurs.



removeAttribute
public Object removeAttribute(Object key)(Code)
Removes an attribute .
Parameters:
  key - The attribute key. the attribute that was removed, or null if there was no such attribute.



removeChild
public boolean removeChild(Node node)(Code)
Removes a child node. Will add a link both ways.
Parameters:
  node - The child node. true if the child node was removed.



removeChild
public boolean removeChild(String name)(Code)
Removes the 1st child that matches the name
Parameters:
  name - The node name. true if the child node was removed.



removeChildren
public boolean removeChildren()(Code)
Remove all children. true if any child node was removed.



setAttribute
public Object setAttribute(Object key, Object value)(Code)
Adds an attribute. Will replace an existing attribute having the same key.
Parameters:
  key - The attribute key.
Parameters:
  value - The attribute value. previous value associated with specified key, or null if there was no attribute for key.



setAttributes
public void setAttributes(Map attributes)(Code)
Setter for property attributes.
Parameters:
  attributes - New value of property attributes.



setName
public void setName(String name)(Code)
Setter for property name.
Parameters:
  name - New value of property name.



setValue
public void setValue(Object value)(Code)
Setter for property value.
Parameters:
  value - New value of property value.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.