Package 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:
Cloneable,IResource,INameable,IReferenceable,IWithAnnotations,IWithProperties,IWithSkeleton
- Direct Known Subclasses:
DocumentPart,StartGroup,TextUnit
public class BaseReferenceable extends BaseNameable implements IReferenceable
Implements a nameable resource that can be a referent.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringparentIdprotected intrefCount-
Fields inherited from class net.sf.okapi.common.resource.BaseNameable
id, isTranslatable, mimeType, name, preserveWS, 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 Description BaseReferenceable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetParentId()Gets the identifier of the parent resource of this resource.intgetReferenceCount()Gets the number of time this referent is referenced to.booleanisReferent()Indicates if this resource is a referent (i.e.voidsetIsReferent(boolean value)Sets the flag indicating if this resource is a referent (i.e.voidsetParentId(String id)Sets the identifier of the parent resource of this resource.voidsetReferenceCount(int value)Sets the number of time this referent is referenced to.-
Methods inherited from class net.sf.okapi.common.resource.BaseNameable
getAnnotation, getAnnotations, getId, getMimeType, getName, getProperties, getProperty, getPropertyNames, getSkeleton, getType, hasProperty, isTranslatable, preserveWhitespaces, removeProperty, setAnnotation, setId, setIsTranslatable, setMimeType, setName, setPreserveWhitespaces, setProperty, setSkeleton, setType, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.okapi.common.resource.IWithAnnotations
annotationIterator, clear, getAnnotationsTypesAsSet, hasAnnotation, hasAnnotations, remove
-
Methods inherited from interface net.sf.okapi.common.resource.IWithProperties
propertyIterator
-
-
-
-
Field Detail
-
refCount
protected int refCount
-
parentId
protected String parentId
-
-
Method Detail
-
isReferent
public boolean isReferent()
Description copied from interface:IReferenceableIndicates if this resource is a referent (i.e. is referred to by another resource) or not.- Specified by:
isReferentin interfaceIReferenceable- Returns:
- true if this resource is a referent, false if it is not.
-
setIsReferent
public void setIsReferent(boolean value)
Description copied from interface:IReferenceableSets 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:
setIsReferentin interfaceIReferenceable- Parameters:
value- true if the resource is a referent, false if it is not.
-
getReferenceCount
public int getReferenceCount()
Description copied from interface:IReferenceableGets the number of time this referent is referenced to.- Specified by:
getReferenceCountin interfaceIReferenceable- Returns:
- the number of time this referent is referenced to.
-
setReferenceCount
public void setReferenceCount(int value)
Description copied from interface:IReferenceableSets the number of time this referent is referenced to.- Specified by:
setReferenceCountin interfaceIReferenceable- Parameters:
value- the number of time this referent is referenced to.
-
getParentId
public 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(String id)
Sets the identifier of the parent resource of this resource.- Parameters:
id- the identifier to set.
-
-