Java Doc for Group.java in  » Ajax » zk » org » zkoss » idom » 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 » Ajax » zk » org.zkoss.idom 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.zkoss.idom.Group

All known Subclasses:   org.zkoss.idom.impl.AbstractGroup,
Group
public interface Group extends Item(Code)
Represents an item might have children. Group is also a item. Developers usually extend new classes from org.zkoss.idom.impl.AbstractGroup , rather than implement this interface directly.

Design consideration: we don't support removeChildren and setChild or alike, because they can be done easily with List's methods and getAttributeIndex.
author:
   tomyeh
See Also:   Item
See Also:   Attributable
See Also:   Namespaceable
See Also:   Binable





Method Summary
public  intcoalesce(boolean recursive)
     Coalesces children if they are siblings with the same type instances of Textual, Textual.isCoalesceable returns true.
public  ListdetachChildren()
     Detaches all children and returns them in a list.

Note: you cannot add children to anther Group by doing group.addAll(e.getChildren()), because you have to detach them first.

public  ListgetChildren()
     Gets all children.

The returned list is "live".

public  ElementgetElement(String namespace, String name, int mode)
     Gets the first Element-type child that matches the giving criteria.

Note: only Element-type children are returned.

public  ElementgetElement(String tname)
     Gets the first Element-type child with the tag name. It is the same as childOf(nsURI, lname, null, 0).

Note: only Element-type children are returned.

public  intgetElementIndex(int indexFrom, String namespace, String name, int mode)
     Gets the index of the Element-type first child that match the specified criteria.
public  intgetElementIndex(int indexFrom, String tname)
     Gets the index of the first Element-type child with the specified name.
public  SetgetElementNames()
     Returns a readonly set of names of element children.
public  StringgetElementValue(String namespace, String name, int mode, boolean trim)
     Gets the value of the first Element-type child that matches the giving criteria, with a trimming option.
public  StringgetElementValue(String tname, boolean trim)
     Gets the text of the first Element-type child with the tag name, with a trimming option.
public  ListgetElements(String namespace, String name, int mode)
     Gets a readonly list of Element-type children that match the giving criteria.

Unlike Element.getElementsByTagName , this method only returns child elements, excluding grand children and other descedants.

The returned list is a 'live-facade' of the real ones, so the performance is good, and any modification to Group.getChildren will affect it.

Note: only Element-type children are returned.

public  ListgetElements(String tname)
     Gets a readonly list of children with the tag name.

Unlike Element.getElementsByTagName , this method only returns child elements, excluding grand children and other descedants.

The returned list is a 'live-facade' of the real ones, so the performance is good, and any modification to Group.getChildren will affect it.

Note: only Element-type children are returned.

public  ListgetElements()
     Returns a cloned copy of all element childrens

Unlike Group.getChildren and Group.getElementNames , the returned list is NOT a 'live-facade' of the real ones.




Method Detail
coalesce
public int coalesce(boolean recursive)(Code)
Coalesces children if they are siblings with the same type instances of Textual, Textual.isCoalesceable returns true.

SAXBuilder.build will do the merging automatically.
Parameters:
  recursive - true to coalesce all descendants;false to coalesce only the direct children




detachChildren
public List detachChildren()(Code)
Detaches all children and returns them in a list.

Note: you cannot add children to anther Group by doing group.addAll(e.getChildren()), because you have to detach them first. Then, you could use this method:
group.addAll(e.detachChildren());




getChildren
public List getChildren()(Code)
Gets all children.

The returned list is "live". Any modification to it affects the node. On the other hand, Group.getElements(String) returns a copy.

Unlike JDOM, it won't coalesce adjacent children automatically since it might violate the caller's expection about List. Rather, we provide coalesce to let caller do the merging explicity. Note: when building a iDOM tree from a source (SAXBuilder.build), coalesce() will be inovked automatically.

Note: not all items supports children. If this item doesn't, it returns an empty list. And, if any invocation tries to add vertices to the returned list will cause UnsupportOperationException.




getElement
public Element getElement(String namespace, String name, int mode)(Code)
Gets the first Element-type child that matches the giving criteria.

Note: only Element-type children are returned. Depending on the mode, the searching is usually linear -- take O(n) to complete.
Parameters:
  namespace - the namspace URI if FIND_BY_PREFIX is not specified;the namespace prefix if FIND_BY_PREFIX specified; null to ingore
