org.jboss.dna.jcr.cache
Class ChangedChildren

java.lang.Object
  extended by org.jboss.dna.jcr.cache.ImmutableChildren
      extended by org.jboss.dna.jcr.cache.ChangedChildren
All Implemented Interfaces:
Iterable<ChildNode>, Children

@NotThreadSafe
public class ChangedChildren
extends ImmutableChildren

A non-thread safe implementation of Children that can be modified in place. This is typically used to capture changes made within a session.


Constructor Summary
ChangedChildren(Children original)
           
 
Method Summary
 ChangedChildren with(Name newChildName, Path.Segment beforeChild, UUID newChildUuid, PathFactory pathFactory)
          Create another Children object that is equivalent to this node but with the supplied child added before the named node.
 ChangedChildren with(Name newChildName, UUID newChildUuid, PathFactory pathFactory)
          Create another Children object that is equivalent to this node but with the supplied child added.
 ChangedChildren without(UUID childUuid, PathFactory pathFactory)
          Create another Children object that is equivalent to this node but without the supplied child.
 
Methods inherited from class org.jboss.dna.jcr.cache.ImmutableChildren
getChild, getChild, getChildren, getCountOfSameNameSiblingsWithName, getParentUuid, iterator, size, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChangedChildren

public ChangedChildren(Children original)
Method Detail

with

public ChangedChildren with(Name newChildName,
                            UUID newChildUuid,
                            PathFactory pathFactory)
Create another Children object that is equivalent to this node but with the supplied child added.

Overrides:
with in class ImmutableChildren
Parameters:
newChildName - the name of the new child; may not be null
newChildUuid - the UUID of the new child; may not be null
pathFactory - the factory that can be used to create Path and/or Path.Segment instances.
Returns:
the new Children object; never null
See Also:
ImmutableChildren.with(org.jboss.dna.graph.property.Name, java.util.UUID, org.jboss.dna.graph.property.PathFactory)

with

public ChangedChildren with(Name newChildName,
                            Path.Segment beforeChild,
                            UUID newChildUuid,
                            PathFactory pathFactory)
Create another Children object that is equivalent to this node but with the supplied child added before the named node.

Parameters:
newChildName - the name of the new child; may not be null
beforeChild - the path segment of the child before which this node should be added; may not be null
newChildUuid - the UUID of the new child; may not be null
pathFactory - the factory that can be used to create Path and/or Path.Segment instances.
Returns:
the new Children object; never null

without

public ChangedChildren without(UUID childUuid,
                               PathFactory pathFactory)
Create another Children object that is equivalent to this node but without the supplied child.

Overrides:
without in class ImmutableChildren
Parameters:
childUuid - the UUID of the child to be removed; may not be null
pathFactory - the factory that can be used to create Path and/or Path.Segment instances.
Returns:
the new Children object; never null
See Also:
ImmutableChildren.without(java.util.UUID, org.jboss.dna.graph.property.PathFactory)


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.