jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: [jr3] Tree model
Date Mon, 05 Mar 2012 12:53:00 GMT


On 5.3.12 12:36, Marcel Reutegger wrote:
>>      /**
>>       * Returns the number of child nodes of this node.
>>       *
>>       * @return number of child nodes
>>       */
>>      int getChildNodeCount();
>
> this doesn't work well when you have concurrent child node
> operations. e.g. one session adds a child node while another
> session removes the child nodes. IMO it would be better if

That interface represents an immutable state. So the child node count 
will never change but rather reflect a snapshot in time.

> the number of child nodes is calculated by the caller. why
> do we have the method anyway? ;)

Dunno ;-) The Microkernel provides this information so it might be handy 
to also have it further up the stack.

Michael


>>      Iterable<ChildNodeEntry>  getChildNodeEntries(int offset, int length);
>
> doesn't this imply that the implementation will keep the child
> nodes in a list?
>
> how about:
> Iterable<ChildNodeEntry>  getChildNodeEntries(ChildNodeEntry start, int length);
>
> or
> Iterable<ChildNodeEntry>  getChildNodeEntries(String childNodeNameStart, int length);
>
> regards
>   Marcel

Mime
View raw message