Parameters:
  name - the local name if FIND_BY_TAGNAME is not sepcified;the tag name if FIND_BY_TAGNAME specified; null to ignore
Parameters:
  mode - the search mode; zero or any combination of FIND_xxx. the found element; null if not found or not supported




getElement
public Element getElement(String tname)(Code)
Gets the first Element-type child with the tag name. It is the same as childOf(nsURI, lname, null, 0).

Note: only Element-type children are returned. Also, we did some optimization for this method so its access time is nearly constant.
Parameters:
  tname - the tag name (i.e., Namespaceable.getName) the found element; null if not found or not supported




getElementIndex
public int getElementIndex(int indexFrom, String namespace, String name, int mode)(Code)
Gets the index of the Element-type first child that match the specified criteria.

Note: only Element-type children are returned, since others have no name.
Parameters:
  indexFrom - the index to start searching from; 0 for beginning
Parameters:
  namespace - the namspace URI if FIND_BY_PREFIX is not specified;the namespace prefix if FIND_BY_PREFIX specified; null to ingore
Parameters:
  name - the local name if FIND_BY_TAGNAME is not sepcified;the tag name if FIND_BY_TAGNAME specified; null to ignore
Parameters:
  mode - the serach mode; zero or any combination ofItem.FIND_xxx, except FIND_RECURSIVE the index if found; -1 if not found




getElementIndex
public int getElementIndex(int indexFrom, String tname)(Code)
Gets the index of the first Element-type child with the specified name.

Note: only Element-type children are returned, since others have no name.

getChildren().add(getElementIndex(0, "pre:name"),
 new Element("pre:another"));

Parameters:
  indexFrom - the index to start searching from; 0 for beginning
Parameters:
  tname - the tag name (i.e., Namespaceable.getName) the index if found; -1 if not found



getElementNames
public Set getElementNames()(Code)
Returns a readonly set of names of element children. Then, you could use Group.getElements to get elements.

The returned list is a 'live-facade' of the real ones, so the performance is good, and any modification to Group.getChildren will affect it.
See Also:   Group.getElements()




getElementValue
public String getElementValue(String namespace, String name, int mode, boolean trim)(Code)
Gets the value of the first Element-type child that matches the giving criteria, with a trimming option.
Parameters:
  namespace - the namspace URI if FIND_BY_PREFIX is not specified;the namespace prefix if FIND_BY_PREFIX specified; null to ingore
Parameters:
  name - the local name if FIND_BY_TAGNAME is not sepcified;the tag name if FIND_BY_TAGNAME specified; null to ignore the value of the first Element-type child ; null if not found



getElementValue
public String getElementValue(String tname, boolean trim)(Code)
Gets the text of the first Element-type child with the tag name, with a trimming option.
Parameters:
  tname - the tag name (i.e., Namespaceable.getName) the text of the first Element-type child withthe tag name; null if not found



getElements
public List getElements(String namespace, String name, int mode)(Code)
Gets a readonly list of Element-type children that match the giving criteria.

Unlike Element.getElementsByTagName , this method only returns child elements, excluding grand children and other descedants.

The returned list is a 'live-facade' of the real ones, so the performance is good, and any modification to Group.getChildren will affect it.

Note: only Element-type children are returned. Depending on the mode, the searching is usually linear -- take O(n) to complete.
Parameters:
  namespace - the namspace URI if FIND_BY_PREFIX is not specified;the namespace prefix if FIND_BY_PREFIX specified; null to ingore
Parameters:
  name - the local name if FIND_BY_TAGNAME is not sepcified;the tag name if FIND_BY_TAGNAME specified; null to ignore
Parameters:
  mode - the search mode; zero or any combination of FIND_xxx. a read-only list containing all matched children;an empty list if not found or not supported




getElements
public List getElements(String tname)(Code)
Gets a readonly list of children with the tag name.

Unlike Element.getElementsByTagName , this method only returns child elements, excluding grand children and other descedants.

The returned list is a 'live-facade' of the real ones, so the performance is good, and any modification to Group.getChildren will affect it.

Note: only Element-type children are returned. Also, we did some optimization for this method so its access time is nearly constant.
Parameters:
  tname - the tag name (i.e., Namespaceable.getName)




getElements
public List getElements()(Code)
Returns a cloned copy of all element childrens

Unlike Group.getChildren and Group.getElementNames , the returned list is NOT a 'live-facade' of the real ones.
See Also:   Group.getElementNames()




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