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 aTextPart
with an identifier.
-
-
Field Summary
Fields Modifier and Type Field Description static String
REF_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 Modifier and Type Method Description Segment
clone()
Clone ofTextPart
boolean
isSegment()
Indicates if this part is aSegment
.static String
makeRefMarker(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.
-
-