net.sf.okapi.common.resource

## Class BaseReferenceable

- java.lang.Object
- - net.sf.okapi.common.resource.BaseNameable
  - - net.sf.okapi.common.resource.BaseReferenceable

- All Implemented Interfaces:
    IResource, INameable, IReferenceable, IWithAnnotations, IWithBilingualProperties, IWithProperties
  Direct Known Subclasses:
    DocumentPart, StartGroup

      public class BaseReferenceable
      extends BaseNameable
      implements IReferenceable

  Implements a nameable resource that can be a referent.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `parentId`
    `protected int` | `refCount`

    - ### Fields inherited from class net.sf.okapi.common.resource.BaseNameable

      `annotations, id, isTranslatable, mimeType, name, preserveWS, properties, skeleton, sourceProperties, type`

    - ### Fields inherited from interface net.sf.okapi.common.IResource

      `COPY_ALL, COPY_CONTENT, COPY_PROPERTIES, COPY_SEGMENTATION, COPY_SEGMENTED_CONTENT, CREATE_EMPTY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseReferenceable()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getParentId()` Gets the identifier of the parent resource of this resource.
    `int` | `getReferenceCount()` Gets the number of time this referent is referenced to.
    `boolean` | `isReferent()` Indicates if this resource is a referent (i.e.
    `void` | `setIsReferent(boolean value)` Sets the flag indicating if this resource is a referent (i.e.
    `void` | `setParentId(java.lang.String id)` Sets the identifier of the parent resource of this resource.
    `void` | `setReferenceCount(int value)` Sets the number of time this referent is referenced to.

    - ### Methods inherited from class net.sf.okapi.common.resource.BaseNameable

      `createTargetProperty, getAnnotation, getAnnotations, getId, getMimeType, getName, getProperties, getProperty, getPropertyNames, getSkeleton, getSourceProperties, getSourceProperty, getSourcePropertyNames, getTargetLocales, getTargetProperty, getTargetPropertyNames, getType, hasProperty, hasSourceProperty, hasTargetProperty, isTranslatable, preserveWhitespaces, removeProperty, removeSourceProperty, removeTargetProperty, setAnnotation, setId, setIsTranslatable, setMimeType, setName, setPreserveWhitespaces, setProperties, setProperty, setSkeleton, setSourceProperties, setSourceProperty, setTargetProperty, setType, toString`

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

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

- - ### Field Detail

    - #### refCount

          protected int refCount

    - #### parentId

          protected java.lang.String parentId

  - ### Constructor Detail

    - #### BaseReferenceable

          public BaseReferenceable()

  - ### Method Detail

    - #### isReferent

          public boolean isReferent()

      Description copied from interface: `IReferenceable`
      Indicates if this resource is a referent (i.e. is referred to by another resource) or not.
      Specified by:
        `isReferent` in interface `IReferenceable`
      Returns:
        true if this resource is a referent, false if it is not.

    - #### setIsReferent

          public void setIsReferent(boolean value)

      Description copied from interface: `IReferenceable`
      Sets the flag indicating if this resource is a referent (i.e. is referred to by another resource) or not. This also sets the count of time this referent is referenced to 1.
      Specified by:
        `setIsReferent` in interface `IReferenceable`
      Parameters:
        `value` - true if the resource is a referent, false if it is not.

    - #### getReferenceCount

          public int getReferenceCount()

      Description copied from interface: `IReferenceable`
      Gets the number of time this referent is referenced to.
      Specified by:
        `getReferenceCount` in interface `IReferenceable`
      Returns:
        the number of time this referent is referenced to.

    - #### setReferenceCount

          public void setReferenceCount(int value)

      Description copied from interface: `IReferenceable`
      Sets the number of time this referent is referenced to.
      Specified by:
        `setReferenceCount` in interface `IReferenceable`
      Parameters:
        `value` - the number of time this referent is referenced to.

    - #### getParentId

          public java.lang.String getParentId()

      Gets the identifier of the parent resource of this resource.
      Returns:
        the identifier of this resource's parent, or null if there is none.

    - #### setParentId

          public void setParentId(java.lang.String id)

      Sets the identifier of the parent resource of this resource.
      Parameters:
        `id` - the identifier to set.