org.modeshape.jcr.cache.document

## Interface LazyCachedNode.ParentReferenceToSelf

- All Known Implementing Classes:
    LazyCachedNode.NonRootParentReferenceToSelf, LazyCachedNode.RootParentReferenceToSelf
  Enclosing class:
    LazyCachedNode

      protected static interface LazyCachedNode.ParentReferenceToSelf

  A single object used to cache the parent's `ChildReference` that points to this node and methods that determine whether this cached information is still valid.

- - ### 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.

- - ### Method Detail

    - #### childReferenceInParent

          ChildReference childReferenceInParent()

      Get the cached `ChildReference` instance.
      Returns:
        the child reference; never null

    - #### isComplete

          boolean isComplete()

      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.
      Returns:
        true if this object is still complete, or false if any information becomes garbage collected

    - #### isValid

          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.
      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

    - #### isRoot

          boolean isRoot()

      Get whether this represents the `child reference` pointing to the root node.
      Returns:
        true if the object that owns this is the root node, or false otherwise

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