org.modeshape.jcr.cache.document

## Class LazyCachedNode.RootParentReferenceToSelf

- java.lang.Object
- - org.modeshape.jcr.cache.document.LazyCachedNode.RootParentReferenceToSelf

- All Implemented Interfaces:
    LazyCachedNode.ParentReferenceToSelf
  Enclosing class:
    LazyCachedNode

      @Immutable
      protected static final class LazyCachedNode.RootParentReferenceToSelf
      extends Object
      implements LazyCachedNode.ParentReferenceToSelf

  A `LazyCachedNode.ParentReferenceToSelf` implementation used only for the root node. The root node never changes, but it is the only node that does not have a `ChildReference` pointing to it. Since ModeShape keeps all node names within the `ChildReference` instances, this method simply holds onto a special `ChildReference that contains the root's name`.

  This class is immutable, and it is only used for the root `LazyCachedNode` instance (which can indeed change as properties and children are added/removed/changed.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `LazyCachedNode.RootParentReferenceToSelf(WorkspaceCache cache)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ChildReference` | `childReferenceInParent()` Get the cached `ChildReference` instance.
    `boolean` | `isComplete()` Determine if this object is still complete.
    `boolean` | `isRoot()` Get whether this represents the `child reference` pointing to the root node.
    `boolean` | `isValid(CachedNode recentParent)` Determine if this instance is still valid, given the supplied `CachedNode` instance that represents the most-recently acquired parent node representation.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LazyCachedNode.RootParentReferenceToSelf

          protected LazyCachedNode.RootParentReferenceToSelf(WorkspaceCache cache)

  - ### Method Detail

    - #### isRoot

          public boolean isRoot()

      Description copied from interface: `LazyCachedNode.ParentReferenceToSelf`
      Get whether this represents the `child reference` pointing to the root node.
      Specified by:
        `isRoot` in interface `LazyCachedNode.ParentReferenceToSelf`
      Returns:
        true if the object that owns this is the root node, or false otherwise

    - #### childReferenceInParent

          public ChildReference childReferenceInParent()

      Description copied from interface: `LazyCachedNode.ParentReferenceToSelf`
      Get the cached `ChildReference` instance.
      Specified by:
        `childReferenceInParent` in interface `LazyCachedNode.ParentReferenceToSelf`
      Returns:
        the child reference; never null

    - #### isComplete

          public boolean isComplete()

      Description copied from interface: `LazyCachedNode.ParentReferenceToSelf`
      Determine if this object is still complete. Some implementations use weak references that can eventually become nulled as the target is garbage collected. When that happens, this method should return true.
      Specified by:
        `isComplete` in interface `LazyCachedNode.ParentReferenceToSelf`
      Returns:
        true if this object is still complete, or false if any information becomes garbage collected

    - #### isValid

          public boolean isValid(CachedNode recentParent)

      Description copied from interface: `LazyCachedNode.ParentReferenceToSelf`
      Determine if this instance is still valid, given the supplied `CachedNode` instance that represents the most-recently acquired parent node representation.
      Specified by:
        `isValid` in interface `LazyCachedNode.ParentReferenceToSelf`
      Parameters:
        `recentParent` - the most recent cached node for the parent
      Returns:
        true if this object is still valid, or false if the parent's information has changed since this object was created

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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