|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.okapi.common.resource.TextPart
net.sf.okapi.common.resource.Segment
public class Segment
Implement a special content part that is a segment.
A segment is a TextPart with an identifier.
| Field Summary | |
|---|---|
protected Annotations |
annotations
|
java.lang.String |
id
Identifier of this segment. |
static java.lang.String |
REF_MARKER
|
| Fields inherited from class net.sf.okapi.common.resource.TextPart |
|---|
text |
| Constructor Summary | |
|---|---|
Segment()
Creates an empty Segment object with a null identifier. |
|
Segment(java.lang.String id)
Creates an empty Segment object with a given identifier. |
|
Segment(java.lang.String id,
TextFragment text)
Creates a Segment object with a given identifier and a given text fragment. |
|
| Method Summary | ||
|---|---|---|
Segment |
clone()
|
|
void |
forceId(java.lang.String id)
Forces the id of this segment to a specific value. |
|
|
getAnnotation(java.lang.Class<A> annotationType)
Gets the annotation object for a given class for this segment. |
|
java.lang.Iterable<IAnnotation> |
getAnnotations()
Gets the iterable list for the annotations of this segment. |
|
java.lang.String |
getId()
Gets the identifier for this segment. |
|
boolean |
isSegment()
Indicates if this part is a Segment. |
|
static java.lang.String |
makeRefMarker(java.lang.String segId)
|
|
void |
setAnnotation(IAnnotation annotation)
Sets an annotation object for this segment. |
|
| Methods inherited from class net.sf.okapi.common.resource.TextPart |
|---|
getContent, setContent, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String REF_MARKER
protected Annotations annotations
public java.lang.String id
| Constructor Detail |
|---|
public Segment()
public Segment(java.lang.String id)
public Segment(java.lang.String id,
TextFragment text)
id - identifier for the new segment (Can be null).text - text fragment for the new segment.| Method Detail |
|---|
public Segment clone()
clone in class TextPartpublic boolean isSegment()
TextPartSegment.
isSegment in class TextPartSegment, false if it is not.public java.lang.String getId()
public void forceId(java.lang.String id)
id - the new value of the segment.public <A extends IAnnotation> A getAnnotation(java.lang.Class<A> annotationType)
annotationType - the class of the annotation object to retrieve.
public void setAnnotation(IAnnotation annotation)
If an annotation of the same type exists already it is overridden.
annotation - the annotation object to set.public java.lang.Iterable<IAnnotation> getAnnotations()
public static java.lang.String makeRefMarker(java.lang.String segId)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||