org.modeshape.jcr.cache.document

## Class LazyCachedNode.NonRootParentReferenceToSelf

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

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

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

  A `LazyCachedNode.ParentReferenceToSelf` implementation that caches the `ChildReference` from the parent plus the actual parent (via a weak reference to the `CachedNode`.

  This class is immutable, because it is simply discarded when it is out of date; see `LazyCachedNode.parentReferenceToSelf(WorkspaceCache)`).

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `LazyCachedNode.NonRootParentReferenceToSelf(CachedNode parent, ChildReference childReferenceInParent)`

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

          protected LazyCachedNode.NonRootParentReferenceToSelf(CachedNode parent,
                                                     ChildReference childReferenceInParent)

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