org.modeshape.jcr.value.basic

## Class NodeKeyReference

- java.lang.Object
- - org.modeshape.jcr.value.basic.NodeKeyReference

- All Implemented Interfaces:
    Serializable, Comparable<Reference>, Reference

      @Immutable
      public class NodeKeyReference
      extends Object
      implements Reference

  A `Reference` implementation that uses a single `NodeKey` as the pointer.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `NodeKeyReference(NodeKey key, boolean weak, boolean foreign)`
    `protected` | `NodeKeyReference(NodeKey key, boolean weak, boolean foreign, boolean simple)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Reference that)`
    `boolean` | `equals(Object obj)`
    `NodeKey` | `getNodeKey()`
    `String` | `getString()` Get the string form of the Reference.
    `String` | `getString(TextEncoder encoder)` Get the encoded string form of the Reference, using the supplied encoder to encode characters in the reference.
    `int` | `hashCode()`
    `boolean` | `isForeign()` Determine whether this reference is a reference to a node which belongs to another source as the owning node.
    `boolean` | `isSimple()` Determine whether this reference is a uni-directional reference
    `boolean` | `isWeak()` Determine whether this reference is considered a weak reference.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### NodeKeyReference

          protected NodeKeyReference(NodeKey key,
                          boolean weak,
                          boolean foreign)

    - #### NodeKeyReference

          protected NodeKeyReference(NodeKey key,
                          boolean weak,
                          boolean foreign,
                          boolean simple)

  - ### Method Detail

    - #### isForeign

          public boolean isForeign()

      Description copied from interface: `Reference`
      Determine whether this reference is a reference to a node which belongs to another source as the owning node.
      Specified by:
        `isForeign` in interface `Reference`
      Returns:
        true if the reference is foreign, false otherwise

    - #### isSimple

          public boolean isSimple()

      Description copied from interface: `Reference`
      Determine whether this reference is a uni-directional reference
      Specified by:
        `isSimple` in interface `Reference`
      Returns:
        true if this is a uni-directional, or false otherwise

    - #### getNodeKey

          public NodeKey getNodeKey()

      Returns:
        uuid

    - #### getString

          public String getString()

      Description copied from interface: `Reference`
      Get the string form of the Reference. The `default encoder` is used to encode characters in the reference.
      Specified by:
        `getString` in interface `Reference`
      Returns:
        the encoded string
      See Also:
        `Reference.getString(TextEncoder)`

    - #### getString

          public String getString(TextEncoder encoder)

      Description copied from interface: `Reference`
      Get the encoded string form of the Reference, using the supplied encoder to encode characters in the reference.
      Specified by:
        `getString` in interface `Reference`
      Parameters:
        `encoder` - the encoder to use, or null if the `default encoder` should be used
      Returns:
        the encoded string
      See Also:
        `Reference.getString()`

    - #### isWeak

          public boolean isWeak()

      Description copied from interface: `Reference`
      Determine whether this reference is considered a weak reference.
      Specified by:
        `isWeak` in interface `Reference`
      Returns:
        true if this is a weak reference, or false otherwise

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### compareTo

          public int compareTo(Reference that)

      Specified by:
        `compareTo` in interface `Comparable<Reference>`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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