Package net.sf.okapi.common.resource
Class Segment
- java.lang.Object
-
- net.sf.okapi.common.resource.TextPart
-
- net.sf.okapi.common.resource.Segment
-
- All Implemented Interfaces:
Cloneable,IResource,IWithAnnotations,IWithProperties,IWithSkeleton
public class Segment extends TextPart
Implement a special content part that is a segment. A segment is aTextPartwith an identifier.
-
-
Field Summary
Fields Modifier and Type Field Description static StringREF_MARKER-
Fields inherited from class net.sf.okapi.common.resource.TextPart
annotations, id, originalId, properties, text, whitespaceStrategy
-
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 Segment()Creates an empty Segment object with a null identifier.Segment(String id)Creates an empty Segment object with a given identifier.Segment(String id, TextFragment text)Creates a Segment object with a given identifier and a given text fragment.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Segmentclone()Clone ofTextPartvoidforceId(String id)Deprecated.useIResource#setId(String)booleanisSegment()Indicates if this part is aSegment.static StringmakeRefMarker(String segId)-
Methods inherited from class net.sf.okapi.common.resource.TextPart
getAnnotations, getContent, getId, getOriginalId, getProperties, getWhitespaceStrategy, preserveWhitespaces, setContent, setId, setOriginalId, setPreserveWhitespaces, setWhitespaceStrategy, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.okapi.common.resource.IWithAnnotations
annotationIterator, clear, getAnnotation, getAnnotationsTypesAsSet, hasAnnotation, hasAnnotations, remove, setAnnotation
-
Methods inherited from interface net.sf.okapi.common.resource.IWithProperties
getProperty, getPropertyNames, hasProperty, propertyIterator, removeProperty, setProperty
-
Methods inherited from interface net.sf.okapi.common.resource.IWithSkeleton
getSkeleton, setSkeleton
-
-
-
-
Field Detail
-
REF_MARKER
public static String REF_MARKER
-
-
Constructor Detail
-
Segment
public Segment()
Creates an empty Segment object with a null identifier.
-
Segment
public Segment(String id)
Creates an empty Segment object with a given identifier.- Parameters:
id- identifier for the new segment (Can be null).
-
Segment
public Segment(String id, TextFragment text)
Creates a Segment object with a given identifier and a given text fragment.- Parameters:
id- identifier for the new segment (Can be null).text- text fragment for the new segment.
-
-
Method Detail
-
isSegment
public boolean isSegment()
Description copied from class:TextPartIndicates if this part is aSegment.
-
forceId
@Deprecated public void forceId(String id)
Deprecated.useIResource#setId(String)- Parameters:
id-
-
-