Package net.sf.okapi.tm.pensieve.common
Class TranslationUnit
- java.lang.Object
-
- net.sf.okapi.tm.pensieve.common.TranslationUnit
-
public class TranslationUnit extends Object
Represents a Unit of Translation.
-
-
Constructor Summary
Constructors Constructor Description TranslationUnit()Creates a TU w/o an source or target definedTranslationUnit(TranslationUnitVariant source, TranslationUnitVariant target)Creates a TU with the provided source and targets
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetadatagetMetadata()Gets the metadata or attributes for this TUStringgetMetadataValue(MetadataType key)Gets the value for a give metadata value fieldTranslationUnitVariantgetSource()TranslationUnitVariantgetTarget()booleanisSourceEmpty()Checks to see if the the source is emptybooleanisTargetEmpty()Checks to see if the the target is emptyvoidsetMetadata(Metadata metadata)voidsetMetadataValue(MetadataType key, String value)Sets the value for a give metadata value fieldvoidsetSource(TranslationUnitVariant source)voidsetTarget(TranslationUnitVariant target)StringtoString()
-
-
-
Constructor Detail
-
TranslationUnit
public TranslationUnit()
Creates a TU w/o an source or target defined
-
TranslationUnit
public TranslationUnit(TranslationUnitVariant source, TranslationUnitVariant target)
Creates a TU with the provided source and targets- Parameters:
source- The source of the TUtarget- The target of the TU
-
-
Method Detail
-
getMetadata
public Metadata getMetadata()
Gets the metadata or attributes for this TU- Returns:
- The Metadata of this TU
-
setMetadata
public void setMetadata(Metadata metadata)
-
getSource
public TranslationUnitVariant getSource()
-
getTarget
public TranslationUnitVariant getTarget()
-
setSource
public void setSource(TranslationUnitVariant source)
-
setTarget
public void setTarget(TranslationUnitVariant target)
-
isSourceEmpty
public boolean isSourceEmpty()
Checks to see if the the source is empty- Returns:
- true if the source is empty
-
setMetadataValue
public void setMetadataValue(MetadataType key, String value)
Sets the value for a give metadata value field- Parameters:
key- the key for the data we want setvalue- the vlaue to set the metadata to
-
isTargetEmpty
public boolean isTargetEmpty()
Checks to see if the the target is empty- Returns:
- true if the target is empty
-
getMetadataValue
public String getMetadataValue(MetadataType key)
Gets the value for a give metadata value field- Parameters:
key- the key for the data we want- Returns:
- the value for a give metadata value field
-
-