Author: manik.surtani(a)jboss.com
Date: 2009-08-05 06:36:32 -0400 (Wed, 05 Aug 2009)
New Revision: 8147
Modified:
core/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml
core/trunk/src/main/java/org/jboss/cache/Node.java
Log:
JBCACHE-1518 clarify docs and examples
Modified: core/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml
===================================================================
--- core/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml 2009-08-03
23:55:06 UTC (rev 8146)
+++ core/trunk/src/main/docbook/userguide/en/modules/eviction_policies.xml 2009-08-05
10:36:32 UTC (rev 8147)
@@ -138,9 +138,14 @@
<programlisting role="JAVA"><![CDATA[
...
Map lotsOfData = generateData();
- cache.put("/a/b/c", lotsOfData);
- cache.getRoot().getChild("/a").setResident(true);
- cache.getRoot().getChild("/a/b").setResident(true);
+
+ Fqn abc = Fqn.fromString("/a/b/c");
+ Fqn ab = abc.getParent();
+ Fqn a = ab.getParent();
+
+ cache.put(abc, lotsOfData);
+ cache.getRoot().getChild(a).setResident(true);
+ cache.getRoot().getChild(ab).setResident(true);
...
]]></programlisting>
<para>
Modified: core/trunk/src/main/java/org/jboss/cache/Node.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/Node.java 2009-08-03 23:55:06 UTC (rev 8146)
+++ core/trunk/src/main/java/org/jboss/cache/Node.java 2009-08-05 10:36:32 UTC (rev 8147)
@@ -129,14 +129,18 @@
/**
* Returns the child node
*
- * @param f {@link Fqn} of the child node
+ * @param f {@link Fqn} of the child node. This is a relative Fqn.
* @return null if the child does not exist.
*/
Node<K, V> getChild(Fqn f);
/**
- * @param name name of the child
- * @return a direct child of the current node.
+ * @param name name of the child. Note that passing in a String of "/a/b/c"
will <b>not</b> return a node called 'c',
+ * 3 nodes deep. Instead it will try and look for a child called '/a/b/c'
directly under this node.
+ * <p />
+ * If you wish to retrieve a child more than one level deep, use the {@link
#getChild(Fqn)} version of this method.
+ * <p />
+ * @return a direct child of the current node, named by the name parameter.
*/
Node<K, V> getChild(Object name);
Show replies by date