diff -r b66166091f15 xml.xam/src/org/netbeans/modules/xml/xam/AbstractComponent.java --- a/xml.xam/src/org/netbeans/modules/xml/xam/AbstractComponent.java Tue Jul 28 14:18:42 2009 +0400 +++ b/xml.xam/src/org/netbeans/modules/xml/xam/AbstractComponent.java Thu Jul 30 02:28:54 2009 +0400 @@ -138,7 +138,23 @@ public abstract class AbstractComponent< List result = new ArrayList(_getChildren()); return Collections.unmodifiableList(result); } - + + /** + * This method works much faster then using getChildren() in case of big + * amount of children because of absence of list's copying. + */ + public void checkChildrenPopulated() { + _getChildren(); + } + + /** + * This method works much faster then using getChildren().size() in case of big + * amount of children because of absence of list's copying. + */ + public int getChildrenCount() { + return _getChildren().size(); + } + /** * This method provides the ability to detect whether calling getChildren() * will trigger population of children. This can be used for meta models diff -r b66166091f15 xml.xam/src/org/netbeans/modules/xml/xam/dom/AbstractDocumentComponent.java --- a/xml.xam/src/org/netbeans/modules/xml/xam/dom/AbstractDocumentComponent.java Tue Jul 28 14:18:42 2009 +0400 +++ b/xml.xam/src/org/netbeans/modules/xml/xam/dom/AbstractDocumentComponent.java Thu Jul 30 02:28:54 2009 +0400 @@ -473,7 +473,7 @@ public abstract class AbstractDocumentCo } protected DocumentModelAccess getAccess() { - getChildren(); //make sure children populated before potential mutation + checkChildrenPopulated(); //make sure children populated before potential mutation return (DocumentModelAccess) getModel().getAccess(); } diff -r b66166091f15 xml.xam/src/org/netbeans/modules/xml/xam/dom/AbstractDocumentModel.java --- a/xml.xam/src/org/netbeans/modules/xml/xam/dom/AbstractDocumentModel.java Tue Jul 28 14:18:42 2009 +0400 +++ b/xml.xam/src/org/netbeans/modules/xml/xam/dom/AbstractDocumentModel.java Thu Jul 30 02:28:54 2009 +0400 @@ -469,7 +469,7 @@ public abstract class AbstractDocumentMo Element e = pathFromRoot.get(current); if (base.referencesSameNode(e)) { if (pathFromRoot.size() == current + 1) { - base.getChildren(); // make sure children inited + base.checkChildrenPopulated(); // make sure children inited return base; } else { for (Object child : base.getChildren()) { diff -r 7ad0eec2c334 xml.xam/nbproject/project.properties --- a/xml.xam/nbproject/project.properties Mon May 04 22:21:11 2009 +0400 +++ b/xml.xam/nbproject/project.properties Thu May 14 19:32:19 2009 +0400 @@ -42,4 +42,5 @@ is.autoload=true is.autoload=true javac.source=1.5 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.6.0 +javadoc.apichanges=${basedir}/apichanges.xml +spec.version.base=1.7.0 diff -r 7ad0eec2c334 xml.xam/apichanges.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml.xam/apichanges.xml Thu May 14 19:35:25 2009 +0400 @@ -0,0 +1,148 @@ + + + + + + + + + + + + + Extansible Abstract Model (XAM) + + + + + + + + + Two new methods to enhance model's performance + + + + + +

+ Two new methods are added: + {@link org.netbeans.modules.xml.xam.dom.AbstractComponent#checkChildrenPopulated()} + and + {@link org.netbeans.modules.xml.xam.dom.AbstractComponent#getChildrenCount()} + They are intended to be used instead of getChildren() in cases when the children's list isn't required. +

+
+ + +
+ +
+ + + + + + + Change History for the Extansible Abstract Model (XAM) + + + + + + +

Introduction

+ +

This document lists changes made to the Extansible Abstract Model (XAM).

+
+ +

@FOOTER@

+ +
+ +