ovidiu 02/03/23 23:38:32 Modified: src/scratchpad/schecoon/src/org/apache/cocoon/components/flow WebContinuation.java Log: Implement getContinuation(int) which retrieves the ancestor continuations. Revision Changes Path 1.2 +23 -1 xml-cocoon2/src/scratchpad/schecoon/src/org/apache/cocoon/components/flow/WebContinuation.java Index: WebContinuation.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/scratchpad/schecoon/src/org/apache/cocoon/components/flow/WebContinuation.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- WebContinuation.java 21 Mar 2002 23:19:04 -0000 1.1 +++ WebContinuation.java 24 Mar 2002 07:38:32 -0000 1.2 @@ -87,7 +87,29 @@ } /** - * Return the parent <code>WebContinuation</code>. + * Return the ancestor continuation situated <code>level</code>s + * above the current continuation. The current instance is + * considered to be at level 0. The parent continuation of the + * receiving instance at level 1, its parent is at level 2 relative + * to the receiving instance. If <code>level</code> is bigger than + * the depth of the tree, the root of the tree is returned. + * + * @param level an <code>int</code> value + * @return a <code>WebContinuation</code> value + */ + public WebContinuation getContinuation(int level) + { + if (level <= 0) + return this; + else if (parentContinuation == null) + return this; + else + return parentContinuation.getContinuation(level - 1); + } + + /** + * Return the parent <code>WebContinuation</code>. Equivalent with + * <code>getContinuation(1)</code>. * * @return a <code>WebContinuation</code> value */
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]