myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "Tree2" by Jan Dockx
Date Thu, 25 Aug 2005 20:34:46 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by Jan Dockx:
http://wiki.apache.org/myfaces/Tree2

------------------------------------------------------------------------------
    }
  
  ...
+ }
  }}}
  
+ The tree model is actually a wrapper around a tree of {{{TreeNode}}} instances. 
+ 
+ {{{TreeNode}}} is an interface, where only 4 methods are relevant to the operation of the
tree2: {{{String getType()}}}, {{{boolean isLeaf()}}}, {{{List getChildren()}}} and {{{int
getChildCount()}}}. All the other methods are leftovers, and should be removed in some future
version.
+ 
+ {{{int getChildCount()}}} returns the number of children of this node. This can easily be
implemented as:
+ {{{
+   ...
+ 
+   public final int getChildCount() {
+     return getChildren().size();
+   }
+ 
+   ...
+ }}}
+ The method appears in the interface to make lazy loading of the children possible. An implementor
could write code that returns the number of children without actually instantiating objects
for all children beforehand.
  
  == Notes ==
  === Errors ===

Mime
View raw message