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 String
parentId
protected int
refCount
-
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 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(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
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:IReferenceable
Indicates if this resource is a referent (i.e. is referred to by another resource) or not.- Specified by:
isReferent
in interfaceIReferenceable
- 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 interfaceIReferenceable
- 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 interfaceIReferenceable
- 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 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.
-
-